-
Notifications
You must be signed in to change notification settings - Fork 215
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
geographic_crs_name
missing from the CF version of a CRS
#585
Comments
The code is here: Lines 583 to 653 in 57eeaf5
It would be a simple fix to remove the check for a name being in Lines 728 to 731 in 57eeaf5
Anyway, suggestions & thoughts are definitely welcome 👍 Also, as far as not being CF compliant, also see #401 |
Hmmm, what about if it isn't projected and you have the |
Re-read it, looks like |
Ok, so how about: # handle geographic CRS
if self.geodetic_crs:
cf_dict["geographic_crs_name"] = self.geodetic_crs.name and elif geographic_crs_name and geographic_crs_name not in unknown_names:
geographic_crs = CRS(geographic_crs_name)
else:
geographic_crs = GeographicCRS() ? |
That sounds like a good plan to me. |
I'll bake a small PR soon then, thanks ! |
Code Sample, a copy-pastable example if possible
Problem description
When using the latest cfchecker (4.0.0) on a netcdf file containing the output of
crs.to_cf
, we get an error:Indeed, the output from
to_cf
in this case is:As you can see,
geographic_crs_name
is missing. As the CF document says:and I don't see one in the wkt attached.
So in conclusion, with this projection definition, it looks like to me that the
to_cf
method isn't generating a CF compliant grid mapping.Expected Output
I would expect
geographic_crs_name
to be present in the keys of the returned dict.Environment Information
pyproj info:
pyproj: 2.6.0
PROJ: 6.3.1
data dir: /home/a001673/miniconda3/envs/py3/lib/python3.8/site-packages/pyproj/proj_dir/share/proj
System:
python: 3.8.2 | packaged by conda-forge | (default, Mar 23 2020, 18:16:37) [GCC 7.3.0]
executable: /home/a001673/miniconda3/envs/py3/bin/python
machine: Linux-4.18.0-147.5.1.el8_1.x86_64-x86_64-with-glibc2.10
Python deps:
pip: 20.0.2
setuptools: 46.1.3.post20200325
Cython: 0.29.14
Installation method
Conda environment information (if you installed with conda):
Environment (
conda list
):Details about
conda
and system (conda info
):The text was updated successfully, but these errors were encountered: