nflag['color'] = readict[flag['reason']]['color']
nflag['offset'] = readict[flag['reason']]['offset']
plotflagperant[flag['antenna']].append(nflag)
nplotted = sum(len(x) for x in plotflagperant.values())
casalog.post('Plotted %d flags' % nplotted)
# maximum number of antennas per plot page (CAS-5187)
if len(myants) <= antlimit:
_plotants(figs[0], plotflagperant, myants, readict)
# prefer DA on first page
da = [x for x in myants if ('DA' in x) or ('CM' in x)]
no_da = [x for x in myants if x not in da]
# but limit to 28 antennas per figure
no_da.extend(da[antlimit:])
_plotants(figs[-1], plotflagperant, da, readict)
# stuff the rest on other figures
_plotants(figs[-1], plotflagperant, no_da[:antlimit], readict)
figs[0].savefig(plotname, dpi=150)
filenames.append(plotname)