Source code for casatasks.visualization.plotbandpass

#
# stub function definition file for docstring parsing
#

[docs]def 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): r""" Makes detailed plots of Tsys and bandpass solutions. [`Description`_] [`Examples`_] [`Development`_] [`Details`_] Parameters - caltable_ (string) - Input table name, either a bandpass solution or a Tsys solution - antenna_ ({string, int, stringArray, intArray}='') - A comma-delimited string list of antennas (either names or integer indices) for which to display solutions. Default = all antennas. - field_ ({string, int, stringArray, intArray}='') - A comma-delimited string list of fields (either names or integer indices) for which to display solutions. Default = all fields. - spw_ ({string, int, stringArray, intArray}='') - 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). .. raw:: html <details><summary><i> yaxis = both </i></summary> - phase_ ({intArray, string}='['']') - The y-axis limits to use for phase plots when yaxis="both" .. raw:: html </details> - xaxis_ (string='chan') - The quantity to plot on the x-axis ("chan" or "freq"). .. raw:: html <details><summary><i> xaxis = freq </i></summary> - chanrange_ ({string, intArray}='') - 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 .. raw:: html </details> - figfile_ (string='') - The name of the plot file to produce. .. raw:: html <details><summary><i> figfile != '' </i></summary> - 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) .. raw:: html </details> - plotrange_ (doubleArray=[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 .. raw:: html <details><summary><i> caltable2 != '' </i></summary> - zoom_ (string='') - "intersect" will zoom to overlap region of caltable with caltable2 - caltable3_ (string='') - A third cal table, of type BPOLY, to overlay on the first two tables .. raw:: html </details> - overlay_ (string='') - Show multiple solutions in same frame in different colors (time, antenna, spw, baseband, or time,antenna) .. raw:: html <details><summary><i> overlay = time </i></summary> - showatmfield_ ({int, string}='') - for overlay="time", use first observation of this fieldID or name .. raw:: html </details> - 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_ ({stringArray, 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 .. raw:: html <details><summary><i> showatm != False </i></summary> - 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 .. raw:: html </details> - 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 .. raw:: html <details><summary><i> showtsky != False </i></summary> - 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 .. raw:: html </details> - channeldiff_ ({bool, double}=False) - Set to a value > 0 (sigma) to plot derivatives of the solutions .. raw:: html <details><summary><i> channeldiff != False </i></summary> - 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 .. raw:: html </details> - basebands_ ({int, string, intArray}='') - 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, intArray}='') - 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: 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**. .. rubric:: 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: 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: Development No additional development details .. _Details: Parameter Details Detailed descriptions of each function parameter .. _caltable: | ``caltable (string)`` - Input table name, either a bandpass solution or a Tsys solution .. _antenna: | ``antenna ({string, int, stringArray, intArray}='')`` - A comma-delimited string list of antennas (either names or integer indices) for which to display solutions. Default = all antennas. .. _field: | ``field ({string, int, stringArray, intArray}='')`` - A comma-delimited string list of fields (either names or integer indices) for which to display solutions. Default = all fields. .. _spw: | ``spw ({string, int, stringArray, intArray}='')`` - A comma-delimited string list of spws for which to display solutions. Default = all spws. .. _yaxis: | ``yaxis (string='amp')`` - The quantity to plot on the y-axis ("amp", "phase", "both", "tsys", append "db" for dB). .. _xaxis: | ``xaxis (string='chan')`` - The quantity to plot on the x-axis ("chan" or "freq"). .. _figfile: | ``figfile (string='')`` - The name of the plot file to produce. .. _plotrange: | ``plotrange (doubleArray=[0,0,0,0])`` - The axes limits to use [x0,x1,y0,y1]. .. _caltable2: | ``caltable2 (string='')`` - A second cal table, of type BPOLY or B, to overlay on a B table .. _overlay: | ``overlay (string='')`` - Show multiple solutions in same frame in different colors (time, antenna, spw, baseband, or time,antenna) .. _showflagged: | ``showflagged (bool=False)`` - Show the values of the solution, even if flagged .. _timeranges: | ``timeranges (string='')`` - Show only these timeranges, the first timerange being 0 .. _buildpdf: | ``buildpdf (bool=False)`` - If True, assemble all the pngs into a pdf .. _caltable3: | ``caltable3 (string='')`` - A third cal table, of type BPOLY, to overlay on the first two tables .. _markersize: | ``markersize (int=3)`` - Size of points .. _density: | ``density (int=108)`` - dpi to use in creating PNGs and PDFs (default=108) .. _interactive: | ``interactive (bool=True)`` - if False, then run to completion automatically without pause .. _showpoints: | ``showpoints ({string, bool}='auto')`` - Draw points for the data (default=F for amp, T for phase) .. _showlines: | ``showlines ({string, bool}='auto')`` - Draw lines connecting the data (default=T for amp, F for phase) .. _subplot: | ``subplot ({string, int}='22')`` - 11..81,22,32 or 42 for RowsxColumns (default=22), any 3rd digit is ignored .. _zoom: | ``zoom (string='')`` - "intersect" will zoom to overlap region of caltable with caltable2 .. _poln: | ``poln ({stringArray, string}='['']')`` - Polarizations to plot: "" = all, or "RR","RL","LR","LL","XX","XY","YX","YY","RR,LL","XX,YY" .. _showatm: | ``showatm (bool=False)`` - Compute and overlay the atmospheric transmission curve .. _pwv: | ``pwv ({double, string}='auto')`` - Define the pwv to use for the showatm option: "auto" or value in mm .. _gs: | ``gs (string='gs')`` - For buildpdf=T, full path for ghostscript command (in case it is not found) .. _convert: | ``convert (string='convert')`` - For buildpdf=T, full path for the ImageMagick convert command (in case it is not found) .. _chanrange: | ``chanrange ({string, intArray}='')`` - Set xrange ("5~100") over which to autoscale y-axis for xaxis="freq" .. _solutionTimeThresholdSeconds: | ``solutionTimeThresholdSeconds (double=30.0)`` - Consider 2 solutions simultaneous if within this interval in seconds .. _debug: | ``debug (bool=False)`` - Print verbose messages for debugging purposes .. _phase: | ``phase ({intArray, string}='['']')`` - The y-axis limits to use for phase plots when yaxis="both" .. _vis: | ``vis (string='')`` - name of the ms for this table, in case it does not match the string in the caltable .. _showtsky: | ``showtsky (bool=False)`` - Compute and overlay the sky temperature curve instead of transmission .. _showfdm: | ``showfdm (bool=False)`` - when showing TDM spws, draw the locations of the corresponding FDM spws .. _showatmfield: | ``showatmfield ({int, string}='')`` - for overlay="time", use first observation of this fieldID or name .. _lo1: | ``lo1 ({string, double}='')`` - specify the LO1 setting (in GHz) for the observation ('' = automatic) .. _showimage: | ``showimage (bool=False)`` - also show the atmospheric curve for the image sideband (in black) .. _showatmpoints: | ``showatmpoints (bool=False)`` - Draw atmospheric curve with points instead of a line .. _parentms: | ``parentms (string='')`` - if showimage=T, name of the parent ms (only needed if the ms has been previously split) .. _pdftk: | ``pdftk (string='pdftk')`` - For buildpdf=T, full path for pdftk command (in case it is not found) .. _channeldiff: | ``channeldiff ({bool, double}=False)`` - Set to a value > 0 (sigma) to plot derivatives of the solutions .. _edge: | ``edge (int=8)`` - The number of edge channels to ignore in finding outliers (for channeldiff>0) .. _resample: | ``resample (int=1)`` - The channel expansion factor to use when computing MAD of derivative (for channeldiff>0) .. _platformingThreshold: | ``platformingThreshold (double=10.0)`` - if platformingSigma=0, then declare platforming if the amplitude derivative exceeds this percentage of the median .. _platformingSigma: | ``platformingSigma (double=10.0)`` - declare platforming if the amplitude derivative exceeds this many times the MAD .. _basebands: | ``basebands ({int, string, intArray}='')`` - A baseband number or list of baseband numbers for which to display solutions. Default = all. .. _showBasebandNumber: | ``showBasebandNumber (bool=False)`` - Put the baseband converter number (BBC_NO) in the title of each plot .. _scans: | ``scans ({int, string, intArray}='')`` - A scan or list of scans for which to display solutions. Default = all. Does not work with overlay="time". .. _figfileSequential: | ``figfileSequential (bool=False)`` - naming scheme for pngs: False: name by spw/antenna (default), True: figfile.000.png, figfile.001.png, etc. .. _chanrangeSetXrange: | ``chanrangeSetXrange (bool=False)`` - If True, then chanrange also sets the xrange to display """ pass