Questions tagged [pyfits]

PyFITS provides an interface to FITS formatted files in the Python scripting language.

Note: PyFITS has been superseded by Astropy via the astropy.io.fits package. Please only the tag for questions that involve directly using older versions of PyFITS, as opposed to Astropy (in which case the tag should be used).

PyFITS provides an interface to FITS formatted files in the Python scripting language. It is useful both for interactive data analysis and for writing analysis scripts in Python using FITS files as either input or output. PyFITS was a development project of the Science Software Branch at the Space Telescope Science Institute.

88 questions
-1
votes
1 answer

Can't import pyfits on python 3.7.6

When I try to import pyfits I get the following message /home/elihu/anaconda3/lib/python3.7/site-packages/pyfits/__init__.py:22: PyFITSDeprecationWarning: PyFITS is deprecated, please use astropy.io.fits PyFITSDeprecationWarning) # noqa Does…
eemg
  • 13
  • 2
-1
votes
1 answer

Is something wrong with my fits file?

I am currently trying to display this fits image, but I keep running into different errors. At first it couldn't print the non-ASCII characters in the header so I went ahead and deleted them (they seemed like just blank spaces in the header, it…
-1
votes
1 answer

Pyfits reordering axis

I am having a problem, with python, pyfits and numpy. I am opening a fits file with the usual file = pyfits.open('file.fits', memap = True) when calling file.info() It shows me, that the dataset contained has the shape (2,1024,1024,546): No. …
HenrikWolf
  • 101
  • 1
  • 6
-1
votes
1 answer

operations on column length

Firstly, sorry if I have used the wrong language to explain what I'm operating on, I'm pretty new to python and still far from being knowledgeable about it. I'm currently trying to do operations on the length of a column of data however I'm running…
Simon
  • 1
-1
votes
1 answer

Size of FITS file different before and after processing

I have problem with file size after processing...I wrote script which create edited image...(From raw image data deduct flat field image data and dark image data)...Here is code Convert float NumPy array to big endian And my problem is...At the…
Franta Konopnik
  • 189
  • 2
  • 9
  • 20
-1
votes
1 answer

instancemethod object has no attribute '___getitem__'

I am on PyCharm (community edition 4.0.2) retrieving data from a .fits file. z = data.field [SDSS_Z] results in TypeError: 'instancemethod' object has no attribute 'getitem'. On other Field of the same .fits file I have no problems import…
rbaer
  • 11
  • 1
  • 3
-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

Can not plot .fit file with PYFITS

In Fits file I have three columns called J, H, and K and I would like to plot the relation between J-H and H-K in x and y axes with PYFITS, respectively. How can I make this?
user2154410
  • 87
  • 3
  • 11
-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
  • 10
-1
votes
3 answers

Opening array of filenames with pyfits

I have an array of filenames, and I want to open each file with pyfits. So my code should be something like: import pyfits files=array(["1131lc.fits+2","1132lc.fits+2","1134lc.fits+2","1136lc.fits+2","1137lc.fits+2","1138lc.fits+2"]) for file in…
Py-ser
  • 1,860
  • 9
  • 32
  • 58
-1
votes
1 answer

python/pyfits syntax errors

I'm currently working on some project using PyFITS. As a beginner with python 3.3, I can't figure out the two errors I get... 1st error------------------------ import pyfits;\ hdulist = pyfits.open('/Users/geo/Desktop/test/casa.fits')\ for i in…
Geo
  • 119
  • 1
  • 10
-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
  • 77
  • 1
  • 6
-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
  • 7
1 2 3 4 5
6