[AstroPy] A question about contour maps

Miguel de Val-Borro miguel.deval at gmail.com
Mon Nov 7 10:31:02 EST 2011


Dear Jean-Baptiste,

If the data is in ASCII format you could use numpy.loadtxt to load the
data into numpy arrays and use directly the matplotlib.pyplot.contourf
function to make a contour plot.  The first example in this cookbook
shows how to make a contour plot from irregularly spaced data using the
scipy.interpolate.griddata function for interpolation onto a uniform
grid:
http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data

Regards,
Miguel

On Mon, Nov 07, 2011 at 03:58:47PM +0100, Jean-Baptiste Marquette wrote:
> Dear AstroPy people,
> 
> I have an ASCII table with RA/DEC coordinates and the values of a given parameter at those positions. I would like to plot a contour map of this parameter on an image with RA/DEC coordinates. I was able create a blank image using pyfits. I guess I could use the APLpy FITSFigure.show_contour method if my data were organized as a FITS file.
> How to export from ASCII to FITS?
> 
> Thanks for your help,
> Jean-Baptiste Marquette
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy



More information about the AstroPy mailing list