Source
print("-----------Not done because %.0f < %.0f-%d for fieldIndex=%d and <%.0f and scan%d not in scan[%d,%d] and t%d != t%d" % (uniqueTimes[mytime], uniqueTimesPerFieldPerSpw[ispwInCalTable][f][-1], solutionTimeThresholdSeconds, f, timerangeListTimes[-1],scansForUniqueTimes[mytime],scansForUniqueTimes[-1],scansToPlot[-1],mytime,timerangeList[-1]))
#########################################################################
#
# 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 copy
import matplotlib.transforms
import numpy as np
import pylab as pb
from casatasks import casalog
from casatasks.private import sdutil, simutil
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)
##------------------------------------------------------------------------------------------------------
##--- Increment the micro version number with each update to task_plotbandpass.py, adjust the major ---
##--- and minor version numbers to match the analysisUtils version that is last synced with... ---
##------------------------------------------------------------------------------------------------------
TASK_PLOTBANDPASS_REVISION_STRING = "2.20.0" #### incremented from 2.3.0 in 2024Aug
##------------------------------------------------------------------------------------------------------
##--- Update this version string whenever task_plotbandpass.py is synced with plotbandpass3.py from ---
##--- Todd's analysisUtils. This will allow for tracking efforts to keep the versions synced. ---
##------------------------------------------------------------------------------------------------------
PLOTBANDPASS_REVISION_STRING = "Id: plotbandpass3.py,v 2.20 2024/09/04 16:00:03 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
maxAltitude = 60 # for ozone, in km, this is the default value of the parameter in the analysisUtils version
# 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 = 34 total color entries
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time 34*3 =102
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time 102*3=306
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time 306*3=918
overlayColorsList += overlayColorsList + overlayColorsList # try to support antenna,time 918*3=2754 entries
# Enumeration to keep track of plot pages
PAGE_ANT = 0
PAGE_SPW = 1
PAGE_TIME = 2
PAGE_AP = 3