5.38. combine

Performs addition on the FitsArray object.


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

Combines FitsArray to a Fits.

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[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.38.1. Example:

from myraflib import FitsArray

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