Bases: object
Representation of a collection of image files.
The class offers a table summarizing values of keywords in the FITS headers of the files in the collection and offers convenient methods for iterating over the files in the collection. The generator methods use simple filtering syntax and can automate storage of any FITS files modified in the loop using the generator.
Parameters: | location : str, optional
keywords : list of str, optional
info_file : str, optional
|
---|
Attributes
location | str, Path name to directory containing FITS files |
keywords | list of str, Keywords currently in the summary table. |
files | list of str, Unfiltered list of FITS files in location. |
summary_info | astropy.table.Table of values of FITS keywords for files in the collection. |
Attributes Summary
files | list of str, Unfiltered list of FITS files in location. |
keywords | list of str, Keywords currently in the summary table. |
location | str, Path name to directory containing FITS files |
summary_info | astropy.table.Table of values of FITS keywords for files in the collection. |
Methods Summary
data([hdulist, save_with_name, ...]) | Generator that yields each image in the collection. |
files_filtered(**kwd) | Determine files whose keywords have listed values. |
hdus([save_with_name, save_location, ...]) | Generator that yields each HDU in the collection. |
headers([save_with_name, save_location, ...]) | Generator that yields each header in the collection. |
values(keyword[, unique]) | List of values for a keyword. |
Attributes Documentation
list of str, Keywords currently in the summary table.
Setting the keywords causes the summary table to be regenerated unless the new keywords are a subset of the old.
astropy.table.Table of values of FITS keywords for files in the collection.
Each keyword is a column heading. In addition, there is a column called ‘file’ that contains the name of the FITS file. The directory is not included as part of that name.
Methods Documentation
Generator that yields each image in the collection.
If any of the parameters save_with_name, save_location or clobber evaluates to True the generator will write a copy of each FITS file it is iterating over. In other words, if save_with_name and/or save_location is a string with non-zero length, and/or clobber is True, a copy of each FITS file will be made.
Parameters: | save_with_name : str
save_location : str
clobber : bool
do_not_scale_image_data : bool
return_fname : bool, default is False
kwd : dict
|
---|---|
Returns: | numpy.ndarray
(numpy.ndarray, str)
|
Determine files whose keywords have listed values.
**kwd is list of keywords and values the files must have.
Example: >>> keys = [‘imagetyp’,’filter’] >>> collection = ImageFileCollection(‘test/data’, keywords=keys) >>> collection.files_filtered(imagetyp=’LIGHT’, filter=’R’) >>> collection.files_filtered(imagetyp=’*’, filter=’‘)
NOTE: Value comparison is case insensitive for strings.
Generator that yields each HDU in the collection.
If any of the parameters save_with_name, save_location or clobber evaluates to True the generator will write a copy of each FITS file it is iterating over. In other words, if save_with_name and/or save_location is a string with non-zero length, and/or clobber is True, a copy of each FITS file will be made.
Parameters: | save_with_name : str
save_location : str
clobber : bool
do_not_scale_image_data : bool
return_fname : bool, default is False
kwd : dict
|
---|---|
Returns: | astropy.io.fits.HDU
(astropy.io.fits.HDU, str)
|
Generator that yields each header in the collection.
If any of the parameters save_with_name, save_location or clobber evaluates to True the generator will write a copy of each FITS file it is iterating over. In other words, if save_with_name and/or save_location is a string with non-zero length, and/or clobber is True, a copy of each FITS file will be made.
Parameters: | save_with_name : str
save_location : str
clobber : bool
do_not_scale_image_data : bool
return_fname : bool, default is False
kwd : dict
|
---|---|
Returns: | astropy.io.fits.Header
(astropy.io.fits.Header, str)
|