Skip to content

Commit

Permalink
More robust with missing stations
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarcote committed Dec 19, 2022
1 parent 458cb4e commit e2c3aa2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions evn_postprocess/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,11 @@ def get_setup_from_ms(self):
ant_subband[antenna_name].add(spw)

for antenna_name in self.antennas.names:
a_pass.antennas[antenna_name].subbands = tuple(ant_subband[antenna_name])
a_pass.antennas[antenna_name].observed = len(a_pass.antennas[antenna_name].subbands) > 0
try:
a_pass.antennas[antenna_name].subbands = tuple(ant_subband[antenna_name])
a_pass.antennas[antenna_name].observed = len(a_pass.antennas[antenna_name].subbands) > 0
except ValueError:
print(f"Antenna {antenna_name} in list not present in {a_pass.msfile}.")

# Takes the predefined "best" antennas as reference
if len(self.refant) == 0:
Expand All @@ -829,8 +832,11 @@ def get_setup_from_ms(self):
print(f"WARNING: {a_pass.msfile} not found.")

for antenna_name in self.antennas.names:
self.antennas[antenna_name].observed = any([cp.antennas[antenna_name].observed \
for cp in self.correlator_passes])
try:
self.antennas[antenna_name].observed = any([cp.antennas[antenna_name].observed \
for cp in self.correlator_passes])
except ValueError:
print(f"Antenna {antenna_name} in list not present in {a_pass.msfile}.")

def parse_expsum(self):
"""Parses the .expsum file associated to the experiment to get different
Expand Down

0 comments on commit e2c3aa2

Please sign in to comment.