A Python library to export xarray.DataArray as video files
Project description
mapflow transforms 3D xr.DataArray (time, y, x) into video files in one line of code.
Documentation
The full documentation is available at mapflow.readthedocs.io.
Installation
pip install mapflow
Or:
conda install -c conda-forge -y mapflow
Features
- 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.
Animate
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')
https://github.com/user-attachments/assets/3c84b380-62b2-4156-937f-5682a1c59457
Static plot
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))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mapflow-0.2.13.tar.gz
(4.9 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mapflow-0.2.13.tar.gz.
File metadata
- Download URL: mapflow-0.2.13.tar.gz
- Upload date:
- Size: 4.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ed93d81463a3bd94eb316f96721662c532d926e2499debc73319ebcc0ce650a
|
|
| MD5 |
b07709bc463551557b766eaa89485611
|
|
| BLAKE2b-256 |
61b27be6f14a799c4d6518ff572dedba95b9730e68a08b16bf4f5e811ced0c4d
|
File details
Details for the file mapflow-0.2.13-py3-none-any.whl.
File metadata
- Download URL: mapflow-0.2.13-py3-none-any.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a96bed4d83055c0f56f249af1f1dcefa9e25bb15785b939db5c8f22681552a
|
|
| MD5 |
391a6781e2287c7567a20c398f799698
|
|
| BLAKE2b-256 |
19f27f1eaaceb72b6ca6f4b48de6aa2bc3a6434b879cd02cb58d5bf1a02d5a38
|