The grib2 file is at http://ruc.noaa.gov/ruc_sample.grib2
The relevant part of the code that reads it below.
ncfile = NetcdfFile.open(filename);
Debug.println("ncfile is "+ncfile);
//Debug.println(""+ncfile.getDetailInfo());
Array data4D;
Variable v = null;
Attribute a = null;
// get grid parameters for most variables
Dimension d = ncfile.findDimension("hybrid");
if(d == null) {
Debug.println("Bad dimension for hybrid");
System.exit(1);
}
tuv_levels = d.getLength();
// get variables
int[] origin = new int[] {0, 0, 112,121};
int[] tuv_size = new int[] {1, tuv_levels, 1,1};
v = ncfile.findVariable("Virtual_potential_temperature");
data4D = v.read(origin, tuv_size);
Tvar = (double[])data4D.reduce().get1DJavaArray(double.class);
...
for(int i=0;i<tuv_levels;i++) {
Debug.println("i: "+i+" t "+Tvar[i]);
}
This seems pretty obscure, inasmuch as it doesn't effect other variables like
pressure, but I fail to find any problem in my code, even after simplifying
it down to bare bones.
wgrib2 shows data in all the levels for the specific column specified above.
I'd appreciate whatever help you can provide.
-Bill
On 3/19/2009 1:12 PM, Robb Kambic wrote:
On Thu, 19 Mar 2009, Bill Moninger wrote:
Hi Robb,
any update on this? Is a new version of netcdf4-java available that will
read the grib2 RUC format with its hybrid coordinates?
The netcdf4-java with the hybrid level fixes are available at:
http://www.unidata.ucar.edu/software/netcdf-java/
let me know if you find any problems.
Robb...
Robb Kambic Unidata Program Center
Software Engineer III Univ. Corp for Atmospheric Research
address@hidden WWW: http://www.unidata.ucar.edu/
===============================================================================
--
William R. Moninger http://www-frd.fsl.noaa.gov/~moninger/
NOAA / Earth Systems Research Laboratory / Global Systems Division
325 Broadway, R/GSD1 voice: 303-497-6435
Boulder, CO 80305 fax: 303-497-3329