Source
xxxxxxxxxx
casalogPost(debug, "%s, Pol %d, spw %2d, %s, amp: %4d points exceed %.1f sigma (worst=%.2f at chan %d)" % (Antstring, p, ispw, utstring(uniqueTimes[mytime],0), gamp_mad[p]['nchan'], madsigma, gamp_mad[p]['outlierValue'], gamp_mad[p]['outlierChannel']+pchannels[p][0]))
#########################################################################
#
# task_plotbandpass.py
#
# Developed at the NAASC, this is a generic task to display CASA Tsys and
# bandpass solution tables with options to overlay them in various
# combinations, and/or with an atmospheric transmission or sky temperature
# model. It works with both the 'new' (casa 3.4) and 'old' calibration
# table formats, and allows for mixed mode spws (e.g. TDM and FDM for ALMA).
# It uses the new msmd tool to access the information about an ms.
#
# Todd R. Hunter February 2013
#
# To test: see plotbandpass_regression.py
#
PLOTBANDPASS_REVISION_STRING = "$Id: task_plotbandpass.py,v 1.102 2018/01/21 14:45:41 thunter Exp $"
import pylab as pb
import math, os, sys, re
import time as timeUtilities
import numpy as np
import re # used for testing if a string is a float
# import casadef # necessary to read the casa version strings, but only in pre-CASA 5.0
from taskinit import * # necessary for tb.open() to work
from matplotlib.ticker import MultipleLocator, FormatStrFormatter, ScalarFormatter
import matplotlib.transforms
import inspect
TOP_MARGIN = 0.25 # Used if showatm=T or showtksy=T
BOTTOM_MARGIN = 0.25 # Used if showfdm=T
MAX_ATM_CALC_CHANNELS = 512
markeredgewidth=0.0
# This is a color sequence found online which has distinguishable colors
overlayColors = [
[0.00, 0.00, 0.00],
[0.00, 0.00, 1.00],
[0.00, 0.50, 0.00],
[1.00, 0.00, 0.00],
[0.00, 0.75, 0.75],
# [0.75, 0.00, 0.75], # magenta, same as atmcolor
[0.25, 0.25, 0.25],
[0.75, 0.25, 0.25],
[0.95, 0.95, 0.00],
[0.25, 0.25, 0.75],
# [0.75, 0.75, 0.75], this color is invisible for some reason
[0.00, 1.00, 0.00],
[0.76, 0.57, 0.17],
[0.54, 0.63, 0.22],
[0.34, 0.57, 0.92],
[1.00, 0.10, 0.60],
# [0.88, 0.75, 0.73], invisible
[0.10, 0.49, 0.47],
[0.66, 0.34, 0.65],
[0.99, 0.41, 0.23]]
overlayColors += overlayColors + overlayColors # 17*3 = 51 total colors
overlayColors += overlayColors + overlayColors # try to support antenna,time
overlayColors += overlayColors + overlayColors # try to support antenna,time
overlayColors += overlayColors + overlayColors # try to support antenna,time
overlayColors += overlayColors + overlayColors # try to support antenna,time
# Enumeration to keep track of plot pages
PAGE_ANT = 0
PAGE_SPW = 1
PAGE_TIME = 2
PAGE_AP = 3
# Used to parse command line arguments
myValidCharacterList = ['~', ',', ' ', '*',] + [str(m) for m in range(10)]
myValidCharacterListWithBang = ['~', ',', ' ', '*', '!',] + [str(m) for m in range(10)]
LARGE_POSITIVE = +1e20
LARGE_NEGATIVE = -1e20
maxAntennaNamesAcrossTheTop = 17
maxTimesAcrossTheTop = 13 # 17 for HH:MM, reduced by 1 below for subplot=11
antennaVerticalSpacing = 0.018 # 0.016
antennaHorizontalSpacing = 0.05
xstartTitle = 0.07
ystartTitle = 0.955
xstartPolLabel = 0.05
ystartOverlayLegend = 0.933
opaqueSky = 270. # Kelvin, used for scaling TebbSky
developerEmail = "thunter@nrao.edu"
#class Polarization:
# taken from Stokes.h in casa, for reference only
# (Undefined, I,Q,U,V,RR,RL,LR,LL,XX,XY,YX,YY) = range(13)
def version(showfile=True):
"""
Returns the CVS revision number.