Arlene-
Just a little more followup:
Stu Wier wrote:
>
> Arlene,
>
> This is not a VisAD problem but rather a limitation of the
> program. The code failing is
>
> Plain plain = new Plain();
> Field sstdata = (Field) plain.open("Geo_Corrected_SST_EDR.nc");
>
> Plain.open returns in general a DataType not a Field;
> in your case with this data file it returns a Tuple of FileFlatFields.
>
The format of Stu's SST file was:
laraine:/home/wier/sstdata% ncdump -h SST_14km_NA_Feb14.nc
netcdf SST_14km_NA_Feb14 {
dimensions:
LON = 721 ;
LAT = 361 ;
TIME1 = UNLIMITED ; // (1 currently)
variables:
double LON(LON) ;
LON:units = "degrees_east" ;
LON:point_spacing = "even" ;
double LAT(LAT) ;
LAT:units = "degrees_north" ;
LAT:point_spacing = "even" ;
double TIME1(TIME1) ;
TIME1:units = "hour since 1997-01-01 00:00:00" ;
TIME1:time_origin = "1-JAN-1997 00:00:00" ;
float ANAL_TEMP(TIME1, LAT, LON) ;
ANAL_TEMP:missing_value = 999.9f ;
ANAL_TEMP:_FillValue = 999.9f ;
ANAL_TEMP:long_name = "Analysis Temperature" ;
ANAL_TEMP:history = "From sst14na" ;
ANAL_TEMP:units = "Deg. C" ;
// global attributes:
:history = "FERRET V5.00 (V500beta1.1) " ;
}
In this case, lat, lon, and time1 are netCDF coordinate variables,
thus the returned VisAD Data object was a Field of the form:
(time1 -> ((LAT,LON) -> ANAL_TEMP))
(Plain() will extract the time out of the domain).
In your netCDF file, you have no netCDF coordinate variables.
What you would end up with is a Tuple of fields:
( ((EDR_rows, EDR_columns) -> (lat)), ((EDR_rows, EDR_columns) ->
(lat)), ((EDR_rows, EDR_columns) -> (seaSurfaceTemperatures)),
(reftime))
If you wanted to plot this as an image, you could create ScalarMaps
of:
EDR_rows -> Display.YAxis
EDR_columns -> Display.XAxis
seaSurfaceTemperatures -> Display.RGB
If you wanted contour lines instead, change Display.RGB to
Display.IsoContour. I'm not sure how Time is being used
in your netCDF file, because it is not a dimension of any
of the other variables in you file.
Since lat and lon are not coordinate variables, if you wanted
to plot this on some sort of georeferenced display, you would
need to create a CoordinateSystem to translate
(row, col) <-> (lat,lon). You could pass in the first two
fields in the Tuple in constructing the CoordinateSystem, and
use the evaluate() method of Field to get the lat and lon
values out of each of the corresponding Fields. The argument
to evaluate would be a RealTuple of the row, col values.
You might want to use the VisAD SpreadSheet to import your
SST file and see what kind of MathType Plain() creates and
play around with different mappings. Then you can code up
what you want in Java. Alternatively, you could use the
VisAD Python interface to play around with the data structures,
etc.
Don
*************************************************************
Don Murray UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx P.O. Box 3000
(303) 497-8628 Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************