netCDF file w/3D variables only shows 2D in Field Selector.

How do I...?
Post Reply
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

netCDF file w/3D variables only shows 2D in Field Selector.

Post by barryr »

This question was recently received by the McIDAS Help Desk:
I am trying to load some of the 3D variables contained within the following:
ncsa_katrina_1500m_0828_2005.2100utc.nc.gz

I choose the Grid files (netCDF/GRIB/OPeNDAP/GEMPAK) data type and all that
shows up are the 2D variables. I am able to plot them and they look ok.

Am I doing something wrong?

(The file is *not* attached because it's over 900MB in size.)
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: netCDF file w/3D variables only shows 2D in Field Selector.

Post by barryr »

Help Desk replied:
We grabbed the file (~1GB uncompressed) and saw the same results of having only "2D grid" variables show up in the Field Selector. We also tried loading it in IDV and got the same results.

So you're not doing anything wrong in McV; it looks like it's something in the netCDF file structure/definition that limits McV and IDV to 2D variables. I'll check with a couple programmers who know netCDF file structure and requirements better and let you know if they have any ideas/tips/suggestions. There are also some resources with information about creating netCDF files at http://www.unidata.ucar.edu/software/netcdf/.
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: netCDF file w/3D variables only shows 2D in Field Selector.

Post by barryr »

Then the user replied:
I found an old profile that you made for the CONUS case that does plot in 3D. It looks something like this. Things are different, but I can't really say if this is the reason.


CONUS Case
dimensions:
time = UNLIMITED ; // (1 currently)
west_east = 3459 ;
south_north = 2049 ;
bottom_top = 29 ;

float U(time, bottom_top, south_north, west_east) ;
U:description = "x-wind component" ;
U:units = "m s-1" ;
U:coordinates = "P lon lat" ;
U:_FillValue = -999.f ;

-------------------------------------------------------------------------

Katrina Case
dimensions:
time = UNLIMITED ; // (1 currently)
top_bot = 64 ;
south_north = 1096 ;
west_east = 948 ;
number_land_categories = 24 ;
string_length = 50 ;

float U(time, south_north, west_east, top_bot) ;
U:long_name = "U-Wind Component" ;
U:units = "m/s" ;
U:coordinates = "P lon lat" ;
U:_FillValue = 9999.f ;
U:standard_name = "eastward_wind" ;
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: netCDF file w/3D variables only shows 2D in Field Selector.

Post by barryr »

And a programmer also replied:
Pressure is a data variable, not a vertical coordinate; the vertical coordinate is "top_bot", although it is not defined as a "coordinate variable" and has no units.

Also, the file variables are dimensioned (time, south_north, west_east, top_bot)....usually they are ordered (time, top_bot, south_north, west_east). Not sure if that matters.

Unidata wrote: "At one point, there was a discussion of using an existing 3D field to specify the vertical domain. But, I don't see it in the CF docs. However, there appears to be code in the netCDF-Java which handles this....".
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: netCDF file w/3D variables only shows 2D in Field Selector.

Post by barryr »

More info from the programmer:
Not there yet....but getting closer, I believe....

By adding the xml below to an ncml file,I was able to get ToolsUI to identify Q,U and V as "grids". However, the IDV balks at trying to read the data. Unidata suggests that perhaps the problem is the ordering of the dimensions in these variables, since "normally" it is: z,y,x and not y,x,z.

<name deleted> -- if it would not be too difficult, can you create another example with this ordering?

Thanks.

Here's the XML:

<variable name="top_bot" shape="top_bot" type="int">
<attribute name="_CoordinateAxisType" value="Pressure" />
<values start="1" increment="1" />
</variable>
<variable name="VerticalTrans" type="char" >
<attribute name="transform_name" value="explicit_field" />
<attribute name="standard_name" value="explicit_field" />
<attribute name="existingDataField" value="P" />
<attribute name="_CoordinateTransformType" value="vertical" />
<attribute name="_CoordinateAxes" value="top_bot" />
</variable>

Then I also changed the "coordinates" attribute for Q,U,and V to read:

<attribute name="coordinates" value="top_bot lon lat" />
Post Reply