from __future__ import absolute_import
from casatasks.private.casa_transition import is_CASA6
from textwrap import wrap
from casatools import table, msmetadata, quanta, ms, measures, ctsys
from casatasks import casalog
def plotants( vis=None, figfile=None,
antindex=None, logpos=None,
exclude=None, checkbaselines=None,
title=None, showgui=None ):
"""Plot the antenna distribution in the local reference frame:
The location of the antennas in the MS will be plotted with
X-toward local east; Y-toward local north. The name of each
antenna is shown next to its respective location.
vis -- Name of input visibility file.
default: none. example: vis='ngc5921.ms'
figfile -- Save the plotted figure in this file.
default: ''. example: figfile='myFigure.png'
antindex -- Label antennas with name and antenna ID
default: False. example: antindex=True
logpos -- Produce a logarithmic position plot.
default: False. example: logpos=True
exclude -- antenna IDs or names to exclude from plotting
default: []. example: exclude=[2,3,4], exclude='DV15'
checkbaselines -- Only plot antennas in the MAIN table.
This can be useful after a split. WARNING: Setting
checkbaselines to True will add to runtime in
proportion to the number of rows in the dataset.
default: False. example: checkbaselines=True
title -- Title written along top of plot
You can zoom in by pressing the magnifier button (bottom,
third from right) and making a rectangular region with
the mouse. Press the home button (left most button) to
A hard-copy of this plot can be obtained by pressing the
button on the right at the bottom of the display. A file
dialog will allow you to choose the directory, filename,
and format of the export.
showplot = showgui and not ctsys.getnogui() and not ctsys.getagg() and not ctsys.getpipeline()
exclude = myms.msseltoindex(vis, baseline=exclude)['antenna1'].tolist()
except RuntimeError as rterr:
errmsg = errmsg.replace('specificion', 'specification')
errmsg = errmsg.replace('Antenna Expression: ', '')
raise RuntimeError("Exclude selection error: " + errmsg)
telescope, names, ids, xpos, ypos, stations = getPlotantsAntennaInfo(vis,
logpos, exclude, checkbaselines)
raise ValueError("No antennas selected. Exiting plotants.")
msname = os.path.basename(vis)
title = "Antenna Positions for "