5.41. flat_combine

Combines FitsArray to a Fits optimized for flat combining.


FitsArray.flat_combine(method: str = 'median', clipping: str | None = None, weights: List[str] | List[float | int] | None = None, output: str | None = None, override: bool = False) Fits

Combines FitsArray to a Fits optimized for flat combining.

Parameters

methodstr

Method of combination. Either “average”, “mean”, or “median”.

clippingstr, optional

Clipping method (same as rejection in IRAF). Either “sigmaclip” or “minmax”.

weightsUnion[List[str], List[Union[float, int]]], optional

Weights to be applied before combining. If None, [1, …] will be used.

outputstr, optional

New path to save the files.

overridebool, default=False

If True, delete the already existing file.

Returns

Fits

The combined Fits.

Raises

ValueError

When the number of weights is not equal to the number of FITS files.

ValueError

When the method is not either “average”, “mean”, “median”, or “sum”.

ValueError

When the clipping is not either “sigmaclip” or “minmax”.


5.41.1. Example:

from myraflib import FitsArray

fa = FitsArray.sample()
combined = fa.flat_combine()