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.

Problems opening NetCDF file

Hi

I'm a first time user of VisAD, evaluating its potential for
a meteorological application.  I'm having some degree of
difficulty getting started reading from a large NetCDF file.
Basically, I have this bit of code:

>     public static void main(String[] args) throws Exception
>     {
>       // create a data reference for the image
> System.err.println("creating a data reference");
>       final DataReference data_ref = new DataReferenceImpl("data");
> 
>       // open a NetCDF file with the time sequences
> System.err.println("opening the data sequence "+args[0]);
>       Plain plain = new Plain();
>       FlatField data_sequence = (FlatField) plain.open(args[0]);
>     }

And I get this result:

> sun4:darren@krypton:bom-data> java ReadGrid a19970701.nc
> creating a data reference
> opening the data sequence a19970701.nc
> Exception in thread "main" visad.SetException: Gridded2DSet: samples do not 
> form a valid grid (0,0)
>         at visad.GriddedSet.create(Compiled Code)
>         at visad.GriddedSet.create(Compiled Code)
>         at visad.GriddedSet.create(Compiled Code)
>         at visad.data.netcdf.in.NcFunction.getGriddedSet(Compiled Code)
>         at visad.data.netcdf.in.NcFunction.getDomainSet(Compiled Code)
>         at visad.data.netcdf.in.NcNestedFunction.<init>(Compiled Code)
>         at visad.data.netcdf.in.NcFunction.newNcFunction(Compiled Code)
>         at visad.data.netcdf.in.NcData.newNcData(Compiled Code)
>         at visad.data.netcdf.in.NetcdfAdapter.getDataSet(Compiled Code)
>         at visad.data.netcdf.in.NetcdfAdapter.<init>(Compiled Code)
>         at visad.data.netcdf.Plain.open(Compiled Code)
>         at ReadGrid.main(Compiled Code)

The header of the NetCDF file I'm trying to read looks like:

> netcdf a19970701 {
> dimensions:
>         lon = 360 ;
>         lat = 181 ;
>         lvl = 19 ;
>         time = UNLIMITED ; // (4 currently)
>         char_size = 4 ;
> variables:
>         float lon(lon) ;
>                 lon:long_name = "longitudes" ;
>                 lon:type = "ll      " ;
>                 lon:units = "degrees_E" ;
>         float lat(lat) ;
>                 lat:long_name = "latitudes" ;
>                 lat:type = "ll      " ;
>                 lat:units = "degrees_N" ;
>         float lvl(lvl) ;
>                 lvl:long_name = "vertical levels" ;
>                 lvl:type = "pressure" ;
>                 lvl:units = "hPa" ;
>                 lvl:positive = "down" ;
>         float time(time) ;
>                 time:units = "days since 1997-06-30 23:00:00" ;
>         char seg_type(time, char_size) ;
>                 seg_type:long_name = "segment of bmrc header type" ;
>         int tm_step_size ;
>                 tm_step_size:long_name = "time step size" ;
>                 tm_step_size:units = "seconds" ;
>         int base_date(time) ;
>                 base_date:long_name = "base date (YYYYMMDD) of this segment" ;
>         int base_time(time) ;
>                 base_time:long_name = "base time (HHMM) of this segment" ;
>         int valid_date(time) ;
>                 valid_date:long_name = "valid date (YYYYMMDD) of this 
> segment" ;
>         int valid_time(time) ;
>                 valid_time:long_name = "valid time (HHMM) of this segment" ;
>         float sfc_geop(time, lat, lon) ;
>                 sfc_geop:grid_type = "spatial" ;
>                 sfc_geop:level_type = "single" ;
>         float air_temp(time, lvl, lat, lon) ;
>                 air_temp:grid_type = "spatial" ;
>                 air_temp:level_type = "multi " ;
>         float mix_rto(time, lvl, lat, lon) ;
>                 mix_rto:grid_type = "spatial" ;
>                 mix_rto:level_type = "multi " ;
>         float zonal_wnd(time, lvl, lat, lon) ;
>                 zonal_wnd:grid_type = "spatial" ;
>                 zonal_wnd:level_type = "multi " ;
>         float merid_wnd(time, lvl, lat, lon) ;
>                 merid_wnd:grid_type = "spatial" ;
>                 merid_wnd:level_type = "multi " ;
>         float geop_ht(time, lvl, lat, lon) ;
>                 geop_ht:grid_type = "spatial" ;
>                 geop_ht:level_type = "multi " ;
>         float mslp(time, lat, lon) ;
>                 mslp:grid_type = "spatial" ;
>                 mslp:level_type = "single" ;
> 
> // global attributes:
>                 :history = "Produced by BMRC DP V15 19970711 15:48" ;
>                 :conventions = "COARDS" ;
>                 :modl_vrsn = "gam04e  " ;
>                 :arch_vrsn = "g2.0    " ;
>                 :expt_id = "T79     " ;
> }

This file can be read with NetCDF 3.4.  Don't ask me anything about the
data,
it's not mine!  It is in excess of 100Mb, and I have tried difference VM
stack sizes.
Any suggestions would be appreciated.

Thanks
Darren
-- 

Darren Webb, B.Sc(Ma. & Comp. Sci.) Hons.
Distributed High Performance Computing Group
Department of Computer Science
University of Adelaide
South Australia 5005
AUSTRALIA
Phone: +61 0412 534 842
Email: darren@xxxxxxxxxxxxxxxxxx
WWW: http://www.cs.adelaide.edu.au/~darren

  dopelar effect (n.)
  the tendency of stupid ideas to seem smarter when they
  come to you in rapid succession.

  • 1998 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: