-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support for CDL #5
Comments
Good idea, thanks. This will be ready in the next version, which should be ready in a few days. |
This would be a interesting feature. |
All ready in v1.7.8 (https://pypi.org/project/cfdm). See the documentation at https://ncas-cms.github.io/cfdm/function/cfdm.read.html Try it with test_file.zip $ unzip test_file.zip
Archive: test_file.zip
inflating: test_file.nc
$ ncdump test_file.nc > test_file.cdl
$ ncdump -h test_file.nc > test_file_h.cdl
$ ncdump -c test_file.nc > test_file_c.cdl In [10]: import cfdm
In [11]: f = cfdm.read('test_file.nc')[0]
In [12]: g = cfdm.read('test_file.cdl')[0]
In [13]: f.equals(g)
Out[13]: True
In [14]: cfdm.read('test_file_h.cdl')[0]
Out[14]: <Field: eastward_wind(atmosphere_hybrid_height_coordinate(1), grid_latitude(10), grid_longitude(9)) m s-1>
In [15]: cfdm.read('test_file_c.cdl')[0]
Out[15]: <Field: eastward_wind(atmosphere_hybrid_height_coordinate(1), grid_latitude(10), grid_longitude(9)) m s-1> |
I am aware that this doesn't work for Python 2. I will gladly fix this if anyone needs it ... |
Hi David, thanks for adding this, it will be very useful. Trying it out, I found that it fails when a file starts with a comment line ( Here is the file which triggers the error:
It works when the first line is deleted. |
Hi Martin, thanks for spotting this - I was only allowing files whose first line started |
It would be really useful to be able to read CDL files directly into cfdm, rather than having to first convert to binary netCDF files. Can this be added?
The text was updated successfully, but these errors were encountered: