0

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 astropy.io import fits

hdu_list = fits.open('large_file.fit', memmapper=True)
table = hdu_list[1].data

On the second line table = hdu_list[1].data I then get OSError: [WinError 8] Not enough storage is available to process this command

My thinking is that when assigning the data to the variable table, the attempt is made to read the entire file, causing the storage error. Is there any work around, or a method to simply read in each line of the table data at a time?

Snyder005
  • 224
  • 2
  • 8
  • I think you mean `memmap=True`--there is no "memmapper" option. – Iguananaut Apr 30 '15 at 20:32
  • Could you post just the header of the FITS file? That usually contains all the most useful information for debugging issues like this. Am I correct to guess you're on Windows? – Iguananaut Apr 30 '15 at 20:33

1 Answers1

2

Discovered what went wrong. I tried to open the FITS file with fitsio and then read row by row. However the program ran for awhile, then threw an IOError. I found that one of the rows of the file was corrupted, and that was what was causing the inability of astropy.io.fits to read the file without throwing an error. I am unsure of exactly how the row became corrupted, or exactly what was wrong with it, I simply downloaded a second copy of the FITS file and that fixed the problem.

Snyder005
  • 224
  • 2
  • 8