Jochen Deyke wrote:
John Caron wrote:
new file is mostly working, still a few problems
float Range_to_First_Cell;
:long_name = "Range to center of the first cell";
:units = "meters";
:valid_range = 0.0; // float
:missing_value = -999.0; // float
:_FillValue = 0.0; // float
remove valid_range, _FillValue
float PRF(numSystems);
:long_name = "System pulse repetition frequence";
:units = "pulses/sec";
udunits would be 1/sec
I have fixed these problems, and am attaching the newest test file. I
now get a picture in IDV (although it seems to be just a single color
in the case of Z).
If I want to specify avalid range for the data fields (the scaled byte
values), would I need to specify it in terms of the byte value, or the
scaled value?
From nj22 javadoc:
*Implementation rules for missing data with scale/offset*
1. Always converted to a float or double type.
2. _FillValue and missing_value values are always in the units of the
external (packed) data.
3. If valid_range is the same type as scale_factor (actually the
wider of scale_factor and add_offset) and this is wider than the
external data, then it will be interpreted as being in the units
of the internal (unpacked) data. Otherwise it is in the units of
the external (packed) data.
4. The dataType is set to float if all attributes used are float
(scale_factor, add_offset valid_min, valid_max, valid_range,
missing_data and _FillValue) otherwise the dataType is set to double.
The short answer is that we thought it should be in units of packed
data. However, there are a lot of files that used units of scaled data,
so we use the type of the attribute to disambiguate. I would recommend
using packed data type, and be sure type of attribute and data agree.
Also, if the valid range is the entire possible range of bytes (ie
0-255), is there any point to specifying a valid range?
Not from the library POV. Some applications may prefere or require a
valid range attribute, and it wont do any harm.
Generally I prefer using a "missing_value" attribute rather than a
"valid_range" attribute to indicate missing value. A seperate
_FillValue is a good idea for debugging, to find out data inadvertantly
not written.