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

cdscan failing on missing value #2162

Closed
pochedls opened this issue Mar 23, 2017 · 1 comment
Closed

cdscan failing on missing value #2162

pochedls opened this issue Mar 23, 2017 · 1 comment

Comments

@pochedls
Copy link

Running on crunchy (there is only one file in this directory):
cd /p/user_pub/work/pochedley1/cmip5/piControl/hfss/
cdscan -x test.xml *.nc

I get this error:
Finding common directory ... Common directory: Scanning files ... hfss_Amon_MRI-CGCM3_piControl_r1i1p1_185101-235012.nc Setting reference time units to days since 1851-01-01 Traceback (most recent call last): File "/export_backup2/pochedley1/bin/anaconda2/envs/uvcdate/bin/cdscan", line 1684, in <module> main(sys.argv) File "/export_backup2/pochedley1/bin/anaconda2/envs/uvcdate/bin/cdscan", line 1638, in main cleanupAttrs(attrs) File "/export_backup2/pochedley1/bin/anaconda2/envs/uvcdate/bin/cdscan", line 467, in cleanupAttrs if len(numpy.array(attval))==1: TypeError: len() of unsized object

I printed out the attribute / type / value:
...
_FillValue <type 'numpy.ndarray'> [ 1.00000002e+20]
missing_value <type 'numpy.ndarray'> [ 1.00000002e+20]
missing_value <type 'numpy.ndarray'> 1e+20

Note that the last missing value prints differently than the prior two attributes (it looks like it isn't an array). This seems to be failing despite the logic added by @painter1 in #2145. Any insight on what is going on would be appreciated! I get this error with v2.8 or a nightly build from last week.

@pochedls
Copy link
Author

For some reason, I thought issue #2145 was closed. If I modify my cdscan function following @painter1's suggested update to cleanupAttrs(), cdscan appears to work.

I'll leave this updated function in place and this ticket can be closed as a duplicated.

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