Giter VIP home page Giter VIP logo

xmovie's Introduction

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)

xmovie's People

Contributors

jbusecke avatar dependabot[bot] avatar zmoon avatar pre-commit-ci[bot] avatar tomchor avatar richardscottoz avatar timothyas avatar

Stargazers

Igor Uchôa  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.