-
Notifications
You must be signed in to change notification settings - Fork 10
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
Setting a vertical coordinate reference system #2
Comments
Hi Martin, I'm afraid that I can't replicate this, either at v1.7.1, or the latest version. That said, the line of code that you are causing problems was incorrect, and I have hopefully fixed it in the master branch. I am not sure how you came to be running it with this example test_write.txt - could you try this? Thanks, |
Hello David, I get the same problem: it runs OK as it is, but if I comment out the Do I need to do something else to get a file which only has a vertical CRS? regards, |
Thanks for the extra info. You should indeed be able to do what you want to. The vertical CRS has a datum, which is fine, which needs to be written as a grid mapping netCDF variable - and that bit code appears faulty. I'll investigate ... |
Thanks. I wasn't expecting a grid mapping variable for the vertical coordinates ... because CMOR doesn't generate one for this type of coordinate (just |
The latest code (v1.7.4 https://pypi.org/project/cfdm/) all seems to work fine for me - could you upgrade and give it a go? The "new" grid mapping appears bcause the vertical CRS has a datum, but there is no appropriate horizontal CRS in which to store it. If we don't set a datum on the vertical CRS , by removing in our test file the
then you do not get the extra grid mapping variable.The connection of vertical CRSs to datums was, of course, new in CF-1.7 Thanks, |
Thanks, that works now. I see what you mean with the datum ... but there appears to be some ambiguity about whether it is really needed. The CF convention says "A grid mapping variable if, in addition, it is desired to .....". At the moment, my impression is that the CMIP community are not possessed by such a desire ... though I would agree that it would be a good thing -- perhaps in CMIP7. I'm aiming to use PS: there is still an issue (unrelated) with the cf-checker crashing when it finds a scalar coordinate used as an NetCDF4 dimension. This may not be your problem ... but your examples would be easier to work with if you avoided scalar coordinates used as dimensions. |
I've just started using cfdm ... still finding my way around the many classes. I'm trying to implement a vertical coordinate reference system for an atmosphere_hybrid_height_coordinate .. using the "more complete" example in the tutorial (https://ncas-cms.github.io/cfdm/1.7.1/tutorial.html ) .. which shows all the structures I need. In my code I get an error message (copied below) about an unexpected argument. I can reproduce the error if I take your script from the tutorial (which works as it is) and comment out the line "tas.set_construct(horizontal_crs)". Then, as in the script I want to create, you only have a vertical coordinate reference. The script still executes fine.
tas.dump()
also works as expected, butcfdm.write( "tas.nc", tas )
produces the following:The text was updated successfully, but these errors were encountered: