get_binned_label#

torusimaging.data.get_binned_label(pos, vel, label, bins, moment='mean', label_err=None, units=None, s=None, s_N_thresh=128)#

Bin the data in pixels of phase-space coordinates (pos, vel) and return the mean (or other moment) of the label values in each pixel.

Parameters:
  • pos (Annotated[Quantity]) – The position values.

  • vel (Annotated[Quantity]) – The velocity values.

  • label (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], complex, bytes, str, _NestedSequence[complex | bytes | str]]) – The label values.

  • bins (dict[str, Quantity] | tuple) – A specification of the bins. This can either be a tuple, where the order is assumed to be (pos, vel), or a dictionary with keys “pos” and “vel”.

  • moment (str) – The type of moment to compute. Currently only supports “mean”.

  • label_err (Union[_Buffer, _SupportsArray[dtype[Any]], _NestedSequence[_SupportsArray[dtype[Any]]], complex, bytes, str, _NestedSequence[complex | bytes | str], None]) – The measurement error for each label value.

  • units (UnitSystem | None) – The unit system to work in.

  • s (float | None) – The intrinsic scatter of label values within each pixel. If not provided, this will be estimated from the data.

  • s_N_thresh (int | None) – If the intrinsic scatter s is not specified, this sets the threshold for the number of objects per bin required to estimate the intrinsic scatter.

Returns:

Keys are “pos”, “vel”, “counts”, “label”, and “label_err”.

Return type:

dict