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

286 questions
2
votes
1 answer

Combining Astropy FITS files?

So I have some Astropy fits tables that I save (they have all have the same format, column names, etc.). I want to take all these fits files and combine them to make one large fits file. Currently, I am playing around with the astropy.io append and…
Patrick
  • 161
  • 7
2
votes
2 answers

Scale axis tick labels for coordinates plot

I am working with VLBI data (Very Long Baseline Interferometry, like one that was used to make a recently trended black hole shadow image). I am plotting an image which is taken from a FITS file. By the means of a WCS transformation, it is…
Mikhail Lisakov
  • 1,170
  • 1
  • 7
  • 7
2
votes
1 answer

How do you log stretch a FITS image and change its contrast?

I'm trying to use astropy 2.0.11 with python 2.7.15 to edit a fits image by applying a log stretch to it and change the contrast, and I have't been able to figure it out. I've been trying to follow the tutorials on the astropy website for opening…
SPYBUG96
  • 782
  • 3
  • 13
  • 30
2
votes
2 answers

Making an Image Cube using multiple fits images

I have a bunch of fits files that can be read using the below script from astropy.io import fits hdu = fits.open('file.fits') data = hdu[0].data I am trying to make an image cube using the data read from multiple fits files. (An image cube is a 3D…
Mc Missile
  • 585
  • 5
  • 20
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
  • 585
  • 5
  • 20
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
  • 347
  • 2
  • 15
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
1 answer

Saving masked image as FITS

I've constructed an image from some FITS files, and I want to save the resultant masked image as another FITS file. Here's my code: import numpy as np from astropy.io import fits import matplotlib.pyplot as plt #from astropy.nddata import…
Jim421616
  • 1,087
  • 1
  • 10
  • 29
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
  • 308
  • 1
  • 13
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
  • 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
  • 214
  • 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
  • 10
1 2
3
19 20