soxspipe.commonutils.set_of_files¶
Tools for working with ‘set-of-files’ (sof) files
- Author
David Young & Marco Landoni
- Date Created
January 22, 2020
Module Contents¶
Classes¶
The worker class for the sof module used to homogenize various frame input formats (sof file, directory of fits fits, list of fits file paths) into a CCDProc ImageFileCollection |
API¶
- class soxspipe.commonutils.set_of_files.ImageFileCollection[source]¶
Bases:
soxspipe.commonutils.set_of_files.ImageFileCollection
- class soxspipe.commonutils.set_of_files.set_of_files(log, settings=False, inputFrames=[], verbose=True, recipeName=False, ext=0, session=None)[source]¶
Bases:
objectThe worker class for the sof module used to homogenize various frame input formats (sof file, directory of fits fits, list of fits file paths) into a CCDProc ImageFileCollection
Key Arguments:
log– loggersettings– the settings dictionaryinputFrames– can be a directory, a set-of-files (SOF) file or a list of fits frame paths. Default []verbose– verbose. True or False. Default TruerecipeName– the name of the recipe. Default Falseext– the data extension for the frame. Default 0.
Usage
To initiate a sof object, use the following:
# inputFrames = "/path/to/a/directory" # inputFrames = ['/path/to/one.fits','/path/to/two.fits','/path/to/three.fits'] inputFrames = '/path/to/myfiles.sof' from soxspipe.commonutils.set_of_files import set_of_files sof = set_of_files( log=log, settings=settings, inputFrames=inputFrames, ext=0 )
inputFramescan be a directory, a list of fits filepaths or a set-of-files (SOF) fileInitialization
- create_supplementary_file_dictionary(supplementaryFilepaths)[source]¶
create supplementary file dictionary
Key Arguments:
supplementaryFilepaths– the list of filepaths to generate the dictionary for
Return:
supplementary_sof– a dictionary of non-fits files needed for recipe
- get()[source]¶
return the set-of-files as a CCDProc ImageFileCollection
Return:
sof– a ccdproc ImageFileCollection of the frames
Usage
To generate a ImageFileCollection from a directory, a list of fits filepaths or a set-of-files (SOF) file try the following:
# inputFrames = "/path/to/a/directory" # inputFrames = ['/path/to/one.fits','/path/to/two.fits','/path/to/three.fits'] inputFrames = '/path/to/myfiles.sof' from soxspipe.commonutils.set_of_files import set_of_files sof = set_of_files( log=log, settings=settings, inputFrames=inputFrames ) sofFile, supplementarySof = sof.get() print(sofFile.summary)
inputFramescan be a directory, a list of fits filepaths or a set-of-files (SOF) file.