• Stars
    star
    238
  • Rank 168,407 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple way of creating movies from xarray objects

xmovie

Build Status Documentation Status pre-commit.ci Status codecov % License: MIT DOI conda-forge package version conda-forge download count PyPI package version

A simple way of creating beautiful movies from xarray 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.

Xarray already provides a way to create quick and beautiful static images from your data using Matplotlib. Various packages 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 and Matplotlib.
  • Optionally, use Dask 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 https://xmovie.readthedocs.io.

Quickstart

High-quality movies and gifs can be created with only a few lines

import xarray as xr
from xmovie import Movie

ds = 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:

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)

More Repositories

1

xMIP

Analysis ready CMIP6 data in python the easy way with pangeo tools.
Jupyter Notebook
179
star
2

cookiecutter-science-project

Cookiecutter template for science analysis projects
Python
78
star
3

xarrayutils

Python
51
star
4

dynamic_chunks

Determine appropriate chunk sizes for a given xarray dataset based on target chunk size and 'chunk aspect ratio'
Python
11
star
5

xargofloat

Jupyter Notebook
10
star
6

easy_ipcc

We are trying to reproduce IPCC analysis plots from raw data in the cloud
Jupyter Notebook
9
star
7

presentation_ams_2023

Live demo showing how to reproduce an IPCC plot 100% in the cloud for AMS2023 Meeting
Jupyter Notebook
6
star
8

pangeo-forge-esgf

Using queries to the ESGF API to generate urls and keyword arguments for receipe generation in pangeo-forge
Python
5
star
9

presentation_2022_ams_cmip6_cloud

Jupyter Notebook
5
star
10

esgf-virtual-zarr-data-access

ESGF working group to enable data access via virtual zarrs.
Jupyter Notebook
5
star
11

guides

A collection of guides for princeton/gfdl specific setups.
4
star
12

busecke_abernathey_2019_sciadv

This repository contains the analysis code used in Busecke and Abernathey 2018, Science Advances
Jupyter Notebook
4
star
13

tutorial_osm22_cmip6

Tutorial Material for Ocean Science Meeting Innovative Session IN08A Open Ocean Science
Jupyter Notebook
4
star
14

aws_webinar

Short demo of CMIP6 analysis in the cloud for AWS webinar
Jupyter Notebook
3
star
15

mitgcm_surface_tracer

Python
3
star
16

teaching

Collection of instructions for data analysis
Jupyter Notebook
3
star
17

leap-pangeo-demos

Collection of demos for the LEAP-Pangeo platform
Jupyter Notebook
3
star
18

cmip6_regional_demo

A demo how to regrid coarse model data to e.g. states.
Jupyter Notebook
2
star
19

busecke_etal_2022_aguadv

Jupyter Notebook
2
star
20

NPJCLIMATSCI-00023R1_supplementary_figure1

Supplementary Material to reproduce Figure 1 from "Reflections on the CLIVAR Early Career Scientists Symposium 2016" in 'npj Climate and Atmospheric Science'
Jupyter Notebook
2
star
21

ocb_workshop_2021_cmip6_age

Jupyter Notebook
2
star
22

cmip6_preprocessing_tutorial

Jupyter Notebook
2
star
23

mom_xtools

Collection of xarray based analysis tools for MOM ocean model output
Python
2
star
24

presentation_scipy_2022_cmip

Jupyter Notebook
2
star
25

leap_pangeo_demo

Demos for the LEAP-Pangeo Platform
Jupyter Notebook
1
star
26

presentation_wcrp_open_science_conference

Jupyter Notebook
1
star
27

cmip6_omz

Jupyter Notebook
1
star
28

mom_tools

A collection of tools to work with GFDL MOM output
Jupyter Notebook
1
star
29

cmip-cloud-demos

Jupyter Notebook
1
star
30

cookiecutter-science-project_demo_repo

A demo of cookiecutter-science-project
Python
1
star
31

ocetrac_cmip6

Jupyter Notebook
1
star
32

pangeo_cloud_demo_princeton

Jupyter Notebook
1
star
33

test_leap_dataset

A prototype for a dataset repo for the LEAP Data Library
Jupyter Notebook
1
star
34

reporting_notebooks

Test repository to evaluate a reporting workflow with 'cleaned' notebooks
Jupyter Notebook
1
star
35

cmip6_pco2_testbed

Jupyter Notebook
1
star
36

busecke_etal_grl_2019_omz_euc

Jupyter Notebook
1
star
37

aviso_products

Python
1
star
38

CMIP6-feedstock-manual

Running Apache Beam based Pangeo-Forge Recipes to maintain the Pangeo CMIP6 Cloud Data
1
star
39

leap_education_docker_image

A docker image to enable custom environments needed for classes on the leap JupyterHub
1
star
40

cmip6_sst_trend_map

Create SST trend maps from CMIP6 output
Jupyter Notebook
1
star
41

3d_animations

A collection of all my work that involves 3D visualization
Jupyter Notebook
1
star