5.26. bin¶
Bins the data of the FitsArray object.
- FitsArray.bin(self, binning_factor: int | List[int], func: Callable[[Any], float] = np.mean, output: str | None = None) Self¶
Bins the data of the
FitsArrayobject.Parameters
binning_factorUnion[int, List[Union[int, List[int]]]]Binning factor.
funcCallable[[Any], float], defaultnp.meanThe function to be used for merging values during binning.
outputOptional[str]New path to save the files.
Returns
FitsArrayA binned
FitsArrayobject.
Raises
ValueErrorWhen the
binning_factoris invalid.ValueErrorWhen the
binning_factoris too large.
5.26.1. Example:¶
from myraflib import FitsArray
import math
fa = FitsArray.sample()
cropped_fa_1 = fa.bin(10)
cropped_fa_2 = fa.bin([10, 20])