Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The attributes' dictionary of a cdms2 variable has a spurious 'name' key #426

Open
jypeter opened this issue Nov 27, 2020 · 0 comments
Open

Comments

@jypeter
Copy link
Member

jypeter commented Nov 27, 2020

I have just noticed a strange 'name': 'variable_2' key in the attributes dic of a variable. I'm still using cdms2 from CDAT 8.0

The clt variable has no name attribute in the input file (when using ncdump -h clt.nc). And this attribute does not appear when using var.info(). See example below


>>> import cdat_info
>>> file_in=cdms2.open(cdat_info.get_sampledata_path()+"/clt.nc")
>>> file_in.id
'/home/share/unix_files/cdat/miniconda3/envs/cdatm_py3/share/cdat/sample_data/cl   t.nc'
>>> var_in = file_in('clt')

>>> var_in.attributes
{'name': 'variable_2', 'tileIndex': None, 'comments': 'YONU_AMIP1', 'long_name':    'Total cloudiness', 'units': '%', 'grid_name': 'YONU4X5', 'grid_type': 'gaussia   n', 'time_statistic': 'average'}

>>> var_in.info()
*** Description of Slab clt ***
id: clt
shape: (120, 46, 72)
filename:
missing_value: 1e+20
comments: YONU_AMIP1
grid_name: YONU4X5
grid_type: gaussian
time_statistic: average
long_name: Total cloudiness
units: %
tileIndex: None
Grid has Python id 0x2b9a4bcc2630.
Gridtype: generic
Grid shape: (46, 72)
Order: yx
** Dimension 1 **
   id: time
   Designated a time axis.
   units:  months since 1979-1-1 0
   Length: 120
   First:  0.0
   Last:   119.0
   Other axis attributes:
      axis: T
      calendar: gregorian
      realtopology: linear
   Python id:  0x2b9a4bcc2e48
** Dimension 2 **
   id: latitude
   Designated a latitude axis.
   units:  degrees_north
   Length: 46
   First:  -90.0
   Last:   90.0
   Other axis attributes:
      axis: Y
      long_name: Latitude
      realtopology: linear
   Python id:  0x2b9a4bcc24a8
** Dimension 3 **
   id: longitude
   Designated a longitude axis.
   units:  degrees_east
   Length: 72
   First:  -180.0
   Last:   175.0
   Other axis attributes:
      axis: X
      modulo: 360.0
      topology: circular
      long_name: Longitude
      realtopology: circular
   Python id:  0x2b9a4bcc29e8
*** End of description for clt ***
>>> cdat_info.Version
'8.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant