Closed aaschwanden closed 4 years ago
I don't think you are missing anything. This definitely looks like a bug. I'm not sure what would have changed to affect this. I'll get back to you!
I understand what's going on. "CF" coordinate systems need to be created using CF parameters. In this case, it would look like (with the 999s replaced with correct parameters):
crs = ocgis.variable.crs.CFPolarStereographic(
standard_parallel=999,
latitude_of_projection_origin=999,
straight_vertical_longitude_from_pole=999,
false_easting=999,
false_northing=999
)
To create a coordinate system from just an EPSG code use:
crs = ocgis.variable.crs.CoordinateReferenceSystem(epsg=3413)
I pushed a change that will raise an error when an EPSG code is used to create a CF coordinate system.
There may be other issues that occur when trying to do what you're aiming for, so let me know how it goes. I'm wondering if you want to create a CF-compatible coordinate system by translating from EPSG code / PROJ params.
Thanks for the clarification and the warning.
This works for me.
in the master branch,
crs = ocgis.variable.crs.CFPolarStereographic(epsg=3413)
results in
`--------------------------------------------------------------------------- KeyError Traceback (most recent call last) ~/Library/Python/3.8/lib/python/site-packages/ocgis-2.1.1-py3.8.egg/ocgis/variable/crs.py in init(self, **kwds) 917 try: --> 918 crs.update({self.map_parameters[k]: kwds[k]}) 919 except KeyError:
KeyError: 'standard_parallel'
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)