plotbandpass
- plotbandpass(caltable, antenna='', field='', spw='', yaxis='amp', xaxis='chan', figfile='', plotrange=[0, 0, 0, 0], caltable2='', overlay='', showflagged=False, timeranges='', buildpdf=False, caltable3='', markersize=3, density=108, interactive=True, showpoints='auto', showlines='auto', subplot='22', zoom='', poln='', showatm=False, pwv='auto', gs='gs', convert='convert', chanrange='', solutionTimeThresholdSeconds=30.0, debug=False, phase='', vis='', showtsky=False, showfdm=False, showatmfield='', lo1='', showimage=False, showatmpoints=False, parentms='', pdftk='pdftk', channeldiff=False, edge=8, resample=1, platformingThreshold=10.0, platformingSigma=10.0, basebands='', showBasebandNumber=False, scans='', figfileSequential=False, chanrangeSetXrange=False)[source]
Makes detailed plots of Tsys and bandpass solutions.
[Description] [Examples] [Development] [Details]
- Parameters
caltable (path) - Input table name, either a bandpass solution or a Tsys solution
antenna ({string, int, stringVec, intVec}=’’) - A comma-delimited string list of antennas (either names or integer indices) for which to display solutions. Default = all antennas.
field ({string, int, stringVec, intVec}=’’) - A comma-delimited string list of fields (either names or integer indices) for which to display solutions. Default = all fields.
spw ({string, int, stringVec, intVec}=’’) - A comma-delimited string list of spws for which to display solutions. Default = all spws.
yaxis (string=’amp’) - The quantity to plot on the y-axis (“amp”, “phase”, “both”, “tsys”, append “db” for dB).
yaxis = both
phase ({intVec, string}=’’) - The y-axis limits to use for phase plots when yaxis=”both”
xaxis (string=’chan’) - The quantity to plot on the x-axis (“chan” or “freq”).
xaxis = freq
chanrange ({string, intVec}=’’) - Set xrange (“5~100”) over which to autoscale y-axis for xaxis=”freq”
showfdm (bool=False) - when showing TDM spws, draw the locations of the corresponding FDM spws
chanrangeSetXrange (bool=False) - If True, then chanrange also sets the xrange to display
figfile (string=’’) - The name of the plot file to produce.
figfile != ''
density (int=108) - dpi to use in creating PNGs and PDFs (default=108)
buildpdf (bool=False) - If True, assemble all the pngs into a pdf
convert (string=’convert’) - For buildpdf=T, full path for the ImageMagick convert command (in case it is not found)
gs (string=’gs’) - For buildpdf=T, full path for ghostscript command (in case it is not found)
pdftk (string=’pdftk’) - For buildpdf=T, full path for pdftk command (in case it is not found)
plotrange (doubleVec=[0, 0, 0, 0]) - The axes limits to use [x0,x1,y0,y1].
caltable2 (string=’’) - A second cal table, of type BPOLY or B, to overlay on a B table
overlay (string=’’) - Show multiple solutions in same frame in different colors (time, antenna, spw, baseband, or time,antenna)
overlay = time
showatmfield ({int, string}=’’) - for overlay=”time”, use first observation of this fieldID or name
showflagged (bool=False) - Show the values of the solution, even if flagged
timeranges (string=’’) - Show only these timeranges, the first timerange being 0
markersize (int=3) - Size of points
interactive (bool=True) - if False, then run to completion automatically without pause
showpoints ({string, bool}=’auto’) - Draw points for the data (default=F for amp, T for phase)
showlines ({string, bool}=’auto’) - Draw lines connecting the data (default=T for amp, F for phase)
subplot ({string, int}=’22’) - 11..81,22,32 or 42 for RowsxColumns (default=22), any 3rd digit is ignored
poln ({stringVec, string}=’’) - Polarizations to plot: “” = all, or “RR”,”RL”,”LR”,”LL”,”XX”,”XY”,”YX”,”YY”,”RR,LL”,”XX,YY”
showatm (bool=False) - Compute and overlay the atmospheric transmission curve
showatm != False
pwv ({double, string}=’auto’) - Define the pwv to use for the showatm option: “auto” or value in mm
showimage (bool=False) - also show the atmospheric curve for the image sideband (in black)
parentms (string=’’) - if showimage=T, name of the parent ms (only needed if the ms has been previously split)
lo1 ({string, double}=’’) - specify the LO1 setting (in GHz) for the observation (’’ = automatic)
showatmpoints (bool=False) - Draw atmospheric curve with points instead of a line
solutionTimeThresholdSeconds (double=30.0) - Consider 2 solutions simultaneous if within this interval in seconds
debug (bool=False) - Print verbose messages for debugging purposes
vis (string=’’) - name of the ms for this table, in case it does not match the string in the caltable
showtsky (bool=False) - Compute and overlay the sky temperature curve instead of transmission
showtsky != False
pwv ({double, string}=’auto’) - Define the pwv to use for the showatm option: “auto” or value in mm
showimage (bool=False) - also show the atmospheric curve for the image sideband (in black)
parentms (string=’’) - if showimage=T, name of the parent ms (only needed if the ms has been previously split)
lo1 ({string, double}=’’) - specify the LO1 setting (in GHz) for the observation (’’ = automatic)
showatmpoints (bool=False) - Draw atmospheric curve with points instead of a line
channeldiff ({bool, double}=False) - Set to a value > 0 (sigma) to plot derivatives of the solutions
channeldiff != False
edge (int=8) - The number of edge channels to ignore in finding outliers (for channeldiff>0)
resample (int=1) - The channel expansion factor to use when computing MAD of derivative (for channeldiff>0)
platformingSigma (double=10.0) - declare platforming if the amplitude derivative exceeds this many times the MAD
platformingThreshold (double=10.0) - if platformingSigma=0, then declare platforming if the amplitude derivative exceeds this percentage of the median
basebands ({int, string, intVec}=’’) - A baseband number or list of baseband numbers for which to display solutions. Default = all.
showBasebandNumber (bool=False) - Put the baseband converter number (BBC_NO) in the title of each plot
scans ({int, string, intVec}=’’) - A scan or list of scans for which to display solutions. Default = all. Does not work with overlay=”time”.
figfileSequential (bool=False) - naming scheme for pngs: False: name by spw/antenna (default), True: figfile.000.png, figfile.001.png, etc.
- Description
This generic task was developed at the North American ALMA Science Center (NAASC). It displays T sys and bandpass solution tables with options to overlay them in various combinations, and/or with an atmospheric transmission or sky temperature model. It allows for mixed-mode spws (e.g., TDM and FDM for ALMA) and uses the msmd tool to access the information about an MS.
Note that the ability to compute and overlay an atmospheric transmission curve or a sky temperature curve is now also available in plotms.
Parameter descriptions
antenna
Must be either an ID (int or string or list), or a single antenna name or list.
basebands
Show only spws from the specified baseband or list of basebands (default: ‘’=[]=all)
buildpdf
True/False; if True and figfile is set, assemble pngs into a pdf
caltable
A bandpass table, of type B or BPOLY
caltable2
A second cal table, of type BPOLY or B, to overlay on a B table
caltable3
A third cal table, of type BPOLY, to overlay on the first two
channeldiff
Set to value > 0 to plot derivatives of amplitude. The value is also used as sigma, and any outliers beyond this sigma will be printed to the logger
chanrange
set xrange over which to autoscale y-axis for xaxis=’freq’ (e.g., “5~100”)
chanrangeSetXrange
If True, then chanrange also sets the xrange to display
convert
Full path for convert command (in case it’s not found)
density
Dpi to use in creating PNGs and PDFs (default=108)
edge
The number of edge channels to ignore in finding outliers (for channeldiff>0)
field
must be an ID, source name, or list thereof; can use trailing *: ‘J*’
figfile
The base_name of the png files to save: base_name.antX.spwY.png
figfileSequential
Naming scheme. False: name by spw/antenna (default).True: figfile.1.png, figfile.2.png, etc.
gs
Full path for ghostscript command (in case it’s not found)
interactive
If False, then figfile will run to completion automatically
lo1
Specify the LO1 setting (in GHz) for the observation
overlay
Overlay ‘antenna’,’time’,’spw’, or ‘baseband’; make 1 plot with different items in colors
markersize
Size of points (default=3)
ms
Name of the ms for this table, in case it does not match the string in the caltable
parentms
Name of the parent ms, in case the ms has been previously split
pdftk
Full path for pdftk command (in case it’s not found)
phase
The y-axis limits to use for phase plots when yaxis=’both’
platformingSigma
Declare platforming if the amplitude derivative exceeds this many times the MAD
platformingThreshold
If platformingSigma=0, then declare platforming if the amplitude derivative exceeds this percentage of the median
plotrange
Define axis limits: [x0,x1,y0,y1] where 0,0 means auto
poln
Polarizations to plot (e.g., ‘XX’,’YY’,’RR’,’LL’ or ‘’ for both)
pwv
Define the precipitable water vapour(pwv) to use for the showatm option: ‘auto’ or value in mm
resample
Channel expansion factor to use when computing MAD of derivative (for channeldiff>0)
scans
Show only solutions for the specified scans (int, list, or string)
showatm
Compute and overlay the atmospheric transmission curve (on B or T sys solutions)
showatmfield
Use first observation of this fieldID or name
showatmPoints
Draw atmospheric curve with points instead of a line
showBasebandNumber
Put the BBC_NO in the title of each plot
showfdm
When showing TDM spws with xaxis=’freq’, draw locations of FDM spws
showflagged
Show the values of data, even if flagged
showimage
Also show the atmospheric curve for the image sideband (in black)
showtsky
Compute and overlay the sky temperature curve instead of transmission
showlines
Draw lines connecting the data (default=True for amp, False for phase)
showpoints
Draw points for the data (default=False for amp, True for phase)
solutionTimeThresholdSeconds
Consider 2 solutions simultaneously if within this interval (default=60)
spw
Must be single ID or list or range (e.g., “0~4”, not the original ID)
subplot
11..81,22,32 or 42 for RowsxColumns (default=22), any 3rd digit is ignored
timeranges
Show only these timeranges, the first timerange being 0
xaxis
‘chan’ or ‘freq’
yaxis
‘amp’, ‘tsys’, ‘phase’, or ‘both’ amp+phase == ‘ap’. Append ‘db’ for dB
zoom
‘intersect’ will zoom to overlap region of caltable with caltable2
- Examples
To plot the system temperature (channel vs. amplitude) of fields 0, 1 and 4, overlaying all antennas, and printing a png plot:
plotbandpass(caltable='X3c1.tsys', overlay='antenna', yaxis='amp', field='0~1,4', xaxis='chan', figfile='tsys.png').
To overplot two bandpass tables, with x-axis frequency:
plotbandpass(caltable='bandpass.bcal', caltable2='bandpass.bcal_smooth', xaxis='freq')
To overplot the XX-polarisation two bandpass tables, with x-axis frequency; the atmospheric transmission curve is also computed and overlaid:
plotbandpass(caltable='bandpass.bcal', caltable2='bandpass.bcal_smooth', xaxis='freq', poln='X', showatm=True)
The following returns void unless the channeldiff option is selected, in which case it returns a dictionary containing the statistics of the solutions, keyed by the antenna name, followed by the spw, timerange, polarization, and finally ‘amp’ and/or ‘phase’ depending on the yaxis selection.
plotbandpass(caltable='bandpass.bcal',channeldiff='5')
- Development
No additional development details
- Parameter Details
Detailed descriptions of each function parameter
caltable (path)
- Input table name, either a bandpass solution or a Tsys solutionantenna ({string, int, stringVec, intVec}='')
- A comma-delimited string list of antennas (either names or integer indices) for which to display solutions. Default = all antennas.field ({string, int, stringVec, intVec}='')
- A comma-delimited string list of fields (either names or integer indices) for which to display solutions. Default = all fields.spw ({string, int, stringVec, intVec}='')
- A comma-delimited string list of spws for which to display solutions. Default = all spws.yaxis (string='amp')
- The quantity to plot on the y-axis (“amp”, “phase”, “both”, “tsys”, append “db” for dB).xaxis (string='chan')
- The quantity to plot on the x-axis (“chan” or “freq”).figfile (string='')
- The name of the plot file to produce.plotrange (doubleVec=[0, 0, 0, 0])
- The axes limits to use [x0,x1,y0,y1].caltable2 (string='')
- A second cal table, of type BPOLY or B, to overlay on a B tableoverlay (string='')
- Show multiple solutions in same frame in different colors (time, antenna, spw, baseband, or time,antenna)showflagged (bool=False)
- Show the values of the solution, even if flaggedtimeranges (string='')
- Show only these timeranges, the first timerange being 0buildpdf (bool=False)
- If True, assemble all the pngs into a pdfcaltable3 (string='')
- A third cal table, of type BPOLY, to overlay on the first two tablesmarkersize (int=3)
- Size of pointsdensity (int=108)
- dpi to use in creating PNGs and PDFs (default=108)interactive (bool=True)
- if False, then run to completion automatically without pauseshowpoints ({string, bool}='auto')
- Draw points for the data (default=F for amp, T for phase)showlines ({string, bool}='auto')
- Draw lines connecting the data (default=T for amp, F for phase)subplot ({string, int}='22')
- 11..81,22,32 or 42 for RowsxColumns (default=22), any 3rd digit is ignoredzoom (string='')
- “intersect” will zoom to overlap region of caltable with caltable2poln ({stringVec, string}='')
- Polarizations to plot: “” = all, or “RR”,”RL”,”LR”,”LL”,”XX”,”XY”,”YX”,”YY”,”RR,LL”,”XX,YY”showatm (bool=False)
- Compute and overlay the atmospheric transmission curvepwv ({double, string}='auto')
- Define the pwv to use for the showatm option: “auto” or value in mmgs (string='gs')
- For buildpdf=T, full path for ghostscript command (in case it is not found)convert (string='convert')
- For buildpdf=T, full path for the ImageMagick convert command (in case it is not found)chanrange ({string, intVec}='')
- Set xrange (“5~100”) over which to autoscale y-axis for xaxis=”freq”solutionTimeThresholdSeconds (double=30.0)
- Consider 2 solutions simultaneous if within this interval in secondsdebug (bool=False)
- Print verbose messages for debugging purposesphase ({intVec, string}='')
- The y-axis limits to use for phase plots when yaxis=”both”vis (string='')
- name of the ms for this table, in case it does not match the string in the caltableshowtsky (bool=False)
- Compute and overlay the sky temperature curve instead of transmissionshowfdm (bool=False)
- when showing TDM spws, draw the locations of the corresponding FDM spwsshowatmfield ({int, string}='')
- for overlay=”time”, use first observation of this fieldID or namelo1 ({string, double}='')
- specify the LO1 setting (in GHz) for the observation (’’ = automatic)showimage (bool=False)
- also show the atmospheric curve for the image sideband (in black)showatmpoints (bool=False)
- Draw atmospheric curve with points instead of a lineparentms (string='')
- if showimage=T, name of the parent ms (only needed if the ms has been previously split)pdftk (string='pdftk')
- For buildpdf=T, full path for pdftk command (in case it is not found)channeldiff ({bool, double}=False)
- Set to a value > 0 (sigma) to plot derivatives of the solutionsedge (int=8)
- The number of edge channels to ignore in finding outliers (for channeldiff>0)resample (int=1)
- The channel expansion factor to use when computing MAD of derivative (for channeldiff>0)platformingThreshold (double=10.0)
- if platformingSigma=0, then declare platforming if the amplitude derivative exceeds this percentage of the medianplatformingSigma (double=10.0)
- declare platforming if the amplitude derivative exceeds this many times the MADbasebands ({int, string, intVec}='')
- A baseband number or list of baseband numbers for which to display solutions. Default = all.showBasebandNumber (bool=False)
- Put the baseband converter number (BBC_NO) in the title of each plotscans ({int, string, intVec}='')
- A scan or list of scans for which to display solutions. Default = all. Does not work with overlay=”time”.figfileSequential (bool=False)
- naming scheme for pngs: False: name by spw/antenna (default), True: figfile.000.png, figfile.001.png, etc.chanrangeSetXrange (bool=False)
- If True, then chanrange also sets the xrange to display