[AstroPy] PyFITS Too many open files
Sat Jun 15 00:08:42 CDT 2013
You need to close the files once you have retrieved the data...
On Fri, Jun 14, 2013 at 10:51 PM, Nicholas Earl <firstname.lastname@example.org> wrote:
> Hello everyone,
> I'm having an issue with opening and retrieving information for a large
> amount of fits files. Mainly, I keep running into a mmap.error: [Errno
> 24] Too many open files error. The code I'm using is:
> import pyfits
> for filename in os.listdir(directory):
> kep_id = filename[4:13]
> with pyfits.open(directory + "/" + filename, ignore_missing_end=True) as
> time = fits.data["TIME"]
> energy = fits.data["ENERGY"]
> Any ideas would be greatly appreciated!
> Nicholas Earl
> Graduate Research Assistant
> San Diego State University
> AstroPy mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the AstroPy