Questions tagged [fits]

FITS is an image data file format used commonly for astronomical data.

FITS is an image data file format used commonly for astronomical data. It supports metadata for many photometric and calibration information.

See also: http://en.wikipedia.org/wiki/FITS

Please use publicly available data from MAST, or link to files in a GitHub repo, so code examples are easily reproducible.

338 questions
2
votes
1 answer

What does it mean that a card is fixed to meet FITS standard?

I am trying to use a FITS file. I have the following code: from astropy.io import fits from astropy.wcs import WCS hdul = fits.open(fitsfilename)[0] wcs = WCS(hdul.header) It gives me these warnings: WARNING: VerifyWarning: Verification reported…
zabop
  • 6,750
  • 3
  • 39
  • 84
2
votes
1 answer

Opening Astropy FITS file from SFTP server

I have a Python script that ssh into a remote server using Paramiko module. The below is my script import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect("host", username="McMissile") A…
Mc Missile
  • 715
  • 11
  • 25
2
votes
1 answer

astropy FITS with multiple headers

I'm trying to create a FITS file in Python but I appear to be having problems when compiling the headers and PrimaryHDU together. I've made a simple example which will give the error that I'm getting: import numpy as np from astropy.io import…
user8188120
  • 883
  • 1
  • 15
  • 30
2
votes
2 answers

Multiple Tables saved in the same .fits file

I have multiple tables created with astropy.table.Table, for example: from astropy.table import Table import numpy as np #table 1 ta=Table() ta["test1"]=np.arange(0,100.) #table 2 tb=Table() tb["test2"]=np.arange(0,100.) I can save them…
Julia Roquette
  • 537
  • 1
  • 6
  • 17
2
votes
0 answers

FITS image data to a common image format

I would like to read FITS file image data and display it like standard image using java and nom.tam.fits library. Right now I manage to read data into two dimensional array. In my case returned 4 dimensional array with size [1][1][1024][1024]. In…
2
votes
0 answers

Simple Angle Rotation of a FITS File image

Using the Astropy function Rotation2D, I have been attempting to rotate an image array (in the form of a fits file) given an angle. My problem is that I do not understand how or where to properly use the inputs. In this case,the inputs would…
Wolfgang
  • 329
  • 3
  • 13
2
votes
1 answer

How can I combine two FITS tables into a single table in new fits file?

I have two fits file data (file1.fits and file2.fits). The first one (file1.fits) consists of 80,700 important rows of data and another one is 140,000 rows. The both of them have the same Header. $ python >>> import pyfits >>> f1 =…
2
votes
3 answers

Python astropy: table and columns objects

I am playing around with Tables object from astropy.table module. The piece of code below shows the type of data I am dealing with: In [44]: table Out[44]: defocus source Chi2 xcentroid ycentroid FWHMx FWHMy …
samR
  • 57
  • 4
2
votes
2 answers

What can I do for my program not to throw a KeyError for a Header not existing in a .fits file?

I am making a program that searches the computer for .fts and .fits files in which it opens the file and retrieves info that corresponds to a specific keyword in the header and renames the file to that keyword. I am having a problem where i keep…
2
votes
1 answer

Unable to read WCS from SDSS co-added Stripe 82 fits image

I try to read the World Coordinate System (WCS) from a FITS file using satrapy and this code: from astropy.wcs import WCS from astropy.io import fits data = 'file.fits' hdu = fits.open(data) w = WCS(hdu[0].header) I get the error: WARNING:…
Benjamin Rose
  • 165
  • 1
  • 2
  • 6
2
votes
1 answer

How can I write a fits table into an output LDAC fits catalog using Python

I have an LDAC fits catalog which in a Python code I need to add the elements of two arrays as two new columns to it. I open the original catalog in python: from astropy.io import fits from astropy.table import Table import astromatic_wrapper as…
Zeinab
  • 23
  • 4
2
votes
1 answer

Write 3d Numpy array to FITS file with Astropy

I have a 3D NumPy array (i.e. (10, 256, 256)) representing 256x256 images. I would like to write this array to a FITS file using astropy.io.fits so that I can open the file using ds9 -mecube and move through the frames. My attempt is shown…
Snyder005
  • 224
  • 2
  • 8
2
votes
1 answer

python multiprocessing slower than normal - calculation too trivial?

I dont have much experience with parallel processing in python. I have a script that takes in several fits files, which are basically images, reads them into 3D numpy arrays and does some calculations on it. I guess the "worst" part is, that I have…
Pythoneer
  • 165
  • 1
  • 12
2
votes
1 answer

astropy.io fits efficient element access of a large table

I am trying to extract data from a binary table in a FITS file using Python and astropy.io. The table contains an events array with over 2 million events. What I want to do is store the TIME values of certain events in an array, so I can then do…
dragoncat16
  • 121
  • 3
2
votes
1 answer

How to Use Pixel Coordinates with the imshow() command in order to make images from specific sections of a fits image in python?

I have a fits image with many astronomical objects in it. I am trying to create small 4x4 "stamps" (sections/images around the objects) from the objects that interest me. I have already calculated the pixel coordinates for the objects in the…
Seadrow
  • 23
  • 3