hexbin#

niriss_tools.sed.hexbin(x, y, signal, noise, bin_diameter=10, centre=None)[source]#

Hexagonally bin data, returning the binned S/N.

Parameters:
xArrayLike

A 1D array containing the x-positions of the data.

yArrayLike

A 1D array containing the y-positions of the data.

signalArrayLike

A 1D array of the signal.

noiseArrayLike

A 1D array of the noise. All of signal, noise, x, and y must have the same shape.

bin_diameterfloat, optional

The minimum diameter of each bin (subject to pixel discretisation effects), i.e. the long diameter of each hexagon. By default 10.

centretuple[float, float] | None, optional

If given, all bins will be aligned such that a hexagon is centred on these coordinates. If not given, the highest S/N pixel will be used instead.

Returns:
bin_labelsArrayLike

The bin label assigned to each element of the input arrays.

nbinsint

The number of bins.

binned_s_nArrayLike

The S/N in each bin.

bin_invArrayLike

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