NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
lat, lon -> val where val might be depth or whatever.I am now trying to contour a field from a netcdf grid file. The IDV does this Ok, but my image is simply a white polygon of the grid itself. My code is this:
String netcdfUrl = args[0]; GeoGridDataSource ggds = new GeoGridDataSource(null, netcdfUrl, null); GridDataset gds = ggds.getDataset(); GeoGrid gg = (GeoGrid)gds.getGrids().get(0); GeoGridAdapter gga = new GeoGridAdapter( ggds, gg, "surface_temperature" ); FieldImpl fi = gga.getData(); System.out.println( fi.getType().prettyString() ); which gives (Time -> ((XC[unit:km], YC[unit:km]) -> surface_temperature[unit:Pa])) Not sure why temp units are Pa?? FlatField ff = (FlatField)fi.getSample(1); System.out.println( ff.getType().prettyString() ); which I presume extracts some time element, and gives ((XC[unit:km], YC[unit:km]) -> surface_temperature[unit:Pa]) Contour2DDisplayable cdd = new Contour2DDisplayable( "foo" ); cdd.setData( fi ); cdd.setContourLevels( new RegularContourLevels( 10, 273, 273, 310 ) ); // cdd.setColorPalette( cyans );I cannot see what I am overlooking. Can the Contour2DDisplayable not be used like this where the domain is not lat, lon?
Any help appreciated Stuart
idvusers
archives: