Unidata Support wrote:
------- Forwarded Message
To: Yuan Ho <yuanho@xxxxxxxxxxxxxxxx>
cc: John Caron <caron@xxxxxxxxxxxxxxxx>,
cc: support-netcdf-java@xxxxxxxxxxxxxxxx
From: "Steve Ansari" <Steve.Ansari@xxxxxxxx>
Subject: Re: GeoTIFF max/min values
Organization: UCAR/Unidata
Keywords: 200508021512.j72FCJjo008373
Yuan,
Wouldn't that mean that the default range values would be -999.0 to 3.0
(in our case)? ArcMap defaults to:
High : 3.40282e+038
Low : 1.17549e-038
Steve
Steve,
I mean yes. If you didn't see these values, you could go to
Layers Properties, then Symbology to make the changes.
After reading John's reply, I think there is one solution that is using
greyscale option, and then multiply the scale to the output data.
In the greyscale option we replace the missing value with min value. Not
a perfect solution, but better then what you see now since
no TIFF client can recognize the missing value at this time. This would
require to have an API to retrieve the scale too.
Yuan
Yuan Ho wrote:
Steve Ansari wrote:
Yuan,
I'm not using greyscale. I've printed out the max and min values
from the section of GeotiffWriter.java that sets the tag values to
verify that the correct max/min values are calculated. It appears
that they are.
MAMath.MinMax dataMinMax = grid.getMinMaxSkipMissingData( data);
float min = (float) (dataMinMax.min);
float max = (float) (dataMinMax.max);
System.out.println(min+","+max); geotiff.addTag( new
IFDEntry(Tag.SMinSampleValue, FieldType.FLOAT).setValue( min));
geotiff.addTag( new IFDEntry(Tag.SMaxSampleValue,
FieldType.FLOAT).setValue( max));
Thanks,
Steve
Steve,
I know why now. It is because of the missing value -999.0.
When we calculated the min and max, we skipped the missing value,
and Arcmap does not look at the min/max tags, or finds the confliction
of tags and data value and takes actual data value -999.0.
Yuan
Yuan Ho wrote:
Steve Ansari wrote:
Hi John,
I did have one other question...
I've been exporting GeoTIFFs from NetCDF files using the
ucar.nc2.geotiff.GeotiffWriter class. When I load the images in
ESRI ArcMap the default max and min values are incorrect. Ex)
High : 3.40282e+038
Low : 1.17549e-038
Steve,
Is the output file greyscale? Otherwise the min and max value
should be stored in these two tags: Tag.SMinSampleValue and
Tag.SMaxSampleValue.
Let me know how do you get these High and Low values, and what are
the values of above two tags.
Yuan
The actual data values are ok and the image is correctly
geolocated. It seems that there may be max/min header or tag
information that may be missing.
Thanks,
Steve