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 byfm.fits_summary. The~globpattern for files (e.g.,"2020*[012].fits") orlistof files (each element must be path-like or~astropy.nddata.CCDData). Although it is not a good idea, a mixedlistof~astropy.nddata.CCDDataand paths to the files is also acceptable. For the purpose ofimred.imcombine, the best use is to use the~globpattern orlistof paths. type_key :str,listofstr= None-
The header keyword for the ccd type, and the value you want to match.
type_val :str,listofstr= 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. 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 whereEXPTIMEis 1.0 and 2.0,"dark_{:.1f}s"givesdark_1.0s.fitsanddark_2.0s.fits.- For
float, non-specification such as"d{}"is not recommended because filenames can contain long floating-point representations.
If two
group_keyvalues 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 :dictof~astropy.nddata.CCDData-
The
dictobject where keys are the header value of thegroup_keyand the values are the combined images in~astropy.nddata.CCDDataobject. If multiple keys forgroup_keyis given, the key of thisdictis atuple.