def stats_flag(ms, spw='', field=''): """ Print (and return) the falg statistics """ from casa import agentflagger as af af.open(ms) af.selectdata(field=field, spw=spw) agentSummary={'mode':'summary'} af.parseagentparameters(agentSummary) af.init() summary = af.run() af.done() del af array_flag = summary['report0']['array']['0'] logging.info("Flag percentage: " + str(array_flag['flagged']/array_flag['total']*100.) + "%") return summary
def stats_flag(ms, spw='', field=''): """ Print (and return) the falg statistics """ from casa import agentflagger as af af.open(ms) af.selectdata(field=field, spw=spw) agentSummary = {'mode': 'summary'} af.parseagentparameters(agentSummary) af.init() summary = af.run() af.done() del af array_flag = summary['report0']['array']['0'] logging.info("Flag percentage: " + str(array_flag['flagged'] / array_flag['total'] * 100.) + "%") return summary
def _get_good(self): from casa import agentflagger as af af.open(self.vis) af.selectdata(field=self.field, spw=self.spw, intent=self.intent) agentSummary = {'mode': 'summary'} af.parseagentparameters(agentSummary) af.init() summary = af.run() af.done() del af # Calculate the number of good data for each antenna and return # them antenna = summary['report0']['antenna'] good = dict() for a in antenna.keys(): good[a] = antenna[a]['total'] - antenna[a]['flagged'] return good
def _get_good(self): from casa import agentflagger as af af.open(self.vis) af.selectdata(field=self.field, spw=self.spw, intent=self.intent) agentSummary={'mode':'summary'} af.parseagentparameters(agentSummary) af.init() summary = af.run() af.done() del af # Calculate the number of good data for each antenna and return # them antenna = summary['report0']['antenna'] good = dict() for a in antenna.keys(): good[a] = antenna[a]['total'] - antenna[a]['flagged'] return good