Questions tagged [aplpy]

APLpy (the Astronomical Plotting Library in Python) is a Python module aimed at producing publication-quality plots of astronomical imaging data in FITS format.

APLpy (the Astronomical Plotting Library in Python) is a Python module aimed at producing publication-quality plots of astronomical imaging data in FITS format. The module uses Matplotlib, a powerful and interactive plotting package. It is capable of creating output files in several graphical formats, including EPS, PDF, PS, PNG, and SVG.

Main features:

  • Make plots interactively or using scripts
  • Show grayscale, colorscale, and 3-color RGB images of FITS files
  • Generate co-aligned FITS cubes to make 3-color RGB images
  • Make plots from FITS files with arbitrary WCS (e.g. position-velocity)
  • Slice multi-dimensional FITS cubes
  • Overlay any number of contour sets
  • Overlay markers with fully customizable symbols
  • Plot customizable shapes like circles, ellipses, and rectangles
  • Overlay ds9 region files
  • Overlay coordinate grids
  • Show colorbars, scalebars, and beams
  • Customize the appearance of labels and ticks
  • Hide, show, and remove different contour and marker layers
  • Pan, zoom, and save any view as a full publication-quality plot
  • Save plots as EPS, PDF, PS, PNG, and SVG

Link: http://aplpy.github.io/

26 questions
6
votes
1 answer

Aplpy multiplot dynamic axis sharing

Is there any way to make multiplot aplpy plots dynamically share axes so that when one is moved or zoomed, it moves and zooms the others? I can achieve the affect using matplotlib pyplot's imshow and subplot routines, but using those limits some…
Alex Howard
  • 319
  • 3
  • 13
2
votes
0 answers

plot RA/Dec polygons with astropy wcs aplpy FITSFigure

I've got some polygons in RA/Dec spherical coordinates, and I'm trying to plot them with aplpy and an astropy world coordinate system (WCS) object, but my script crashes. I can reproduce the problem with this standalone script: #!/usr/bin/env…
n k
  • 25
  • 5
2
votes
2 answers

RGB image components misaligned

I am using aplypy to create an RGB image of the Eagle nebula from three FITS files, representing the red, green and blue components of the image. The FITS files are available here, 673nm being the red, 656nm the green and 502nm the blue. import…
christopherlovell
  • 3,800
  • 4
  • 19
  • 26
2
votes
1 answer

APLpy coordinate change to pixel values

Does anyone know how to change the coordinate values to the pixel values of a fits file image in APLpy?
Nat
  • 53
  • 7
2
votes
1 answer

APLpy error: 'Colorbar' object has no attribute 'set_axis_label_text'

I'm trying to write a title for a colour bar in APLpy but everytime I do I get the following error: AttributeError:'Colorbar' object has no attribute 'set_axis_label_text' The code I'm using is the following: import aplpy import matplotlib.pyplot…
Nat
  • 53
  • 7
1
vote
4 answers

ImportError while importing APLpy

I keep getting this import error whenever I try to import APLpy in iPython after astropy.io.fits. I've tried uninstalling and reinstalling all my Python packages and libraries. This error is causing kernel panic and I keep getting the login…
1
vote
0 answers

ValueError: When providing two arguments, the array must be of shape (N, 4)

I've been trying to use pv-extractor package to extract the velocity along a certain path. then convert the position in the pixel coordinate to world coordinate and frequency to velocity. here is the code I've written:…
Mit Ra
  • 11
  • 2
1
vote
2 answers

Change Scaling/Units of Colorbar in Matplotlib

I am plotting several FITS images along with a colorbar alongside them. I am mainly using Aplpy to plot the images, including the colorbar. As far as I understand, Aplpy does use/rely on matplotlib for its plotting mechanisms, so if there is a way…
1
vote
1 answer

How to view this .fits image without resizing and without modifying colors?

I am trying to open a full-color image from a '.fits' file. But, when comparing it to the corresponding '.gif' image, there appears to be an error regarding its color and size. How can I view the real-color image in its proper dimensions? As an…
user7345804
1
vote
0 answers

use aplpy figure in an AxesSubplot instance

I have defined a grid of figures in matplotlib using subplots as in this example: f, axarr = plt.subplots(2) axarr[0].plot(x, y) Is it possible to plot a figure generated by aplpy.FITSFigure in one of the axes instances returned by subplots?
gypaetus
  • 6,873
  • 3
  • 35
  • 45
1
vote
0 answers

Import error in ipython for AplPy

I am trying to start up AplPy on OSX by importing it on ipython. I installed AplPy using pip, and then in the terminal I entered: ipython --pylab import aplpy However I only get the following…
luen
  • 11
  • 2
1
vote
0 answers

Getting MemoryError for a numpy array

I am analyzing some fits images using Aplpy and the images are read into arrays but I get this error message: Update: fitsfile=rgb.fits aplpy.make_rgb_cube(['R.fits', 'V.fits', 'U.fits'],fitsfile) File…
Dalek
  • 4,168
  • 11
  • 48
  • 100
1
vote
3 answers

MontageError: Invalid table file

I'm using Python 2.7.3 on my Debian server. Here is the input code: import aplpy import pyfits from numpy import * import matplotlib as plt import montage as montage_wrapper import PIL r = pyfits.open('3c324IR.fits') b =…
bjd2385
  • 2,013
  • 4
  • 26
  • 47
1
vote
1 answer

Plotting a fits image with aplpy using the right wcs transformation

I want to plot a fits file with aplpy but I get the following error: INFO: The WCS transformation has more axes (3) than the image it is associated with (2) [astropy.wcs.wcs] ERROR: IndexError: list index out of range [aplpy.wcs_util] If I delete…
Paul Eigenthaler
  • 165
  • 1
  • 2
  • 10
1
vote
1 answer

How could I convert a contour plot (matplotlib) to FITS format with header?

I need to make a contour plot and overlie the contours on the image. I have used aplpy library to overlie the contours on an astronomical image. I have downloaded the 2MASS data in APlpy…
Dalek
  • 4,168
  • 11
  • 48
  • 100
1
2