xwrf icon indicating copy to clipboard operation
xwrf copied to clipboard

[FEATURE]: Implement map_proj==6

Open taoansf opened this issue 1 year ago • 2 comments

What is your issue?

Hello,

I'm trying to load wrf data using xarray open_mfdataset and xwrf.postprocess() However xwrf is return this error message

ds=xa.open_mfdataset(dados_wrf,concat_dim='Time',combine='nested').xwrf.postprocess()

File ~/miniconda3/envs/geo/lib/python3.12/site-packages/xwrf/accessors.py:147 in postprocess _ds = ds.pipe(include_projection_coordinates)

File ~/miniconda3/envs/geo/lib/python3.12/site-packages/xarray/core/common.py:775 in pipe return func(self, *args, **kwargs)

_File ~/miniconda3/envs/geo/lib/python3.12/site-packages/xwrf/postprocess.py:105 in include_projection_coordinates _grid_components = wrf_grid_from_dataset(ds)

_File ~/miniconda3/envs/geo/lib/python3.12/site-packages/xwrf/grid.py:61 in wrf_grid_from_dataset raise NotImplementedError(f'WRF proj not implemented yet: {proj_id}')

NotImplementedError: WRF proj not implemented yet: 6

Could help me with this problem? Is there some argument that I'm missing in my code?

Thank you for any help

With best regards,

Taoan

taoansf avatar May 14 '24 13:05 taoansf

Hi, thanks for making an issue. This means that the cylindrical equidistant projection is not yet implemented in xwrf. As you can see here, for now we only support the map projections 0-3.

https://github.com/xarray-contrib/xwrf/blob/37dad39bee2817498b309c3804c19f613f01768a/xwrf/grid.py#L41-L61

However, a quick google search reveals that salem already implemented map_proj 6, so it should be easy to do on our end. We will require tests before merging this into main but you're welcome to start a pull request and we'll guide you along.

lpilz avatar May 14 '24 14:05 lpilz

Hi, thank you for the clarification. I don't have experience with this type of implementation, but I'll study it to try to make some contribution.

taoansf avatar May 15 '24 12:05 taoansf