diff --git a/pyV2DL3/vegas/EffectiveAreaFile.py b/pyV2DL3/vegas/EffectiveAreaFile.py index 643b662..dcc40f6 100644 --- a/pyV2DL3/vegas/EffectiveAreaFile.py +++ b/pyV2DL3/vegas/EffectiveAreaFile.py @@ -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) diff --git a/pyV2DL3/vegas/VegasDataSource.py b/pyV2DL3/vegas/VegasDataSource.py index 5a78178..69391b6 100644 --- a/pyV2DL3/vegas/VegasDataSource.py +++ b/pyV2DL3/vegas/VegasDataSource.py @@ -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) @@ -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__ ) ) diff --git a/pyV2DL3/vegas/fillRESPONSE_not_safe.py b/pyV2DL3/vegas/fillRESPONSE_not_safe.py index 4b7511c..708c654 100644 --- a/pyV2DL3/vegas/fillRESPONSE_not_safe.py +++ b/pyV2DL3/vegas/fillRESPONSE_not_safe.py @@ -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