Skip to content

Commit

Permalink
Fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
fschlueter committed Feb 17, 2025
1 parent 1eef9b8 commit d312f3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NuRadioReco/framework/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,22 @@ def iter_modules(self, station_id=None):
iE += 1
yield self.__modules_event[iE - 1]

def has_been_processed_by_module(self, module_name):
def has_been_processed_by_module(self, module_name, station_id):
"""
Checks if the event has been processed by a module with a specific name.
Parameters
----------
module_name: str
The name of the module to check for.
station_id: int
The station id for which the module is run.
Returns
-------
bool
"""
for module in self.__modules_event:
for module in self.iter_modules(station_id):
if module[0] == module_name:
return True

Expand Down
2 changes: 1 addition & 1 deletion NuRadioReco/modules/RNO_G/hardwareResponseIncorporator.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def run(self, evt, station, det, temp=293.15, sim_to_data=False, phase_only=Fals
trace_fft, channel.get_sampling_rate())

if not sim_to_data:
if not evt.has_been_processed_by_module('channelAddCableDelay'):
if not evt.has_been_processed_by_module('channelAddCableDelay', station.get_id()):
self.logger.warning(
"The hardwareResponseIncorporator module should be used to remove the cable delay "
"from data anymore. Please use channelAddCableDelay module for this (before running "
Expand Down
1 change: 1 addition & 0 deletions NuRadioReco/modules/base/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def register_run_method(self, *args, **kwargs):
store_kwargs[key] = value
except (TypeError, AttributeError): # object couldn't be pickled - we store the error instead
store_kwargs[key] = TypeError(f"Argument of type {type(value)} could not be serialized")

if station is not None:
module_level = "station"
elif evt is not None:
Expand Down

0 comments on commit d312f3e

Please sign in to comment.