Skip to content

Commit

Permalink
Fix st6 options parsings.
Browse files Browse the repository at this point in the history
  • Loading branch information
deividribeiro committed Oct 6, 2023
1 parent abf12b1 commit 908e775
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions pyV2DL3/vegas/EffectiveAreaFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ def get_safe_energy(self, az, ze, noise, offset=0.5, st6_configs=None):
)
minEnergy, maxEnergy = c_float(), c_float()
split_configs = {
opt.split()[0]: opt.split()[1] for opt in st6_configs if st6_configs is not None
opt.split(" ")[0]: opt.split(" ")[1] for opt in st6_configs if st6_configs is not None
}
if "EA_SafeEnergyRangeMethod" in split_configs.keys():
safe_energy_method = split_configs["EA_SafeEnergyRangeMethod"]
ea_uncertainty = split_configs["EA_MaxEffectiveAreaUncertainty"]
energy_bias = split_configs["EA_MaxAllowedEnergyBias"]
safe_energy_method = str(split_configs["EA_SafeEnergyRangeMethod"])
ea_uncertainty = float(split_configs["EA_MaxEffectiveAreaUncertainty"])
energy_bias = float(split_configs["EA_MaxAllowedEnergyBias"])
logger.debug(
f"Loaded st6 options EA_SafeEnergyRangeMethod: {safe_energy_method}, EA_MaxEffectiveAreaUncertainty: {ea_uncertainty}, EA_MaxAllowedEnergyBias: {energy_bias}"
)
self.manager.setOption("EA_SafeEnergyRangeMethod", safe_energy_method)
self.manager.setOption("EA_MaxEffectiveAreaUncertainty", ea_uncertainty)
self.manager.setOption("EA_MaxAllowedEnergyBias", energy_bias)
Expand Down
4 changes: 2 additions & 2 deletions pyV2DL3/vegas/VegasDataSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __fill_evt__(self):
save_msw_msl=self.__save_msw_msl__,
corr_EB=self.__corr_EB_params__,
psf_king_params=self.__psf_king_params__,

st6_configs=self.__st6_configs__
)
self.__gti__ = gti
# This is an array of dicts for each event class (array of one when not using event class mode)
Expand All @@ -92,7 +92,7 @@ def __fill_response__(self):
nn,
self.__irf_to_store__,
psf_king_params=self.__psf_king_params__,
st6_configs = self.__st6_configs__
st6_configs=self.__st6_configs__
)
)

Expand Down
2 changes: 1 addition & 1 deletion pyV2DL3/vegas/fillRESPONSE_not_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __fillRESPONSE_not_safe__(
irf_to_store["point-like"],
psf_king_params=psf_king_params,
)
minEnergy, maxEnergy = effective_area_file.get_safe_energy(azimuth, zenith, noise, st6_configs)
minEnergy, maxEnergy = effective_area_file.get_safe_energy(azimuth, zenith, noise, st6_configs=st6_configs)
response_dict["LO_THRES"] = minEnergy
response_dict["HI_THRES"] = maxEnergy

Expand Down

0 comments on commit 908e775

Please sign in to comment.