Re: [netcdfgroup] attributes not showing up when reading openDAP datasets

  • To: Jeff Whitaker <jswhit@xxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] attributes not showing up when reading openDAP datasets
  • From: "Arthur M. Greene" <amg@xxxxxxxxxxxxxxxx>
  • Date: Thu, 10 Sep 2009 10:29:00 -0400
One addendum: This is (or should be) a password-protected server. I'm not sure how attempting to access it without a userid and password might modify what is returned, but I do have a password, and fetching the data using the appropriately modified url yields a time variable that does have _some_ defined attributes. There are no units or calendar, however, and other attributes could also be missing (like bounds). I see

In [22]: dir(timedata)
Out[22]: ['__class__', '__delattr__', '__delitem__', '__doc__', '__getattr__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__len__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '_assign_vlen', '_get', '_grpid', '_iscompound', '_isprimitive', '_isvlen', '_nunlimdim', '_put', '_varid', 'assignValue', 'chunking', 'dimensions', 'dtype', 'endian', 'filters', 'getValue', 'group', 'maskandscale', 'ncattrs', 'ndim', 'set_auto_maskandscale', 'shape', 'size']

In [25]: print timedata.shape
(1680,)
In [26]: print timedata.size
1680
In [29]: print timedata.ndim
1
In [30]: print timedata.dtype
float64

In any event, it seems that not all the attributes are being read. My system:

netCDF4-0.8.2.tar.gz
curl-7.19.6.tar.gz
netcdf-4.1-beta2.tar.gz
hdf5-1.8.3-snap2.tar.gz

all installed according to instructions here: http://netcdf4-python.googlecode.com/svn/trunk/docs/netCDF4-module.html

OS is RedHat Enterprise Linux 5.

One last detail: I can't access the data itself:

In [32]: tas = datobj.variables['tas']

In [33]: tas.shape
Out[33]: (1680, 90, 144)

In [34]: testdat = tas[0,:,:]
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)

/home/amg/work/nhmm/<ipython console> in <module>()

/home/amg/usr/local/cdat/trunk/lib/python2.5/site-packages/netCDF4.so in netCDF4.Variable.__getitem__ (netCDF4.c:14286)()

/home/amg/usr/local/cdat/trunk/lib/python2.5/site-packages/netCDF4.so in netCDF4.Variable._get (netCDF4.c:18945)()

RuntimeError: NetCDF: Variable has no data in DAP request

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

Thanks much for following up on this.

Best,

Arthur


Jeff Whitaker wrote:

Dennis:  If I open

http://esgcet.llnl.gov/dap/ipcc4/20c3m/gfdl_cm2_1/pcmdi.ipcc4.gfdl_cm2_1.20c3m.run1.atm.mo.xml

with netcdf-4.1-beta2, then get the time variable, it appears there are no attributes associated with it. Browsing the xml file

http://esgcet.llnl.gov/aggregates/ipcc4/20c3m/gfdl_cm2_1/pcmdi.ipcc4.gfdl_cm2_1.20c3m.run1.atm.mo.xml

it does appear these attributes are defined, but somehow the client is not getting them.

Is it a bug in the way there are serving the data, or a bug in the opendap client in netcdf-4.1?

-Jeff

--
*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*
Arthur M. Greene, Ph.D.
The International Research Institute for Climate and Society
The Earth Institute, Columbia University, Lamont Campus
Monell Building, 61 Route 9W, Palisades, NY  10964-8000 USA
Tel: 845-680-4436    | Fax: 845-680-4864
amg@xxxxxxxxxxxxxxxx | http://iri.columbia.edu
*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*
begin:vcard
fn:Arthur M. Greene
n:Greene;Arthur M.
email;internet:amg@xxxxxxxxxxxxxxxx
tel;work:845-680-4436
tel;fax:845-680-4865
x-mozilla-html:FALSE
version:2.1
end:vcard

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