Skip to content

Commit

Permalink
Merge pull request #56 from psheehan/apriori_flagged_spws_john_main
Browse files Browse the repository at this point in the history
Better handle cases where spws are flagged a priori
  • Loading branch information
jjtobin authored Aug 12, 2024
2 parents 00ed057 + d8b8343 commit 60ea71f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions selfcal_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3096,6 +3096,13 @@ def get_flagged_solns_per_spw(spwlist,gaintable,extendpol=False):
nunflagged = [tb.calc('[select from '+gaintable+' where SPECTRAL_WINDOW_ID=='+\
spwlist[i]+' giving [nfalse(FLAG)]]')['0'].sum() for i in \
range(len(spwlist))]

nflags = np.array(nflags)
nunflagged = np.array(nunflagged)

nodata = np.where(nflags + nunflagged == 0)
nflags[nodata] = (nflags + nunflagged).max()

os.system('rm -rf tempgaintable.g')
fracflagged=np.array(nflags)/(np.array(nflags)+np.array(nunflagged))
# Calculate a score based on those two.
Expand Down

0 comments on commit 60ea71f

Please sign in to comment.