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

Re: [Fwd: Re: [netcdf-java] announce: stable release netcdf-java 4.0]



On Fri, 20 Mar 2009, Bill Moninger wrote:

Hi Robb,

Thanks for this. The new netcdf4-java works nearly perfectly.

Unfortunately, for one of the variables I'm trying to read out of the file, upper levels are filled with fill-values. Its odd, but I've written a bare-bones simple program to read the variable, and I'm getting nothing but fill values above hybrid level 41 for variable "VPTMP", also known as Virtual_potential_temperature in netCDF-land.


Bill,

i display the ruc_sample.grig2 in toolsUI, hybrid levels ~42 to 50 had fill values. i even dumped Virtual_potential_temperature hybrid level using the low level reader Grib2GetData it had all fill values.

this was for hybrid level 45

Grib2GetData C:\data\grib\ruc_sample.grib2 7851442 7851523

If you look at the java docs on the home page it has routines Grib2Dump, Grib2Indexer, ShowGrib, etc that lets one inspect low level values.

RObb...



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


===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================