rail.estimation.algos.naive_stack module

A summarizer that simple makes a histogram of a point estimate

class rail.estimation.algos.naive_stack.NaiveStackInformer

Bases: PzInformer

Placeholder Informer

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.

  • hdf5_groupname ([str] default=photometry) – name of hdf5 group for data, if None, then set to ‘’

  • chunk_size ([int] default=10000) – Number of objects per chunk for parallel processing or to evalute per loop in single node processing

  • input (QPHandle (INPUT))

  • truth (TableHandle (INPUT))

  • model (ModelHandle (OUTPUT))

entrypoint_function: str | None = 'inform'
interactive_function: str | None = 'naive_stack_informer'
name = 'NaiveStackInformer'
class rail.estimation.algos.naive_stack.NaiveStackMaskedSummarizer

Bases: NaiveStackSummarizer

Stage NaiveStackMaskedSummarizer

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.

  • chunk_size ([int] default=10000) – Number of objects per chunk for parallel processing or to evalute per loop in single node processing

  • 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

  • seed ([int] default=87) – random seed

  • n_samples ([int] default=1000) – Number of sample distributions to create

  • selected_bin ([int] default=-1) – bin to use

  • input (QPHandle (INPUT))

  • tomography_bins (TableHandle (INPUT))

  • output (QPHandle (OUTPUT))

  • single_NZ (QPHandle (OUTPUT))

entrypoint_function: str | None = 'summarize'
inputs = [('input', <class 'rail.core.data.QPHandle'>), ('tomography_bins', <class 'rail.core.data.TableHandle'>)]
interactive_function: str | None = 'naive_stack_masked_summarizer'
name = 'NaiveStackMaskedSummarizer'
outputs = [('output', <class 'rail.core.data.QPHandle'>), ('single_NZ', <class 'rail.core.data.QPHandle'>)]
summarize(input_data, tomo_bins=None, **kwargs)

Override the Summarizer.summarize() method to take tomo bins as an additional input

Parameters:
  • input_data (qp.Ensemble) – Per-galaxy p(z), and any ancillary data associated with it

  • tomo_bins (TableLike | None, optional) – Tomographic bins file, by default None

Returns:

Ensemble with n(z), and any ancillary data

Return type:

QPHandle

class rail.estimation.algos.naive_stack.NaiveStackSummarizer

Bases: PZSummarizer

Summarizer which stacks individual P(z)

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.

  • chunk_size ([int] default=10000) – Number of objects per chunk for parallel processing or to evalute per loop in single node processing

  • 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

  • seed ([int] default=87) – random seed

  • n_samples ([int] default=1000) – Number of sample distributions to create

  • input (QPHandle (INPUT))

  • output (QPHandle (OUTPUT))

  • single_NZ (QPHandle (OUTPUT))

__init__(args, **kwargs)

Constructor: Do RailStage specific initialization

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

None

entrypoint_function: str | None = 'summarize'
inputs = [('input', <class 'rail.core.data.QPHandle'>)]
interactive_function: str | None = 'naive_stack_summarizer'
name = 'NaiveStackSummarizer'
outputs = [('output', <class 'rail.core.data.QPHandle'>), ('single_NZ', <class 'rail.core.data.QPHandle'>)]
run()

Run the stage and return the execution status.

Subclasses must implemented this method.

Return type:

None

summarize(input_data, **kwargs)

Summarizer for NaiveStack which returns multiple items

Parameters:

input_data (qp.Ensemble) – Per-galaxy p(z), and any ancillary data associated with it

Returns:

Ensemble with n(z), and any ancillary data Return type depends on output_mode

Return type:

QPHandle | dict[str, QPHandle]