Skip to content

Commit

Permalink
explicitly deal with non-finite metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdillon committed Feb 18, 2021
1 parent bc20859 commit 2fddde2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hera_qm/ant_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ def iterative_antenna_metrics_and_flagging(self, crossCut=0, deadCut=0.4, verbos
worstCrossCutDiff = 1

# Find most likely dead/crossed antenna
deadMetrics = self.all_metrics[iteration]['corr']
crossMetrics = self.all_metrics[iteration]['corrXPol']
deadMetrics = {ant: metric for ant, metric in self.all_metrics[iteration]['corr'].items() if np.isfinite(metric)}
crossMetrics = {ant: np.max(metric) for ant, metric in self.all_metrics[iteration]['corrXPol'].items() if np.isfinite(metric)}
if (len(deadMetrics) == 0) or (len(crossMetrics) == 0):
break # no unflagged antennas remain
worstDeadAnt = min(deadMetrics, key=deadMetrics.get)
Expand Down

0 comments on commit 2fddde2

Please sign in to comment.