Usage for listPhaseSolutions

Return to directory of Todd's CASA extensions

This function is useful for examining the phase solutions of a self-cal table to identify antennas with the largest phase discrepancies from zero, and hence those antennas which may be misbehaving or have a position error. See also plotPhaseSolutions which calls this function.


    au.listPhaseSolutions(caltable='', sort='value', threshold=0.0)
  • sort: 'value', 'name', or 'id' (default='value')
    • 'value': sort by absolute magnitude of the phase
    • 'name': sort by antenna name
    • 'id': sort by antenna ID (often the same as name)
  • threshold: optional, only show phases with an absolute value larger than this (degrees, default=0)
  • phasecal: optional, the field ID or name of the phase calibrator (scalar or list)

Returns a dictionary of the format:
      'MSName': ms,
      'target': target_name, 
      'phasecal': phase_calibrator_name,  (only provided if phasecal is specified on command-line)
      'timestamps': [{'mjdsec': value, 'antennas':['DA45',...],
                         'phases':[10.3,...], 'medianphase':3.2, 'percentile25':6.0, 'percentile75':15.0, 'percentile':4.5,
                         'meanphase':2.4, 'maxphase':8.0, 'stdphase':1.3, 'madphase':3.2},
   where antennas are string names, phases are in degrees, and separation is in degrees
   percentile = half of the difference between percentile75 and percentile25, i.e. useful for plotting error bars

Example for a single source with single solution interval:

CASA <49>: au.listPhaseSolutions('selfp1_SPT2311-54', threshold=10)
fieldID = 4
target = 23:11:24.26000, -054:50:32.800000
Time = 4851555000.513961 = 2012-08-13 06:10:01 UT
 1 DA42  +10.066 
11 DV10  -11.328 
23 PM02  +38.007 
{'MSName': '',
 'target': 'SPT2311-54',
 'timestamps': [{'antennas': ['DA42', 'DV10', 'PM02'],
                 'madphase': 1.8705743779963402,
                 'maxphase': 38.007002095560289,
                 'meanphase': 19.800293441062248,
                 'medianphase': 11.327790322792493,
                 'mjdsec': 4851555000.5139608,
                 'percentile': 6.9852285476815803,
                 'percentile25': 10.696939113813228,
                 'percentile75': 24.667396209176388,
                 'phases': [10.066087904833962,
                 'stdphase': 12.884387277378282}]}

Example for a series of sources each with a single solution interval:

For each antenna, this example counts the number of sources on which it has exceeded the threshold.
import numpy
antennas = []
brightfields = ['SPT2311-54','SPT2319-55','SPT2340-59','SPT2349-56']
for field in brightfields:
    d = au.listPhaseSolutions('selfp1_%s'%field, threshold=20)
    antennas += d['timestamps'][0]['antennas']

for ant in numpy.unique(antennas):
    print "%s: %d" % (ant, antennas.count(ant))

-- ToddHunter - 2012-09-05
Topic revision: r6 - 2012-10-10, 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