Thursday, February 28, 2013

Library of plotting routines for Python and IDL

Last January I was walking around the place where the posters were being presented at the American Astronomical Society meeting in Long Beach. I stumbled upon a very interesting poster advertising the astroplotlib web page.

The purpose of this page, in the language of its curator, is that it is
[...] a multi-language astronomical library of plots. It is a collection of templates that are useful to create paper-quality figures. So far all codes are written in IDL, some in Python and very few in Mathematica. 

Most of the codes available there are written in IDL (ugh) but there are quite a few for Python. I hope the python codebase will grow in the future.

For instance, I have been using Bayesian modeling of data and I need to plot contours for the joint distribution of parameters as well as the separate posterior distribution histograms, all in the same plot. After a quick search in the website, I found the code I need to get started. 

If you have contributions (codes or suggestions), please contact the webmaster, Leonardo Ubeda.



Thursday, February 21, 2013

Example of how to do a great animation in Python

If you are interested in creating animation of simulation data in Python, perhaps this should give you some inspiration: Animating the Lorenz System in 3D.

The author solved the Lorenz system of equations and plotted the time evolution of the system in 3D. It illustrates how to make a great animation in a simple way.

You should also check out the Matplotlib Animation Tutorial written by the author, which provides the background on the Lorenz animation.

Great gallery of IPython notebooks

You know you can create IPython notebooks "a la Mathematica" and put them in your webpage, right? That's a great way of sharing a step-by-step analysis workflow with someone.

I stumbled upon a great collection of IPython notebooks that illustrate a vast range of capabilities: data analysis, statistics, interfacing with C/Fortran, plots, numpy tricks and a lot more!

You should check it out: A gallery of interesting IPython notebooks at github (via @profjsb).