fmaussion / salem

Add geolocalised subsetting, masking, and plotting operations to xarray
http://salem.readthedocs.io
Other
186 stars 44 forks source link

add map_proj = 6 (Lat-lon) #221

Closed matthiasdemuzere closed 2 years ago

matthiasdemuzere commented 2 years ago

A small test file is available here: geo_em.d04_map_proj6.zip

import salem
ifile = "geo_em.d04_map_proj6.nc"
ds = salem.open_xr_dataset(ifile)
ds.salem.quick_map('LU_INDEX')
fmaussion commented 2 years ago

Thanks a lot! Sorry for the long wait.

Instead of pushing to your master branch I will continue on dev and get this into the main branch soon!

fmaussion commented 2 years ago

OK so after reading a bit I'm still unclear why anyone would use this projection for regional applications. As implemented now, this code is only working for

pole_lat = 90
pole_lon = 0

The WRF docs say:

The cylindrical equidistant projection is required for global ARW simulations, although in its rotated aspect (i.e., when pole_lat, pole_lon, and stand_lon are changed from their default values) it can also be well-suited for regional domains anywhere on the earth’s surface.

Anyways, I'll add a check on POLE values and error if anything else than the regular pole since I can't test it.

fmaussion commented 2 years ago

Would you mind sending me the other 3 parent domains as well?

fmaussion commented 2 years ago

(and, ideally, the WPS config files that were used to generate these domains)

matthiasdemuzere commented 2 years ago

geo_em.proj6_parents.zip

Unfortunately I do not have the WPS config files. I got these domains from a W2W user, for debugging purposes, and so I do not have any additional metadata or insights into the reasons this projection is used.

fmaussion commented 2 years ago

OK, new release on PyPi: https://pypi.org/project/salem/0.3.8/