colour_aggregate#
- niriss_tools.sed.colour_aggregate(orig_images, signal, noise, target_sn=100, plot=False, quiet=False, mask=None, **kwargs)[source]#
Bin pixels to a specified signal/noise ratio.
Pixels are binned based on their separation in colour space, accounting for all combinations of single-band images supplied.
- Parameters:
- orig_images
ArrayLike A 3D array, or list of arrays. Each slice of the array along
axis=0should be a different photometric band, with the same shape and alignment as thesignalandnoisearrays.- signal
ArrayLike A 2D array containing the signal to be binned.
- noise
ArrayLike A 2D array containing the associated noise.
- target_sn
float, optional The desired S/N in each output bin, by default 100. This is only guaranteed to be achieved for the hexagonal bins, as there is some scatter on the S/N achieved through Voronoi binning.
- plotbool, optional
Show a comparison of the binned and unbinned data, alongside the S/N and bin maps. By default
False.- quietbool, optional
Print the output of the Voronoi binning procedure, by default
False.- mask
ArrayLike|None, optional Values in the input signal and noise to mask out, i.e. where
mask==Truewill not be included in the binned data.- **kwargs
dict, optional A catch-all for additional parameters not relevant for this binning scheme.
- orig_images
- Returns:
- bin_labels
ArrayLike A 2D
intarray, containing the bin label assigned to each element of the input arrays.- nbins
int The number of bins.
- binned_s_n
ArrayLike A 1D array of length
nbins, containing the S/N in each bin.- bin_inv
ArrayLike A 2D array performing the inverse binning operation, i.e.
binned_s_n[inv]gives an array of the same shape asx.
- bin_labels