fitsmgmt.table.group_fits
fitsmgmt.table.group_fits(
summary_table,
type_key=None,
type_val=None,
group_key=None,
table_filecol='file',
verbose=False,
)Organize the group_by and type_key for select_fits
Parameters
summary_table : pd.DataFrame | Table-
The table which contains the metadata (header) of files. If it is in the astropy table format, it will be converted to
~pandas.DataFrameobject. type_key : str | list[str] | None = None-
The header keyword for the ccd type, and the value you want to match.
type_val : str | list[str] | None = None-
The header keyword for the ccd type, and the value you want to match.
group_key :None,str,listofstr= None-
The header keyword which will be used to make groups for the CCDs that have selected from
type_keyandtype_val. IfNone(default), no grouping will occur, but it will return the~pandas.DataFrameGroupByobject will be returned for the sake of consistency. Default:None.
Returns
grouped :~pandas.DataFrameGroupBy-
The table after the grouping process.
group_type_key :listofstr-
The
type_keythat can directly be used forselect_fitsfor each element ofgrouped.groups. Basically this istype_key + group_key.
Examples
>>> allfits = list(Path('.').glob("*.fits"))
>>> import astroimred as air
>>> summary_table = fm.fits_summary(allfits)
>>> type_key = ["OBJECT"]
>>> type_val = ["dark"]
>>> group_key = ["EXPTIME"]
>>> gs, g_key = group_fits(summary_table,
... type_key,
... type_val,
... group_key)
>>> for g_val, group in gs:
>>> _ = combine_ccd(group["file"],
... type_key=g_key,
... type_val=g_val)