edges.averaging.combiners¶
Functions for combining multiple GSData files/objects.
- edges.averaging.combiners.average_files_pairwise(*files: str | Path, **kwargs: Any) GSData[source]¶
Average multiple files together using their flagged weights.
This has better memory management than lst_average, as it only ever reads two files at once.
- Parameters:
files (str or Path) – The files to average together.
**kwargs – Additional keyword arguments to pass to the
average_multiple_objects()function.
- Returns:
GSData – The averaged GSData object.
See also
average_multiple_objectsThe function that actually does the averaging.
- edges.averaging.combiners.average_multiple_objects(*objs: Sequence[GSData], nsamples_strategy: NsamplesStrategy = NsamplesStrategy.FLAGGED_NSAMPLES, use_resids: bool | None = None) GSData[source]¶
Average multiple GSData objects together.
In this function, each GSData object is expected to have the same data shape, so that each GSData object’s data array can be directly summed together. This is most useful when each file represents a single night’s worth of data, and the time axis represents different LSTs. However, the function is agnostic to the details of what each object represents.
- Parameters:
objs (GSData) – The GSData objects to average together.
nsamples_strategy (NsamplesStrategy) – The strategy to use when considering the weights with which to combine the objects. See the documentation for
NsamplesStrategyfor more information.use_resids (bool, optional) – If True, the residuals will be averaged and added to the average model. If False, the residuals will be ignored. If None, the residuals will be used if they are present in all objects, and otherwise ignored.
- Returns:
GSData – The averaged GSData object.
- Raises:
ValueError – If the objects do not all have the same shape, or if use_resids is True and one or more of the objects has no residuals.