Questions tagged [astropy]

Questions related to Astropy, a community Python package for Astronomy

The Astropy Project is a community effort to develop a common core package for Astronomy in Python and foster interoperability between Python astronomy packages.

This package provides core data structure and transformations adapted to astronomy, files and I/O tools, as well as computation utilities.

For more information, refer to the Astropy documentation.

When you are posting questions about astropy, it is helpful to include the sample data file(s). Since FITS files are large, linking to publicly available MAST data, or a GitHub repo, are the best options.

730 questions
0
votes
1 answer

Splicing image array (FITS file) using coordinates from header

I am trying to splice a fits array based on the latitudes provided from the Header. However, I cannot seem to do so with my knowledge of Python and the documentation of astropy. The code I have is something like this: from astropy.io import…
Wolfgang
  • 329
  • 3
  • 13
0
votes
1 answer

Imshow doesn't display image when used with astropy

I am running into a problem viewing images with astropy. Here is my code: from astropy.io import fits import matplotlib.pyplot as…
BlackyTheCat
  • 343
  • 1
  • 2
  • 9
0
votes
0 answers

Creating WCS For A FITS IMAGE

UPDATE(03/10/2016): Thought I would put this here for anybody in the future to see. I have essentially put this problem to rest. I was essentially trying to "make" a world coordinate system after the image was taken. My thought was, if I could…
Tristan
  • 127
  • 2
  • 11
0
votes
1 answer

Python - Can't Import ParametricModel from astropy.modeling

I am trying to import ParametricModel as follows: from astropy.modeling import ParametricModel But it shows following error: Traceback (most recent call last): File "", line 1, in ImportError: cannot import name ParametricModel Why can't I…
user1682623
  • 11
  • 1
  • 2
0
votes
0 answers

To find the pixel coordinates for a given ra-dec

I'm fairly new to python, and presently working on labeling some galaxy images. I have a set of 512x512 pix^2 images scaled to 0.2 arcsec/pix. Each one of the images have two objects to be labeled - one at the centre (256pix,256pix) at the other is…
Stp30
  • 125
  • 1
  • 8
0
votes
1 answer

FITS Image Array Pixel out of bounds

I am attempting to set a threshold for pixels in a FITS file using the code below. However, I get an error that says that: IndexError: Index 2620 is out of bounds for axis 0 with size 2620 Any ideas on how to fix this? This is the code: from…
Wolfgang
  • 329
  • 3
  • 13
0
votes
1 answer

Spectal plotting within Python?

Is there a way to plot spectra in python such that it has square levels (histogram 'like'; therefore the spectral resolution is taken into account), rather than a continuous line which simply connects the points?
astro_ash
  • 145
  • 1
  • 1
  • 7
0
votes
1 answer

Cannot read a large FITS file using Astropy.io.fits

I am currently attempting to read data from a large data FITS format data file using astropy.io.fits for Python 3.4. While I can successfully open the file using the memmapper mode, I cannot access the data within the file. Here is my code from…
Snyder005
  • 224
  • 2
  • 8
0
votes
1 answer

Table join operation with FITS files in Astropy

This one is specifically for the astropy community. I have two tables in .fit format, where both tables may contain a common coloumn/header (i.e., "SDSS identifier"). Now, I wanted to join the tables such that it produces a new table that contains…
GCien
  • 2,221
  • 6
  • 30
  • 56
0
votes
1 answer

Superimpose on FITS image on another with PyWCSGrid2

I've got 2 .FITS images. One is an image of some stars and galaxies. The other is a significance map that I want to plot over it, as a contour. PyWCSGrid2 is the python module to do this in, but I've tried to overlay one on the other for a while and…
Astro_Dart
  • 195
  • 1
  • 1
  • 9
0
votes
2 answers

pip on OSX Yosemite 10.10 gives bad command

I run OSX Yosemite on a macbook air. I have python3 installed, as well as the apple developer package. I am trying to install modules like ones I have installed already including matplotlib. Basically when I try to install scientific python…
11thZone
  • 71
  • 3
  • 10
0
votes
2 answers

How to use conda to install Github package specutils?

I am using Anaconda python (2.7) on my Windows 7 machine. I want to install specutils which is a associated package for Astropy. conda, as I understand, can installs binaries using conda install command. My question is where can I find…
Jack
  • 11
  • 1
  • 1
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
1 answer

Getting image from Fits files from SDSS DR10

Basically I just want to get the image data from the r-waveband fits file found here using pyfits that has been incorporated into astropy. Here is my attempt: from astropy.io import fits import matplotlib.pyplot as plt hdulist =…
Lucidnonsense
  • 1,195
  • 3
  • 13
  • 35
0
votes
1 answer

Indexing Error with HDU FITS file format with numpy

I'm attempting to read the data from a FITS file using the astropy module fits and then standard numpy array handling. However, for some reason I am receiving the following error: IndexError: too many indices This is the code that I am using: from…
GCien
  • 2,221
  • 6
  • 30
  • 56