[Gdal-dev] dods driver: base, scale, offset (RasterIO)

Rob Cermak cermak at sfos.uaf.edu
Thu Dec 29 19:47:37 EST 2005


Hi,

I'm fairly close, but I've now hit a critical area that I need some expert
help or suggestions on where to place implementation code.

>From an OPeNDAP server, once we come up with a standard, we should be able
to apply various attributes given in the DAS to the data so it can be 
pushed into mapserver and a color pallete as defined by a SLD.

Here is the portion of the DAS that is important:

Attributes {
    HDF_GLOBAL {
[snip]
        String Scaling%20Equation "Base**((Slope*l3m_data) + Intercept) = Parameter value\\000";
        Float32 Base 10;
        Float32 Slope 0.015;
        Float32 Intercept -2;
[snip]
    }
}

No problem, the dods driver needs to get updated with a followup patch
(once we complete the task described below) to allow it to look for
"GLOBAL", "HDF_GLOBAL", "NC_GLOBAL"... that is trivial.

We can definitely standardize on the formula.  
  Base ** ((Slope * pixel) + Intercept)

I've been working with the 'using_dods' to test all the small changes.  
This is where I am now:

Opening the dataset.
Using HDF DAS
Setting missing value : 255
Base : 10
Slope : 0.015
Intercept : -2
Band Number: 1
Block = 1024x256
Type = Byte
NODATA value = 255
SCALE = 0.015
OFFSET = -2
BASE = 10
Min = 0, Max = 255

I've implemented:
  Get/Set:
    Scale <= Slope
    Offset <= Intercept

Added Get/Set(Base) to the GDALRasterData class.

using_dods.cpp uses RasterIO to pull the data in, but I'm not sure
how mapserver uses the GDAL library to pull things in via OPeNDAP.

Does Mapserver use RasterIO?

What I would like to see happen is after or duing the RasterIO call, it
applies the above formula to the data.  Then, all we need is to apply a
SLD color table and viola -- HDF satellite data in Mapscript.

Formula can be applied with one, two or three parts depeding if
the appropriate bOffsetSet, bScaleSet, bBaseSet and/or bNoDataSet is
set.  We would not want to apply the formula to missing data.

Hints to where to insert a hack into the code to convert pixel data to
real data would be great.

Alternative would be to convert the data from our source, but that would 
ballon the storage from basic integers to floats.  Trying to work from 
data natively from the source would be prefereable.

Then, socially, attempt to get all our sources use the same standard 
'terms' for base, slope, intercept...  good luck!

Rob
-- 
Rob Cermak : 907-474-7948 : FAX 907-474-7204 : PGP = 0x75869A6E
Alaska Ocean Observing System : Data Management 
School of Fisheries and Ocean Sciences : University of Alaska Fairbanks
cermak at sfos.uaf.edu : fnjrc1 at uaf.edu
ED9U1M7P01 at alaska.edu : cermak at alaska.edu




More information about the Gdal-dev mailing list