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 (
Quantity) – The position values.vel (
Quantity) – The velocity values.label (
Union[_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]]]) – 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[_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]],None]) – The measurement error for each label value.units (
Optional[UnitSystem]) – The unit system to work in.s (
Optional[float]) – The intrinsic scatter of label values within each pixel. If not provided, this will be estimated from the data.s_N_thresh (
Optional[int]) – If the intrinsic scattersis 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: