OneDSlicer

class rubin_sim.maf.slicers.OneDSlicer(slice_col_name=None, slice_col_units=None, bins=None, bin_min=None, bin_max=None, bin_size=None, verbose=True, badval=0)

Bases: BaseSlicer

OneD Slicer allows the ‘slicing’ of data into bins in a single dimension.

Parameters:
slice_col_namestr

The name of the data column to base slicing on (i.e. ‘airmass’, etc.)

slice_col_unitsstr, optional

Set a name for the units of the sliceCol. Used for plotting labels. Default None.

binsnp.ndarray, optional

The data will be sliced into ‘bins’: this can be defined as an array here. Default None.

bin_minfloat, optional
bin_maxfloat, optional
bin_sizefloat, optional

If bins is not defined, then bin_min/bin_max/bin_size can be chosen to anchor the slice points. Default None. Priority goes: bins >> bin_min/bin_max/bin_size >> data values (if none of the above are chosen).

All bins except for the last bin are half-open ([a, b)) while the last bin is ([a, b]).

Methods Summary

setup_slicer(sim_data[, maps])

Set up bins in slicer.

Methods Documentation

setup_slicer(sim_data, maps=None)

Set up bins in slicer. This happens AFTER sim_data is defined, thus typically in the MetricBundleGroup. This maps data into the bins; it’s not a good idea to reuse a OneDSlicer as a result.