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

cf.Field.collapse should delete a vertical CRS that spans a collapse axis #599

Closed
davidhassell opened this issue Feb 23, 2023 · 0 comments · Fixed by #600
Closed

cf.Field.collapse should delete a vertical CRS that spans a collapse axis #599

davidhassell opened this issue Feb 23, 2023 · 0 comments · Fixed by #600
Labels
bug Something isn't working
Milestone

Comments

@davidhassell
Copy link
Collaborator

When cf.Field.collapse operates along one or more axes spanned by a vertical coordinate reference system (such as standard_name:atmosphere_hybrid_height_coordinate), the code currently deletes any domain ancillaries that span the any of the collapse axes, but leaves other domain ancillaries behind, as well as the vertical coordinate reference system.

However, the CF conventions say that missing terms should be assumed to be zero, and so if the non-parametric vertical coordinates are computed they will likely give inappropriate, but possibly plausible, results - the worst kind of error!

So, removing the CRS and its contained constructs is certainly the safe thing to do by default, but you might want to keep it, perhaps to reinstate a new correct domain ancillary. Therefore, it should be possible to override the removal of the vertical CRS with a keyword parameter to cf.Field.collapse.

PR to follow.

>>> import cf
>>> cf.environment(paths=False)
Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.35
HDF5 library: 1.12.1
netcdf library: 4.8.1
udunits2 library: /home/david/miniconda3/lib/libudunits2.so.0
ESMF: 8.2.0
Python: 3.10.8
dask: 2022.12.1
netCDF4: 1.6.0
psutil: 5.9.0
packaging: 22.0
numpy: 1.23.5
scipy: 1.9.3
matplotlib: 3.6.2
cftime: 1.6.2
cfunits: 3.3.5
cfplot: 3.1.31
cfdm: 1.10.0.2
cf: 3.14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant