hexbin#
- niriss_tools.sed.hexbin(x, y, signal, noise, bin_diameter=10, centre=None)[source]#
Hexagonally bin data, returning the binned S/N.
- Parameters:
- x
ArrayLike A 1D array containing the x-positions of the data.
- y
ArrayLike A 1D array containing the y-positions of the data.
- signal
ArrayLike A 1D array of the signal.
- noise
ArrayLike A 1D array of the noise. All of
signal,noise,x, andymust have the same shape.- bin_diameter
float, optional The minimum diameter of each bin (subject to pixel discretisation effects), i.e. the long diameter of each hexagon. By default 10.
- centre
tuple[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.
- x
- Returns:
- bin_labels
ArrayLike The bin label assigned to each element of the input arrays.
- nbins
int The number of bins.
- binned_s_n
ArrayLike The S/N in each bin.
- bin_inv
ArrayLike A 1D array performing the inverse binning operation, i.e.
binned_s_n[inv]gives an array of the same shape asx.
- bin_labels