[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #IRZ-510849]: load an EOS-HDF (ASTER Swath data) using java-netcdf in the IDV



> 
> Dear support,
> 
> I'm trying to load a EOS-HDF (ASTER Swath data) using java-netcdf in the
> IDV (see jython script below). I'm getting the following error on
> display-type "Color-Shaded Plan View":
> 
> visad.VisADException: bad set visad.Gridded2DSet: Dimension = 2 Length = 121
> Dimension 0: Length = 11 Range = -2.48425 to -1.5074538
> Dimension 1: Length = 11 Range = 38.52344 to 39.19869
> 
> I don't think the Java parser is choking on an alias or anything, but the 
> problem is more likely to be this: 
> http://hdfeos.org/forums/archive/index.php?t-79.html. Do you know if your new 
> opendap stuff will work on it? any quick fixes you can suggest?
> 
> I have placed the HDF-file here:
> http://www.itc.nl/personal/venus/tmp/AST_L1B_00307182004110047_08122004112525.hdf
> 
> Tyn
> 
> 

Hi Tyn,
      The problem is that the CDM library can not recognize the coordinate 
system of this file. The CDM library do support a few swath satellite data 
formats, but not in the hdfeos.  I am forward this support to netcdf group to 
see if they have any suggestion.


Yuan
> formula: testhdf(filename[isuser=true, default=*.hdf],param[isuser=true, 
> default=VNIR/VNIR_Swath/Data Fields/ImageData1])
> 
> def testhdf(filename, paramname):
> from ucar.nc2 import NetcdfFile as nf;
> from visad import Gridded2DSet, RealTupleType;
> fn = filename;
> pn = paramname;
> a = nf.open(fn);
> print a
> #vars = a.getVariables();
> #print vars;
> lat = a.findVariable("VNIR/VNIR_Swath/Geolocation Fields/Latitude");
> lon = a.findVariable("VNIR/VNIR_Swath/Geolocation Fields/Longitude");
> tst=a.findVariable(pn);
> llat = lat.read().get1DJavaArray(java.lang.Float);
> llon = lon.read().get1DJavaArray(java.lang.Float);
> ttst = tst.read().get1DJavaArray(java.lang.Float);
> shape = lat.getShape();
> print "Shape: ",shape
> for i in xrange(len(llat)):
> if (llat[i]<-99.):
> llat[i] = java.lang.Float.NaN;
> if (llon[i] < -999.):
> llon[i] = java.lang.Float.NaN;
> if (ttst[i] < -999.):
> ttst[i] = java.lang.Float.NaN;
> gs = Gridded2DSet(RealTupleType.SpatialEarth2DTuple, [llon,llat], shape[1], 
> shape[0], None, None, None,0,0);
> print "gs: ", gs
> ff = field(gs, "Reflectance", ttst);
> #createDisplay('imagedisplay',ff);
> return ff;
> 
> ________________________________
> Faculty of Geo-Information Science and Earth Observation (ITC)
> University of Twente
> Chamber of Commerce: 501305360000
> 
> E-mail disclaimer
> The information in this e-mail, including any attachments, is intended for 
> the addressee only. If you are not the intended recipient, you are hereby 
> notified that any disclosure, copying, distribution or action in relation to 
> the content of this information is strictly prohibited. If you have received 
> this e-mail by mistake, please delete the message and any attachment and 
> inform the sender by return e-mail. ITC accepts no liability for any error or 
> omission in the message content or for damage of any kind that may arise as a 
> result of e-mail transmission.
> 
> 


Ticket Details
===================
Ticket ID: IRZ-510849
Department: Support netCDF Java
Priority: Normal
Status: Open