Skip to content

Commit 64758c0

Browse files
committed
Save detector response modifications to SampleSet.info.
1 parent 20f1fc8 commit 64758c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

riid/data/synthetic/seed.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ def generate(self, config: Union[str, dict],
116116
pcf_abs_path = source_injector.generate(s, rel_output_path, verbose=verbose)
117117
seeds_ss = read_pcf(pcf_abs_path)
118118
# Manually set distance_cm so it works with expanded configs
119-
seeds_ss.info["distance_cm"] = s["gamma_detector"]["parameters"]["distance_cm"]
119+
seeds_ss.info["distance_cm"] = new_detector_parameters["distance_cm"]
120+
seeds_ss.info["height_cm"] = new_detector_parameters["height_cm"]
121+
for k, v in new_detector_parameters.items():
122+
if k not in DETECTOR_PARAMS or k.startswith("ECAL"):
123+
# e-cal info will come from the PCF
124+
continue
125+
seeds_ss.info[k.lower()] = v
120126
if not normalize_sources:
121127
seeds_ss.sources *= seeds_ss.spectra.sum(axis=1).values
122128
source_list.append(seeds_ss)

0 commit comments

Comments
 (0)