Skip to content

Commit

Permalink
Remove check_for_good_ant usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MijnheerD committed Nov 29, 2024
1 parent 49c73b6 commit 055040f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions NuRadioReco/modules/LOFAR/planeWaveDirectionFitter_LOFAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from NuRadioReco.modules.base.module import register_run
from NuRadioReco.modules.LOFAR.beamforming_utilities import geometric_delay_far_field, lightspeed

from NuRadioReco.modules.LOFAR.pipelineVisualizer_LOFAR import check_for_good_ant


def average_direction(event, detector, mode='normal'):
"""
Expand All @@ -30,7 +28,8 @@ def average_direction(event, detector, mode='normal'):
detector : Detector object
The detector for which to calculate the average direction.
mode : str, default='normal'
The mode to use for the calculation. Can be 'normal' (just raw mean) or 'weighted' (with number of good antennas as weight per station).
The mode to use for the calculation. Can be 'normal' (just raw mean) or 'weighted'
(with number of good antennas as weight per station).
Returns
-------
Expand All @@ -42,10 +41,12 @@ def average_direction(event, detector, mode='normal'):
zeniths = []
azimuths = []
num_good_antennas = []
good_antennas = check_for_good_ant(event, detector)
for station in event.get_stations():
if station.get_parameter(stationParameters.triggered):
num_good_antennas.append(len(good_antennas[station.get_id()]))
flagged_channels = station.get_parameter(stationParameters.flagged_channels)
num_good_antennas.append(
detector.get_number_of_channels(station.get_id()) - len(flagged_channels)
)
zeniths.append(station.get_parameter(stationParameters.cr_zenith))
azimuths.append(station.get_parameter(stationParameters.cr_azimuth))

Expand Down

0 comments on commit 055040f

Please sign in to comment.