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

metpy/plots/mapping.py >> Unhandled projection: rotated_latitude_longitude #3099

Closed
blaylockbk opened this issue Jul 1, 2023 · 3 comments · Fixed by #3123
Closed

metpy/plots/mapping.py >> Unhandled projection: rotated_latitude_longitude #3099

blaylockbk opened this issue Jul 1, 2023 · 3 comments · Fixed by #3123
Labels
Area: Projections Pertains to projecting coordinates between coordinate systems Type: Feature New functionality
Milestone

Comments

@blaylockbk
Copy link
Contributor

What should we add?

Canada's HRDPS model is on a rotated latitude longitude grid. The following returns an error:

ds = # load grib file with xarray/cfgrib
ds = ds.metpy.parse_cf()
ds.metpy_crs.item().to_cartopy()

# OUT
# ValueError: Unhandled projection: rotated_latitude_longitude

Is the solution to this simply adding the ccrs.RotatedPole projection in metpy/plots/mapping.py?

raise ValueError(f'Unhandled projection: {self.name}') from None

HRDPS GRIB2 Data:
https://dd.weather.gc.ca/model_hrdps/continental/2.5km/00/000/

Reference

https://eccc-msc.github.io/open-data/msc-data/nwp_hrdps/readme_hrdps-datamart_en/#technical-grids-specification

@dopplershift
Copy link
Member

Yes, it's a matter of:

  1. Add a new function in mapping.py to turn CF metadata into a Cartopy projection. There a lot's of examples to borrow from there
  2. Handle mapping the CF metadata attributes to appropriate Cartopy kwargs
  3. Register it using the decorator: @CFProjection.register('rotated_latitude_longitude')

@dopplershift dopplershift added the Area: Projections Pertains to projecting coordinates between coordinate systems label Jul 6, 2023
@erin6541
Copy link

I'm going to try to work on this through a PR over the next couple weeks!

@blaylockbk
Copy link
Contributor Author

blaylockbk commented Jul 18, 2023

Thanks @erin6541. I started looking into this in my MetPy fork but didn't get around to testing it.

dopplershift pushed a commit that referenced this issue Jul 24, 2023
* initial attempt to add rotated_latitude_longitude

#3099

* added test for rotated lat/lon mapping

* changed to single quotes because of flake

* fixed rotated latlon test assertion
@dopplershift dopplershift added this to the September 2023 milestone Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Projections Pertains to projecting coordinates between coordinate systems Type: Feature New functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants