rail.estimation.algos.true_nz module
A summarizer-like stage that simple makes a histogram the true nz
- class rail.estimation.algos.true_nz.TrueNZHistogrammer
Bases:
RailStageSummarizer-like stage which simply histograms the true redshift
- 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.
zmin ([float] default=0.0) – The minimum redshift of the z grid or sample
zmax ([float] default=3.0) – The maximum redshift of the z grid or sample
nzbins ([int] default=301) – The number of gridpoints in the z grid
redshift_col ([str] default=redshift) – name of redshift column
selected_bin ([int] default=-1) – Which tomography bin to consider
chunk_size ([int] default=10000) – Number of objects per chunk for parallel processing or to evalute per loop in single node processing
hdf5_groupname ([str] default=photometry) – name of hdf5 group for data, if None, then set to ‘’
input (TableHandle (INPUT))
tomography_bins (TableHandle (INPUT))
true_NZ (QPHandle (OUTPUT))
- __init__(args, **kwargs)
Constructor: Do RailStage specific initialization
- Parameters:
args (Any)
kwargs (Any)
- Return type:
None
- entrypoint_function: str | None = 'histogram'
- histogram(catalog, tomo_bins, **kwargs)
The main interface method for
TrueNZHistogrammer.Creates histogram of N of Z_true.
This will attach the sample to this Stage (for introspection and provenance tracking).
Then it will call the run() and finalize() methods, which need to be implemented by the sub-classes.
The run() method will need to register the data that it creates to this Estimator by using
self.add_data('output', output_data).Finally, this will return a PqHandle providing access to that output data.
- Parameters:
catalog (TableLike) – The sample with the true NZ column
tomo_bins (TableLike) – Tomographic bin assignemnets
- Returns:
A handle giving access to a the histogram in QP format
- Return type:
- inputs = [('input', <class 'rail.core.data.TableHandle'>), ('tomography_bins', <class 'rail.core.data.TableHandle'>)]
- interactive_function: str | None = 'true_nz_histogrammer'
- name = 'TrueNZHistogrammer'
- outputs = [('true_NZ', <class 'rail.core.data.QPHandle'>)]
- run()
Run the stage and return the execution status.
Subclasses must implemented this method.
- Return type:
None