Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option for z_truth to be inside an hdf5 group #94

Merged
merged 6 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/rail/evaluation/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Evaluator(RailStage):
nzbins=Param(int, 301, msg="# of bins in zgrid"),
pit_metrics=Param(str, 'all', msg='PIT-based metrics to include'),
point_metrics=Param(str, 'all', msg='Point-estimate metrics to include'),
hdf5_groupname=Param(str, '', msg='Name of group in hdf5 where redshift data is located'),
do_cde=Param(bool, True, msg='Evaluate CDE Metric'),
redshift_col=SHARED_PARAMS)
inputs = [('input', QPHandle),
Expand Down Expand Up @@ -79,7 +80,12 @@ def run(self):
"""

pz_data = self.get_data('input')
z_true = self.get_data('truth')[self.config.redshift_col]
if self.config.hdf5_groupname: # pragma: no cover
specz_data = self.get_data('truth')[self.config.hdf5_groupname]
else:
specz_data = self.get_data('truth')
z_true = specz_data[self.config['redshift_col']]

zgrid = np.linspace(self.config.zmin, self.config.zmax, self.config.nzbins+1)

# Create an instance of the PIT class
Expand Down
Loading