Skip to main content

A Python library to export xarray.DataArray as video files

Project description

mapflow logo

mapflow

PyPI version Conda version CI Documentation Status

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_da function 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', video_width=1280, pad_inches=0.2)

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))
plot_da

Project details


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.14.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mapflow-0.2.14-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file mapflow-0.2.14.tar.gz.

File metadata

  • Download URL: mapflow-0.2.14.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

Hashes for mapflow-0.2.14.tar.gz
Algorithm Hash digest
SHA256 446eece007f6479392ec67278a8b6e2456fa3b68bf2be9252ecd14ba50a24d42
MD5 597525c3340b1a460935f2700d9ea9a5
BLAKE2b-256 1f58a0cf29ff1c1402072b502c7bc6737be6e16304794971626e7c34288b08ac

See more details on using hashes here.

File details

Details for the file mapflow-0.2.14-py3-none-any.whl.

File metadata

  • Download URL: mapflow-0.2.14-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

Hashes for mapflow-0.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 b24c4bad985b4774b9d8b2dbdceb3d22d379ffa2ff0fe50f9b4009785a218bbd
MD5 611d46eb03101c8644a966a20310acdb
BLAKE2b-256 95ee263bfaec6d679c036c6c30086c3730633196cf787c133085ed35e6775de0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page