pySTEPS / pysteps

Python framework for short-term ensemble prediction systems.

Home Page:https://pysteps.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for reprojection and up/downscaling of DataArrays

RubenImhoff opened this issue · comments

With our move to pysteps v2 and our plan to implement blending with NWP, we will run into problems with different grids and spatial projections of the models. An example of this is the KNMI NWP model data, which have a lat-lon grid and a coarser resolution than the radar data. Hence, this asks for a reprojection and downscaling of the NWP rainfall fields.

Does anyone know about good Python-tools for reprojection and down/upscaling? I'd be happy to try to implement this next week or so.

Hi @RubenImhoff, I used in the past rasterio to do that. It is very fast.
https://rasterio.readthedocs.io/en/latest/topics/reproject.html

Thanks @aperezhortal! Rasterio is indeed a nice package to work with, good option.

rasterio is very nice library, but to avoid an additional dependency, it should also be possible to relatively easily obtain what you need with a combination of pyproj and xarray's resampling method.

[Edited]
Actually, it seems that xarray has a reprojection functionality: https://corteva.github.io/rioxarray/stable/examples/reproject.html
But it seems that uses rasterio under the hood.

A colleague recommended pyresample https://pyresample.readthedocs.io/en/latest/index.html

Pyresample only has numpy, scipy and xarray as more or less hard dependencies. I did not explore it in depth since wradlib uses gdal for reprojection/resampling under the hood.

Thanks for your suggestions so far, this can give a good start!

Hi all ... I personally use XESMF https://pangeo-xesmf.readthedocs.io/en/latest/.
XESMF integrates very well with xarray and dask but I agree that we should try to keep pySTEPS dependencies limited.