mapflow transforms 3D xr.DataArray (time, y, x) into video files in one line of code.
The full documentation is available at mapflow.readthedocs.io.
pip install mapflowOr:
conda install -c conda-forge -y mapflow- Automatic Coordinate Detection: Identifies x, y, and time coordinates in xarray DataArrays, with fallback options for manual input if needed.
- CRS Handling: Detects the Coordinate Reference System (CRS) of the data or accepts user-defined CRS when unavailable.
- Robust Colorbar: Generates a colorbar that handles outliers effectively while allowing customization.
- Built-in World Borders: Includes default world border data but supports user-provided GeoSeries or GeoDataFrames.
- Simplified Visualization: The
plot_dafunction provides a one-line alternative to cartopy for quick plotting.
import xarray as xr
from mapflow import animate
ds = xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib")
animate(da=ds['t2m'].isel(time=slice(120)), path='animation.mp4', video_width=1280, pad_inches=0.2)animation.mp4
import xarray as xr
from mapflow import plot_da
ds = xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib")
plot_da(da=ds['t2m'].isel(time=0))