rail.creation.degraders.quantityCut module
Degrader that applies a cut to given columns.
- class rail.creation.degraders.quantityCut.QuantityCut
Bases:
SelectorDegrader that applies a cut to the given columns.
Note that if a galaxy fails any of the cuts on any one of its columns, that galaxy is removed from the sample.
- Parameters:
output_mode ([str] default=default) – What to do with the outputs. The options are ‘default’, where outputs will be written to files and some returned, and ‘return’, where outputs will only be returned and not written.
drop_rows ([bool] default=True) – Drop selected rows from output table
seed ([type not specified] default=None) – Set to an int to force reproducible results.
cuts ([dict] (required)) – Cuts to apply
input (PqHandle (INPUT))
output (PqHandle (OUTPUT))
- __init__(args, **kwargs)
Constructor.
Performs standard Degrader initialization as well as defining the cuts to be applied.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
None
- entrypoint_function: str | None = '__call__'
- interactive_function: str | None = 'quantity_cut'
- name = 'QuantityCut'
- set_cuts(cuts)
Defines the cuts to be applied.
- Parameters:
cuts (dict) – A dictionary of cuts to make on the data
- Return type:
None
Notes
The cut keys should be the names of columns you wish to make cuts on.
The cut values should be either: - a number, which is the maximum value. E.g. if the dictionary contains “i”: 25, then values of i > 25 are cut from the sample. - an iterable, which is the range of acceptable values. E.g. if the dictionary contains “redshift”: (1.5, 2.3), then redshifts outside that range are cut from the sample.