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

Can't read FITS file with GalSim

Setup MacOS 10.12.6 Python 2.7 Galsim 1.4.4 Numpy 1.13.1 Astropy 1.3.3 Fitsio Goal My goal is to take simulated wide field HST images (12288*12288 pixels, roughly 600MB in .fits format) and add the WFIRST detector features to it.…
Ashlou
  • 616
  • 1
  • 6
  • 20
-1
votes
2 answers

How can I access the image data from a FITS file?

how can I access the image subsample from a FITS file? I could not tell where exactly the data is in the file! The file headers show that it's in the second header and that it is of dimension 1024*1024! But when I try to access the second header I…
-1
votes
3 answers

Arrays returning as empty when using an 'if statement' after glob.glob on FITS Files

I am using glob.glob make my script only read the data from certain FITS files (astropy.io.fits is brought in as pf and numpy as np). For this x is the value that I change to get these certain files (For reference the 'x = np.arrange(0) and y1 =…
-1
votes
1 answer

How to convert FITS to JPG in Java?

I need to convert a fits file to jpg in java. I've tried with imageJ but I need a simple library without GUI. I'm developing a web page in java and I need to convert the file in background (headlessly).
Alex
  • 11
  • 1
-1
votes
1 answer

Reading fits file in python

I have a problem reading data from a fits file. Usually i can read data from a fits file just fine but now I have some data files which gives me some problems. When I try to read the file, which should contain three columns and a header, all i get…
Quasar
  • 1
  • 1
  • 2
-1
votes
1 answer

Using python to analyze a FITS image for a star count

I have several FITS images taken with my telescope and I need help with a python code to analyze the images and obtain a star count for each image. I don't have any code yet because I'm extremely new to python. Any help would be greatly appreciated.…
-1
votes
1 answer

How do I repeat the same task on different data without duplication

I am new to Python and have been writing scripts that do some tasks to certain FITS files. The script that I currently use is this: # General routines import numpy as np import math import pyfits import matplotlib.pyplot as plt import pylab as…
Srivatsan
  • 7,913
  • 6
  • 45
  • 76
-1
votes
1 answer

Manipulating data arrays and adding noise

I just cannot seem to get this right! :-( I have a code that is supposed to read in a .fits file, add normally distributed noise to it, and then re-save that code. So far, it just does not seem to be working at all. There's a lot of extra code, so I…
vdogsandman
  • 5,019
  • 7
  • 17
  • 20
-1
votes
3 answers

Can't find my error in the "while" loop reading HDUs

Once a beginner, always a beginner! I'm using python 2.7.5, OSX 10.8 You may have the solution to my question even if you don't know pyfits, since I believe it's a problem in my algorithm! I use the following code #!/usr/bin/python # -*- coding:…
Geo
  • 119
  • 1
  • 9
-2
votes
1 answer

function has no attribute

I am trying to write this code and it works perfectly in pycharm. But, whenever I tried to run it after converting into exe it gives me an error "function has no attribute 'read_exif'". The package I am using for this function is not manually…
-2
votes
1 answer

Pyfits or astropy.io.fits add row to binary table in fits file

How can I add a single row to binary table inside large fits file using pyfits, astropy.io.fits or maybe some other python library? This file is used as a log, so every second a single row will be added, eventually the size of the file will reach…
Vitalii
  • 57
  • 5
-2
votes
2 answers

Picking out a single row in a FITS table with Astropy

I "simply" want to read in an (Astronomy) FITS table, and pick out all the information on one object via its name:: from astropy.io import fits dr7q = fits.open('Shen_dr7_bh_May_2010.fits') tbdata = dr7q[1].data w = tbdata[tbdata['SDSS_NAME'] ==…
npross
  • 1,348
  • 2
  • 15
  • 30
-2
votes
1 answer

Write a new fits file after modification in pixel values

I have a small problem. I know there are some similar questions but I do not know that I am doing wrong because they are not working for me, I would appreciate any help. I want to change some pixel values in a fits file. They are basically empty…
Enrique
  • 55
  • 6
-2
votes
1 answer

How to convert RA-Dec coordinates to galactic coordinates in python

I was converting a pixel coordinate fits file to world coordinates in Python. The header shows that this fits file is in RA-Dec coordinate system . I want to convert this to galactic coordinates. Here is what I've tried. from astropy import…
LALI
  • 1
  • 2
-3
votes
1 answer

Working with fits files in python (Astropy)

I have a fits file having data of dimension (180, 360), which is 180 rows with 360 elements in each row. When I plot it the range of the x-axis is from 0 to 360 and that of the y axis is from 0 to 180. I want to convert y axis range from -90 to 90…
1 2 3
19
20