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
0
votes
1 answer

AttributeError: 'FITSFigure' object has no attribute 'set_tick_labels_font'

I am a beginner in programming. I am trying to produce two plots using APLpy and subplot and simple code. The code is as following: import matplotlib matplotlib.use('Agg') import aplpy import matplotlib.pyplot as mpl fig = mpl.figure(figsize=(15,…
0
votes
0 answers

The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() in aplpy

I'm having problems with a dictionary in python. My code is import aplpy import numpy as np from astropy.io import fits from astropy.coordinates import Angle from astropy import units as u import pandas as pd ##### Star parameters defined by user …
0
votes
1 answer

How to embed a zoomed portion of a FITS image in the same plot with APLpy

I want to embed a zoomed portion of a FITS image in the same plot with APLpy. But when loading a FITS file with APLpy, there is only a 'FITSFigure' object returned. fig = aplpy.FITSFigure('tmp.fits', slices=[0,0]) Is it possible to make it work…
gerry
  • 1,539
  • 1
  • 12
  • 22
0
votes
1 answer

aplpy show_polygons() with colorised faces

I've got some polygons I'd like to plot in Right Ascension/Declination space with APLpy, with the polygons colored by another 1D list, but I can't get show_polygons() to work. I tried to adapt the answer from APLpy show markers normalized by a…
n k
  • 25
  • 5
0
votes
1 answer

APLpy/matplotlib: Coordinate grid alpha levels for EPS quality figure

In the normal matplotlib axes class, it is possible to set gridlines to have a certain transparency (alpha level). I'm attempting to utilise this with the APLpy package using the following: fig = pyplot.figure(figsize=(18,8)) gridspec_layout =…
user3125347
0
votes
1 answer

Using a for loop to make multiple Python APLpy subplots

I'm trying to create multiple subplots of fits images using APLpy, and I'd like to be able create these through a for loop to prevent me having to type out dozens of parameters multiple times for N plots. Using an inelegant brute-force method, for…
astro_andy
  • 37
  • 10
0
votes
1 answer

make subplots from an astronomical fits image

I have a set of RGB Images and I made a RGB fits image with aplpy and I also overlaid some contours on the image but I would like to cut the image and make small fits images where I would see the peaks of contour. import aplpy import atpy from pyavm…
Dalek
  • 4,168
  • 11
  • 48
  • 100
0
votes
3 answers

How to draw line segment on FITS figure using APLpy or python 2.7?

I want to draw a line segment joining two points on a FITS figure. (x,y) co-ordinates of these points are (200,250) & (300,400). I am using APLpy for this. My code is: import matplotlib.pyplot as plt import aplpy import numpy as np fig =…
atom
  • 153
  • 1
  • 9
0
votes
1 answer

APLpy attribute error : 'module' object has no attribute 'FITSfigure'

I have installed APLpy (version 0.9.12) & I have python 2.7. I have a FITS image called "test.fits". I gave following commands: import aplpy fig = aplpy.FITSfigure("test.fits") Then I got this message: AttributeError: 'module' object has no…
atom
  • 153
  • 1
  • 9
0
votes
1 answer

APLpy show markers normalized by a colormap

I am using APLpy to plot a fits file and want to overplot markers on that fits file at certain ra,dec values. I want the colours of the markers to be coded with another parameter, lets say a magnitude. So what I do is I read the marker coordinates…
Paul Eigenthaler
  • 165
  • 1
  • 2
  • 10
-1
votes
1 answer

Problems with gridspec plotting with APLpy

So I'm attempting to plot to fits images (identical fits images) with some annotations provided by a DS9 region file using APLpy: My script is as follows: import aplpy import matplotlib import matplotlib.pyplot as pyplot import matplotlib.gridspec…
user3125347
1
2