fitsmgmt.table.select_fits

fitsmgmt.table.select_fits(
    inputs,
    extension=None,
    unit=None,
    trimsec=None,
    table_filecol='file',
    prefer_ccddata=False,
    type_key=None,
    type_val=None,
    path_to_text=False,
    verbose=True,
)

Stacks the FITS files specified in fitslist

Parameters

inputs : path-like, ~astropy.nddata.CCDData, ~astropy.io.fits.PrimaryHDU, ~astropy.io.fits.ImageHDU, ~pandas.DataFrame or ~astropy.table.Table

If it is path-like, it must contain FITS files to extract header. If CCD-like, the header information will be used for selecting elements to select.

extension : int, str, (str, int), optional. = None

The extension of FITS to be used. It can be given as integer (0-indexing) of the extension, EXTNAME (single str), or a tuple of str and int: (EXTNAME, EXTVER). If None (default), the first extension with data will be used. Ignored if inputs is table-like. Default: None.

unit : str | u.Unit | None = None

The unit of the CCDs to be loaded. Used only when fitslist is not a list of ~astropy.nddata.CCDData and prefer_ccddata is True. Ignored if inputs is table-like. Default: None.

trimsec : str, [list of] int, [list of] slice = None

Section of the data to be extracted by ~astroimred.imutil.ccdops.imslice. Default is None. Ignored if inputs is table-like.

table_filecol : str, optional. = 'file'

The column name of the summary_table which contains the path to the FITS files. Ignored if inputs is CCD-like. Default: 'file'.

prefer_ccddata : bool = False

Whether to prefer to return ~astropy.nddata.CCDData objects if possible. If True, path-like, ~numpy.ndarray, or table-like input will return a list of ~astropy.nddata.CCDData. If False (default), only the paths will be returned unless the inputs is consist of ~astropy.nddata.CCDData. Ignored if inputs is already CCD-like.

type_key : str | list[str] | None = None

The header keyword for the ccd type, and the value you want to match. Default: False.

type_val : str | list[str] | None = None

The header keyword for the ccd type, and the value you want to match. Default: False.

Returns

matched : list of ~pathlib.Path or list of ~astropy.nddata.CCDData

list containing ~pathlib.Path to files if prefer_ccddata is False. Otherwise it is a list containing loaded ~astropy.nddata.CCDData after loading the files. If ccdlist is given a priori, list of ~astropy.nddata.CCDData will be returned regardless of prefer_ccddata.