Skip to content

Commit

Permalink
Added summarize() method overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Jul 22, 2024
1 parent 91185f1 commit 5d5786a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/rail/estimation/algos/naive_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,28 @@ def _setup_iterator(self):
else:
mask = d['class_id'] == self.config.selected_bin
yield start, end, pz_data, mask

def summarize(self, input_data, tomo_bins):
"""Override the Summarizer.summarize() method to take tomo bins
as an additional input
Parameters
----------
input_data : `qp.Ensemble`
Per-galaxy p(z), and any ancilary data associated with it
tomo_bins : `table-like`
Tomographic bins file
Returns
-------
output: `qp.Ensemble`
Ensemble with n(z), and any ancilary data
"""
self.set_data("input", input_data)
self.set_data("tomography_bins", tomo_bins)
self.run()
self.finalize()
return self.get_handle("output")


25 changes: 25 additions & 0 deletions src/rail/estimation/algos/point_est_hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,28 @@ def _setup_iterator(self):
else:
mask = d['class_id'] == self.config.selected_bin
yield start, end, pz_data, mask

def summarize(self, input_data, tomo_bins):
"""Override the Summarizer.summarize() method to take tomo bins
as an additional input
Parameters
----------
input_data : `qp.Ensemble`
Per-galaxy p(z), and any ancilary data associated with it
tomo_bins : `table-like`
Tomographic bins file
Returns
-------
output: `qp.Ensemble`
Ensemble with n(z), and any ancilary data
"""
self.set_data("input", input_data)
self.set_data("tomography_bins", tomo_bins)
self.run()
self.finalize()
return self.get_handle("output")


0 comments on commit 5d5786a

Please sign in to comment.