Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbusecke/xmovie
A simple way of creating movies from xarray objects
https://github.com/jbusecke/xmovie
creating-movies movie plot xarray
Last synced: about 18 hours ago
JSON representation
A simple way of creating movies from xarray objects
- Host: GitHub
- URL: https://github.com/jbusecke/xmovie
- Owner: jbusecke
- License: mit
- Created: 2018-03-13T00:24:05.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T19:53:12.000Z (16 days ago)
- Last Synced: 2025-02-12T05:19:51.626Z (8 days ago)
- Topics: creating-movies, movie, plot, xarray
- Language: Python
- Homepage: https://xmovie.readthedocs.io/
- Size: 27.2 MB
- Stars: 252
- Watchers: 5
- Forks: 38
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-meteo - xmovie
README
# xmovie
[](https://github.com/jbusecke/xmovie/actions)
[](https://xmovie.readthedocs.io/en/latest/)
[](https://results.pre-commit.ci/latest/github/jbusecke/xmovie/master)
[](https://codecov.io/gh/jbusecke/xmovie)
[](https://opensource.org/licenses/MIT)
[](https://zenodo.org/badge/latestdoi/124968397)
[](https://anaconda.org/conda-forge/xmovie)
[](https://anaconda.org/conda-forge/xmovie)
[](https://badge.fury.io/py/xmovie)*A simple way of creating beautiful movies from [xarray](https://xarray.pydata.org) objects.*
With ever-increasing detail, modern scientific observations and model results
lend themselves to visualization in the form of movies.Not only is a beautiful movie a fantastic way to wake up the crowd on a Friday
afternoon of a weeklong conference, but it can also speed up the discovery
process, since our eyes are amazing image processing devices.This module aims to facilitate movie rendering from data objects based on
[xarray objects](https://xarray.pydata.org/en/stable/user-guide/data-structures.html).Xarray already provides [a way](https://xarray.pydata.org/en/stable/user-guide/plotting.html)
to create quick and beautiful static images from your data using [Matplotlib](https://matplotlib.org/).
[Various packages](https://matplotlib.org/mpl-third-party/#animations)
provide facilities for animating Matplotlib figures.But it can become tedious to customize plots, particularly when map projections are used.
The main aims of this module are:
- Enable quick but high-quality movie frame creation from existing xarray
objects with preset plot functions -- create a movie with only 2 lines of code.
- Provide high quality, customizable presets to create stunning visualizations with minimal setup.
- Convert your static plot workflow to a movie with only a few lines of code,
while maintaining all the flexibility of [xarray](https://xarray.pydata.org)
and [Matplotlib](https://matplotlib.org).
- Optionally, use [Dask](https://dask.org) for parallelized frame rendering.## Installation
The easiest way to install `xmovie` is via `conda`:
```
conda install -c conda-forge xmovie
```You can also install via `pip`:
```
pip install xmovie
```## Documentation
Check out the examples and API documentation at .
## Quickstart
High-quality movies and gifs can be created with only a few lines
```python
import xarray as xr
from xmovie import Movieds = xr.tutorial.open_dataset('air_temperature').isel(time=slice(0,150))
mov = Movie(ds.air)
mov.save('movie.mp4')
```
Saving a `.gif` is as easy as changing the filename:
```python
mov.save('movie.gif')
```
That is it! Now pat yourself on the shoulder and enjoy your masterpiece.
> The GIF is created by first rendering a movie and then converting it to a GIF.
> If you want to keep both outputs you can simply do `mov.save('movie.gif', remove_movie=False)`