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_imagesArrayLike

A 3D array, or list of arrays. Each slice of the array along axis=0 should be a different photometric band, with the same shape and alignment as the signal and noise arrays.

signalArrayLike

A 2D array containing the signal to be binned.

noiseArrayLike

A 2D array containing the associated noise.

target_snfloat, 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.

maskArrayLike | None, optional

Values in the input signal and noise to mask out, i.e. where mask==True will not be included in the binned data.

**kwargsdict, optional

A catch-all for additional parameters not relevant for this binning scheme.

Returns:
bin_labelsArrayLike

A 2D int array, containing the bin label assigned to each element of the input arrays.

nbinsint

The number of bins.

binned_s_nArrayLike

A 1D array of length nbins, containing the S/N in each bin.

bin_invArrayLike

A 2D array performing the inverse binning operation, i.e. binned_s_n[inv] gives an array of the same shape as x.