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
#
import inspect
import math
import os
import re # used for testing if a string is a float
import time
import matplotlib.transforms
import numpy as np
import pylab as pb
from casatasks import casalog
from casatools import (atmosphere, ctsys, measures, ms, msmetadata, quanta,
table)
from matplotlib.ticker import (FormatStrFormatter, MultipleLocator,
ScalarFormatter)
from six.moves import input, range
# CAS-13722, CAS-13385
import warnings
import matplotlib.cbook
warnings.filterwarnings("ignore",category=matplotlib.cbook.MatplotlibDeprecationWarning)
PLOTBANDPASS_REVISION_STRING = "$Id: task_plotbandpass.py,v 1.102 2018/01/21 14:45:41 thunter Exp $"
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
overlayColorsSequence = [
[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]]
overlayColorsList = overlayColorsSequence.copy()
overlayColorsList += overlayColorsList + overlayColorsList # 17*3 = 51 total colors
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time
overlayColorsList += overlayColorsList + overlayColorsList # 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