FitsManager#
- class prose.FitsManager[source]#
A class for managing FITS files.
- Parameters:
folders (str or list of str, optional) – The folder(s) to search for FITS files. If not provided, files must be provided.
files (str or list of str, optional) – The file(s) to read. If not provided, folders must be provided.
depth (int, optional) – The subfolder depth to search for files in the folder(s). Default is 0 (search only in the provided folder(s)).
hdu (int, optional) – The HDU to read from the FITS file. Default is 0 (the primary HDU).
extension (str, optional) – The extension of the FITS file(s) to search for. Default is “.f*t*” (search for all FITS file extensions).
file (str, optional) – The name of the SQLite database file to use. Default is “:memory:” (create an in-memory database).
batch_size (int or bool, optional) – The number of files to store in the databse at once. If False, read all files at once. Default is False. This is to allow a scanning of a large number of files that are still saved in the database if an error occurs.
scan (callable, optional) – The function used to retrieve files from a folder. Signature is scan(folder) -> list of file paths. Default is None.
verbose (bool, optional) – Whether to display progress information. Default is True.
to_df (function, optional) – A function to use for converting FITS files to pandas DataFrames. Default is None.
telescope (str, optional) – The name of the telescope used to take the FITS files. Default is None.
- con#
The SQLite database connection.
- Type:
sqlite3.Connection
- cur#
The SQLite database cursor.
- Type:
sqlite3.Cursor
- fits_to_df#
The function used for converting FITS files to pandas DataFrames.
- Type:
function
Methods
__init__
([folders, files, depth, hdu, ...])bias
(i[, show])Return the paths of the bias images associated to a given observation.
calibrations
(**kwargs)return a pandas DataFrame of calibrations observations given some metadata constraints in the form of wildcards.
darks
(i[, show])Return the paths of the dark images associated to a given observation.
files
([id, path, exposure, tolerance])Return a pandas DataFrame of files given some metadata constraints in the form of wildcards.
flats
(i[, show])Return the paths of the flat images associated to a given observation.
get_files
(folders, extension[, scan, depth])Return paths of files with specific extension in the specified folder(s)
images
(i[, show])Return the paths of the observation science images for a given observation id.
label
(i)Return a string label for the observation with the given index.
observation_files
(i[, past, future, ...])Return a dictionary of files for a given observation ID, along with calibration files.
observations
([hide_exposure])return a pandas DataFrame of observations given some metadata constraints in the form of wildcards
paths
(**kwargs)Get the paths of all files matching the kwargs query (see prose.FitsImage.files)
scan_files
(files[, batch_size, verbose, ...])Scan files and add data to database
to_pandas
(query)Execute a SQL query and return the result as a pandas DataFrame.
Attributes
all_bias
fits paths of the observation bias images
all_darks
fits paths of the observation dark images
all_flats
fits paths of the observation flats images
all_images
fits paths of the observation science images
obs_name
Observation name ({telescope}_{date}_{target}_{filter}) if a single observation is present
reduced
fits paths of the observation calibrated images if present
stack
fits paths of the observation stack image if present
unique_obs
Return whether the object contains a unique observation (observation is defined as a unique combinaison of date, telescope, target and filter).