Skip to content

Commit

Permalink
find_refant includes case of missing/flagged antenna.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoldon committed Sep 25, 2017
1 parent 489230d commit e262761
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions functions/eMERLIN_CASA_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,13 @@ def find_refant(msfile, field, antennas='', spws='', scan=''):
snrj = []
for basel in antennas:
if basel != anten:
d2 = visstat(msfile, antenna='{}&{}'.format(anten, basel),
field=field, axis='amplitude', scan=scan,
spw=str(spw)+channels, correlation=corr)
snrj.append(d2['DATA']['median']/d2['DATA']['stddev'])
try:
d2 = visstat(msfile, antenna='{}&{}'.format(anten, basel),
field=field, axis='amplitude', scan=scan,
spw=str(spw)+channels, correlation=corr)
snrj.append(d2['DATA']['median']/d2['DATA']['stddev'])
except:
snrj.append(0.0)
snr[i, j, k] = np.mean(snrj)

# Sorting antennas by average S/N, averaged in polarization and spw.
Expand Down

0 comments on commit e262761

Please sign in to comment.