getFlagdict

Return to directory of Todd's CASA extensions

Calls either the older fg or the new agentflagger tool (default) to return a dictionary of the percentage of flagged data as a function of field, spw, array, scan, baseline, correlation, observation. The percentage of flagged points is computed and stuffed into the dictionary, which was a behavior requested in CAS-5108 but so far refused.

Usage:

import analyzemscal as amc
amc.getFlagdict(vis, tool=aftool, report='report0', field='', spw='', array='', 
               feed='', scan='', antenna='', uvrange='', correlation='', 
               intent='', observation='', percentOnly=False)
  • percentOnly: if True, then remove the 'flagged' and 'total' keys from the sub-dictionaries (af tool only)

Example:

CASA <35>: f = amc.getFlagdict('uid___A002_X8aad31_Xb4.ms')
CASA <36>: f.keys()
  Out[36]: 
['name',
 'antenna',
 'scan',
 'percent',
 'spw',
 'field',
 'correlation',
 'array',
 'total',
 'type',
 'flagged',
 'observation']

CASA <37>: f['spw']
  Out[37]: 
{'0': {'flagged': 0.0, 'percent': 0.0, 'total': 724752.0},
 '1': {'flagged': 0.0, 'percent': 0.0, 'total': 78597120.0},
 '10': {'flagged': 0.0, 'percent': 0.0, 'total': 29889300.0},
 '11': {'flagged': 0.0, 'percent': 0.0, 'total': 1912915200.0},
 '12': {'flagged': 0.0, 'percent': 0.0, 'total': 29889300.0},
 '13': {'flagged': 0.0, 'percent': 0.0, 'total': 1912915200.0},
 '14': {'flagged': 0.0, 'percent': 0.0, 'total': 29889300.0},
 '15': {'flagged': 0.0, 'percent': 0.0, 'total': 1912915200.0},
 '16': {'flagged': 0.0, 'percent': 0.0, 'total': 29889300.0},
 '2': {'flagged': 0.0, 'percent': 0.0, 'total': 614040.0},
 '3': {'flagged': 0.0, 'percent': 0.0, 'total': 78597120.0},
 '4': {'flagged': 0.0, 'percent': 0.0, 'total': 614040.0},
 '5': {'flagged': 0.0, 'percent': 0.0, 'total': 78597120.0},
 '6': {'flagged': 0.0, 'percent': 0.0, 'total': 614040.0},
 '7': {'flagged': 0.0, 'percent': 0.0, 'total': 78597120.0},
 '8': {'flagged': 0.0, 'percent': 0.0, 'total': 614040.0},
 '9': {'flagged': 0.0, 'percent': 0.0, 'total': 1912915200.0}}

CASA <38>: f['spw']['0']
  Out[38]: {'flagged': 0.0, 'percent': 0.0, 'total': 724752.0}

-- ToddHunter - 2014-09-04

This topic: ALMA > TWikiUsers > ToddHunter > CasaExtensions > GetFlagdict
Topic revision: 2014-09-16, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback