imutil.imcombine.group_combine

imutil.imcombine.group_combine(
    inputs,
    type_key=None,
    type_val=None,
    group_key=None,
    fmt=None,
    outdir=None,
    verbose=1,
    **kwargs,
)

Combine sub-groups of FITS files from the given input.

Parameters

inputs : ~pandas.DataFrame, glob pattern, list-like of path-like

If DataFrame, it must be the summary table made by fm.fits_summary. The ~glob pattern for files (e.g., "2020*[012].fits") or list of files (each element must be path-like or ~astropy.nddata.CCDData). Although it is not a good idea, a mixed list of ~astropy.nddata.CCDData and paths to the files is also acceptable. For the purpose of imred.imcombine, the best use is to use the ~glob pattern or list of paths.

type_key : str, list of str = None

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

type_val : str, list of str = None

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

group_key : None, str, list of str = None

The header keyword which will be used to make groups for the CCDs that have selected from type_key and type_val. If None (default), no grouping will occur, but it will return the ~pandas.DataFrameGroupBy object will be returned for the sake of consistency. Default: None.

verbose : int, optional. = 1

Larger number means it becomes more verbose:

  • 0: print nothing
  • 1: only essential messages from this function
  • 2: also pass verbose mode to imred.imcombine

Default: 1.

fmt : str = None

The f-string for the output file names.

Example: if group_key="EXPTIME" and there are two groups where EXPTIME is 1.0 and 2.0,

  • "dark_{:.1f}s" gives dark_1.0s.fits and dark_2.0s.fits.
  • For float, non-specification such as "d{}" is not recommended because filenames can contain long floating-point representations.

If two group_key values are used, resulting in ("B", 2.0), ("V", 12.0), …:

  • "flat_{2:04.1f}_{1:s}" gives "flat_02.0_B.fits" and "flat_12.0_V.fits".

Default: None.

outdir : path - like = None

The directory where the output fits files will be saved.

****kwargs** : = {}

The keyword arguments for imcombine. Default: None.

Returns

combined : dict of ~astropy.nddata.CCDData

The dict object where keys are the header value of the group_key and the values are the combined images in ~astropy.nddata.CCDData object. If multiple keys for group_key is given, the key of this dict is a tuple.