Programmatic access to CASA tasks (pwkit.environments.casa.tasks)

The way that the official CASA 5 casapy code is written, it’s basically impossible to import its tasks into a straight-Python environment. (Trust me, I’ve tried.) So, this module more-or-less duplicates lots of CASA code. But this module also tries to provide to provide saner semantics and interfaces.

Fortunately, CASA 6 is way more reasonable.

The goal is to make task-like functionality available in a real Python library, with no side effects, so that data processing can be scripted tractably. These tasks are also accessible through the casatask command line program provided with pwkit.

Example programmatic usage:

from pwkit.environments.casa import tasks

vis_path = 'mydataset.ms'

# A basic listobs:

for output_line in tasks.listobs(vis_path):
    print(output_line)

# Split a dataset with filtering and averaging:

cfg = tasks.SplitConfig()
cfg.vis = vis_path
cfg.out = 'new-' + vis_path
cfg.spw = '0~8'
cfg.timebin = 60 # seconds
tasks.split(cfg)

This module implements the following analysis tasks. Some of them are extremely close to CASA tasks of the same name; some are streamlined; some are not provided in CASA at all.

  • applycal — use calibration tables to generate CORRECTED_DATA from DATA.

  • bpplot — plot a bandpass calibration table; an order of magnitude faster than the CASA equivalent.

  • clearcal — fill calibration tables with default.

  • concat — concatenate two data sets.

  • delcal — delete the MODEL_DATA and/or CORRECTED_DATA MS columns.

  • elplot — plot elevations of the fields observed in an MS.

  • extractbpflags — extract a table of channel flags from a bandpass calibration table.

  • flagcmd — apply flags to an MS using a generic infrastructure.

  • flaglist — apply a textual list of flag commands to an MS.

  • flagzeros — flag zero-valued visibilites in an MS.

  • fluxscale — use a flux density model to absolutely scale a gain calibration table.

  • ft — generate model visibilities from an image.

  • gaincal — solve for a gain calibration table.

  • gencal — generate various calibration tables that do not depend on the actual visibility data in an MS.

  • getopacities — estimate atmospheric opacities for an observation.

  • gpdetrend — remove long-term phase trends from a complex-gain calibration table.

  • gpplot — plot a complex-gain calibration table in a sensible way.

  • image2fits — convert a CASA image to FITS format.

  • importalma — convert an ALMA SDM file to MS format.

  • importevla — convert an EVLA SDM file to MS format.

  • listobs — print out the basic observational characteristics in an MS data set.

  • listsdm — print out the basic observational characteristics in an SDM data set.

  • mfsclean — image calibrated data using MFS and CLEAN.

  • mjd2date — convert an MJD to a date in the textual format used by CASA.

  • mstransform — perform basic streaming transforms on an MS data, such as time averaging, Hanning smoothing, and/or velocity resampling.

  • plotants — plot the positions of the antennas used in an MS.

  • plotcal — plot a complex-gain calibration table using CASA’s default infrastructure.

  • setjy — insert absolute flux density calibration information into a dataset.

  • split — extract a subset of an MS.

  • tsysplot — plot how the typical system temperature varies over time.

  • uvsub — fill CORRECTED_DATA with DATA - MODEL_DATA.

  • xyphplot — plot a frequency-dependent X/Y phase calibration table.

The following tasks are provided by the associated command line program, casatask, but do not have dedicated functions in this module.

  • closures — see closures.

  • delmod — this is too trivial to need its own function.

  • dftdynspec — see dftdynspec.

  • dftphotom — see dftphotom.

  • dftspect — see dftspect.

  • flagmanager — more specialized functions should be used in code.

  • gpdiagnostics — see gpdiagnostics.

  • polmodel — see polmodel.

  • spwglue — see spwglue.

Tasks

This documentation is automatically generated from text that is targeted at the command-line tasks, and so may read a bit strangely at times.

applycal

pwkit.environments.casa.tasks.applycal(cfg)[source]

The applycal task.

cfg

A ApplycalConfig object.

This function runs the applycal task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the ApplycalConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.ApplycalConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.applycal(cfg)

This task may also be invoked through the command line, as casatask applycal. Run casatask applycal --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.ApplycalConfig[source]

This is a configuration object for the applycal task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to applycal().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask applycal. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Fill in the CORRECTED_DATA column of a visibility dataset using the raw data and a set of calibration tables.

vis=

The MS to modify

calwt=

Write out calibrated weights as well as calibrated visibilities. Default: false

Pre-applied calibrations

gaintable=

Comma-separated list of calibration tables to apply on-the-fly before solving

gainfield=

SEMICOLON-separated list of field selections to apply for each gain table. If there are fewer items than there are gaintable items, the list is padded with blank items, implying no selection by field.

interp=

COMMA-separated list of interpolation types to use for each gain table. If there are fewer items, the list is padded with ‘linear’ entries. Allowed values: nearest linear cubic spline

spwmap=

SEMICOLON-separated list of spectral window mappings for each existing gain table; each record is a COMMA-separated list of integers. For the i’th spw in the dataset, spwmap[i] specifies the record in the gain table to use. For instance [0, 0, 1, 1] maps four spws in the UV data to just two spectral windows in the preexisting gain table.

opacity=

Comma-separated list of opacities in nepers. One for each spw; if there are more spws than entries, the last entry is used for the remaining spws.

gaincurve=

Whether to apply VLA-specific built in gain curve correction (default: false)

parang=

Whether to apply parallactic angle rotation correction (default: false)

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

bpplot

pwkit.environments.casa.tasks.bpplot(cfg)[source]

The bpplot task.

cfg

A BpplotConfig object.

This function runs the bpplot task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the BpplotConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.BpplotConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.bpplot(cfg)

This task may also be invoked through the command line, as casatask bpplot. Run casatask bpplot --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.BpplotConfig[source]

This is a configuration object for the bpplot task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to bpplot().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask bpplot. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Plot a bandpass calibration table. Currently, the supported format is a series of pages showing amplitude and phase against normalized channel number, with each page showing a particular antenna and polarization. Polarizations are always reported as “R” and “L” since the relevant information is not stored within the bandpass data set.

This task also works well to plot frequency-dependent polarimetric leakage calibration tables.

caltable=MS

The input calibration Measurement Set

dest=PATH

If specified, plots are saved to this file – the format is inferred from the extension, which must allow multiple pages to be saved. If unspecified, the plots are displayed using a Gtk3 backend.

dims=WIDTH,HEIGHT

If saving to a file, the dimensions of a each page. These are in points for vector formats (PDF, PS) and pixels for bitmaps (PNG). Defaults to 1000, 600.

margins=TOP,RIGHT,LEFT,BOTTOM

If saving to a file, the plot margins in the same units as the dims. The default is 4 on every side.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

clearcal

pwkit.environments.casa.tasks.clearcal(vis, weightonly=False)[source]

Fill the imaging and calibration columns (MODEL_DATA, CORRECTED_DATA, IMAGING_WEIGHT) of each measurement set with default values, creating the columns if necessary.

vis (string)

Path to the input measurement set

weightonly (boolean)

If true, just create the IMAGING_WEIGHT column; do not fill in the visibility data columns.

If you want to reset calibration models, these days you probably want delmod_cli(). If you want to quickly make the columns go away, you probably want delcal().

Example:

from pwkit.environments.casa import tasks
tasks.clearcal('myvis.ms')

concat

pwkit.environments.casa.tasks.concat(invises, outvis, timesort=False)[source]

Concatenate visibility measurement sets.

invises (list of str)

Paths to the input measurement sets

outvis (str)

Path to the output measurement set.

timesort (boolean)

If true, sort the output in time after concatenation.

Example:

from pwkit.environments.casa import tasks
tasks.concat(['epoch1.ms', 'epoch2.ms'], 'combined.ms')

delcal

pwkit.environments.casa.tasks.delcal(mspath)[source]

Delete the MODEL_DATA and CORRECTED_DATA columns from a measurement set.

mspath (str)

The path to the MS to modify

Example:

from pwkit.environments.casa import tasks
tasks.delcal('dataset.ms')

delmod

pwkit.environments.casa.tasks.delmod_cli(argv, alter_logger=True)[source]

Command-line access to delmod functionality.

The delmod task deletes “on-the-fly” model information from a Measurement Set. It is so easy to implement that a standalone function is essentially unnecessary. Just write:

from pwkit.environments.casa import util
cb = util.tools.calibrater()
cb.open('datasaet.ms', addcorr=False, addmodel=False)
cb.delmod(otf=True, scr=False)
cb.close()

If you want to delete the scratch columns, use delcal(). If you want to clear the scratch columns, use clearcal().

elplot

pwkit.environments.casa.tasks.elplot(cfg)[source]

The elplot task.

cfg

A ElplotConfig object.

This function runs the elplot task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the ElplotConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.ElplotConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.elplot(cfg)

This task may also be invoked through the command line, as casatask elplot. Run casatask elplot --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.ElplotConfig[source]

This is a configuration object for the elplot task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to elplot().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask elplot. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Plot elevations of fields observed in a MeasurementSet.

vis=MS

The input Measurement Set.

dest=PATH

If specified, plots are saved to this file – the format is inferred from the extension, which must allow multiple pages to be saved. If unspecified, the plots are displayed using a Gtk3 backend.

dims=WIDTH,HEIGHT

If saving to a file, the dimensions of a each page. These are in points for vector formats(PDF, PS) and pixels for bitmaps(PNG). Defaults to 1000, 600.

margins=TOP,RIGHT,LEFT,BOTTOM

If saving to a file, the plot margins in the same units as the dims. The default is 4 on every side.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

extractbpflags

pwkit.environments.casa.tasks.extractbpflags(calpath, deststream)[source]

Make a flags file out of a bandpass calibration table

calpath (str)

The path to the bandpass calibration table

deststream (stream-like object, e.g. an opened file)

Where to write the flags data

Below is documentation written for the command-line interface to this functionality:

When CASA encounters flagged channels in bandpass calibration tables, it interpolates over them as best it can – even if interp=’<any>,nearest’. This means that if certain channels are unflagged in some target data but entirely flagged in your BP cal, they’ll get multiplied by some number that may or may not be reasonable, not flagged. This is scary if, for instance, you’re using an automated system to find RFI, or you flag edge channels in some uneven way.

This script writes out a list of flagging commands corresponding to the flagged channels in the bandpass table to ensure that the data without bandpass solutions are flagged.

Note that, because we can’t select by antpol, we can’t express a situation in which the R and L bandpass solutions have different flags. But in CASA the flags seem to always be the same.

We’re assuming that the channelization of the bandpass solution and the data are the same.

flagcmd

pwkit.environments.casa.tasks.flagcmd(cfg)[source]

The flagcmd task.

cfg

A FlagcmdConfig object.

This function runs the flagcmd task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the FlagcmdConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.FlagcmdConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.flagcmd(cfg)

This task may also be invoked through the command line, as casatask flagcmd. Run casatask flagcmd --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.FlagcmdConfig[source]

This is a configuration object for the flagcmd task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to flagcmd().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask flagcmd. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Flag data using auto-generated lists of flagging commands.

flaglist

pwkit.environments.casa.tasks.flaglist(cfg)[source]

The flaglist task.

cfg

A FlaglistConfig object.

This function runs the flaglist task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the FlaglistConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.FlaglistConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.flaglist(cfg)

This task may also be invoked through the command line, as casatask flaglist. Run casatask flaglist --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.FlaglistConfig[source]

This is a configuration object for the flaglist task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to flaglist().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask flaglist. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Flag data using a list of flagging commands stored in a text file. This is approximately equivalent to ‘flagcmd(vis=, inpfile=, inpmode=’list’, flagbackup=False)’.

This implementation must emulate the CASA modules that load up the flagging commands and may not be precisely compatible with the CASA version.

flagmanager

pwkit.environments.casa.tasks.flagmanager_cli(argv, alter_logger=True)[source]

Command-line access to flagmanager functionality.

The flagmanager task manages tables of flags associated with measurement sets. Its features are easy to implement that a standalone library function is essentially unnecessary. See the source code to this function for the tool calls that implement different parts of the flagmanager functionality.

flagzeros

pwkit.environments.casa.tasks.flagzeros(cfg)[source]

The flagzeros task.

cfg

A FlagzerosConfig object.

This function runs the flagzeros task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the FlagzerosConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.FlagzerosConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.flagzeros(cfg)

This task may also be invoked through the command line, as casatask flagzeros. Run casatask flagzeros --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.FlagzerosConfig[source]

This is a configuration object for the flagzeros task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to flagzeros().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask flagzeros. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Flag zero data points in the specified data column.

fluxscale

pwkit.environments.casa.tasks.fluxscale(cfg)[source]

The fluxscale task.

cfg

A FluxscaleConfig object.

This function runs the fluxscale task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the FluxscaleConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.FluxscaleConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.fluxscale(cfg)

This task may also be invoked through the command line, as casatask fluxscale. Run casatask fluxscale --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.FluxscaleConfig[source]

This is a configuration object for the fluxscale task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to fluxscale().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask fluxscale. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Write a new calibation table determining the fluxes for intermediate calibrators from known reference sources

vis=

The visibility dataset.(Shouldn’t be needed, but …)

caltable=

The preexisting calibration table with gains associated with more than one source.

fluxtable=

The path of a new calibration table to create

reference=

Comma-separated names of sources whose model fluxes are assumed to be well-known.

transfer=

Comma-separated names of sources whose fluxes should be computed from the gains.

listfile=

If specified, write out flux information to this path.

append=

Boolean, default false. If true, append to existing cal table rather than overwriting.

refspwmap=

Comma-separated list of integers. If gains are only available for some spws, map from the data to the gains. For instance, refspwmap=1,1,3,3 means that spw 0 will have its flux calculated using the gains for spw 1.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

ft

pwkit.environments.casa.tasks.ft(cfg)[source]

The ft task.

cfg

A FtConfig object.

This function runs the ft task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the FtConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.FtConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.ft(cfg)

This task may also be invoked through the command line, as casatask ft. Run casatask ft --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.FtConfig[source]

This is a configuration object for the ft task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to ft().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask ft. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Fill in(or update) the MODEL_DATA column of a Measurement Set with visibilities computed from an image or list of components.

vis=

The path to the measurement set

model=

Comma-separated list of model images, each giving successive Taylor terms of a spectral model for each source.(It’s fine to have just one model, and this will do what you want.) The reference frequency for the Taylor expansion is taken from the first image.

complist=

Path to a CASA ComponentList Measurement Set to use in the modeling. I don’t know what happens if you specify both this and “model”. They might both get applied?

incremental=

Bool, default false, meaning that the MODEL_DATA column will be replaced with the new values computed here. If true, the new values are added to whatever’s already in MODEL_DATA.

wprojplanes=

Optional integer. If provided, W-projection will be used in the computation of the model visibilities, using the specified number of planes. Note that this does make a difference even now that this task only embeds information in a MS to enable later on-the-fly computation of the UV model.

usescratch=

Foo.

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

gaincal

pwkit.environments.casa.tasks.gaincal(cfg)[source]

The gaincal task.

cfg

A GaincalConfig object.

This function runs the gaincal task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the GaincalConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.GaincalConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.gaincal(cfg)

This task may also be invoked through the command line, as casatask gaincal. Run casatask gaincal --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.GaincalConfig[source]

This is a configuration object for the gaincal task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to gaincal().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask gaincal. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Compute calibration parameters from data. Encompasses the functionality of CASA tasks ‘gaincal’ and ‘bandpass’.

vis=

Input dataset

caltable=

Output calibration table (can exist if append=True)

gaintype=
Kind of gain solution:

G - gains per poln and spw(default) T - like G, but one value for all polns GSPLINE - like G, with a spline fit. “Experimental” B - bandpass BPOLY - bandpass with polynomial fit. “Somewhat experimental” K - antenna-based delays KCROSS - global cross-hand delay ; use parang=True D - solve for instrumental leakage Df - above with per-channel leakage terms D+QU - solve for leakage and apparent source polarization Df+QU - above with per-channel leakage terms X - solve for absolute position angle phase term Xf - above with per-channel phase terms D+X - D and X. “Not normally done” Df+X - Df and X. Presumably also not normally done. XY+QU - ? XYf+QU - ?

calmode=

What parameters to solve for: amplitude(“a”), phase(“p”), or both (“ap”). Default is “ap”. Not used in bandpass solutions.

solint=

Solution interval; this is an upper bound, but solutions will be broken across certain boundaries according to “combine”. ‘inf’ - solutions as long as possible(the default) ‘int’ - one solution per integration (str) - a specific time with units(e.g. ‘5min’) (number) - a specific time in seconds

combine=

Comma-separated list of boundary types; solutions will NOT be broken across these boundaries. Types are: field, scan, spw.

refant=

Comma-separated list of reference antennas in decreasing priority order.

solnorm=

Normalize solution amplitudes to 1 after solving (only applies to gaintypes G, T, B). Also normalizes bandpass phases to zero when solving for bandpasses. Default: false.

append=

Whether to append solutions to an existing table. If the table exists and append=False, the table is overwritten! (Default: false)

Pre-applied calibrations

gaintable=

Comma-separated list of calibration tables to apply on-the-fly before solving

gainfield=

SEMICOLON-separated list of field selections to apply for each gain table. If there are fewer items than there are gaintable items, the list is padded with blank items, implying no selection by field.

interp=

COMMA-separated list of interpolation types to use for each gain table. If there are fewer items, the list is padded with ‘linear’ entries. Allowed values: nearest linear cubic spline

spwmap=

SEMICOLON-separated list of spectral window mappings for each existing gain table; each record is a COMMA-separated list of integers. For the i’th spw in the dataset, spwmap[i] specifies the record in the gain table to use. For instance [0, 0, 1, 1] maps four spws in the UV data to just two spectral windows in the preexisting gain table.

opacity=

Comma-separated list of opacities in nepers. One for each spw; if there are more spws than entries, the last entry is used for the remaining spws.

gaincurve=

Whether to apply VLA-specific built in gain curve correction (default: false)

parang=

Whether to apply parallactic angle rotation correction (default: false)

Low-level parameters

minblperant=

Number of baselines for each ant in order to solve (default: 4)

minsnr=

Min. SNR for acceptable solutions (default: 3.0)

preavg=

Interval for pre-averaging data within each solution interval, in seconds. Default is -1, meaning not to pre-average.

smodel=I,Q,U,V

Full-stokes point source model to use, if none is embedded in the vis file.

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

gencal

pwkit.environments.casa.tasks.gencal(cfg)[source]

The gencal task.

cfg

A GencalConfig object.

This function runs the gencal task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the GencalConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.GencalConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.gencal(cfg)

This task may also be invoked through the command line, as casatask gencal. Run casatask gencal --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.GencalConfig[source]

This is a configuration object for the gencal task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to gencal().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask gencal. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Generate certain calibration tables that don’t need to be solved for from the actual data.

If you want to generate antenna position corrections for Jansky VLA data, you can just specify caltype=antpos and leave off the “parameter” keyword. This will cause the task will talk to an NRAO server and automatically download the correct position corrections. Other telescopes do not support this functionality, but if you can obtain the position corrections, you can use the “antenna” and “parameter” keywords to build the desired calibration table manually.

vis=

Input dataset

caltable=

Output calibration table (appended to if preexisting)

caltype=

The kind of table to generate: amp - generic amplitude correction; needs parameter(s) ph - generic phase correction; needs parameter(s) sbd - single-band delay: phase slope for each SPW; needs parameter(s) mbd - multi-band delay: phase slope for all SPWs; needs parameter(s) antpos - antenna position corrections in ITRF; what you want; accepts parameter(s) antposvla - antenna position corrections in VLA frame; not what you want; accepts parameter(s) tsys - tsys from ALMA syscal table swpow - EVLA switched-power and requantizer gains(“experimental”) opac - tropospheric opacity; needs parameter gc - (E)VLA elevation-dependent gain curve eff - (E)VLA antenna efficiency correction gceff - combination of “gc” and “eff” rq - EVLA requantizer gains; not what you want swp/rq - EVLA switched-power gains divided by “rq”; not what you want

parameter=

Custom parameters for various caltypes. Dimensionality depends on selections applied. amp - gain; dimensionless ph - phase; degrees sbd - delay; nanosec mbd - delay; nanosec antpos - position offsets; ITRF meters(or look up automatically for EVLA if unspecified) antposvla - position offsets; meters in VLA reference frame opac - opacity; dimensionless(nepers?)

antenna=

Selection keyword, governing which solutions to generate and controlling shape of “parameter” keyword.

pol=

Analogous to “antenna”

spw=

Analogous to “antenna”

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

getopacities

pwkit.environments.casa.tasks.getopacities(ms, plotdest)[source]

gpdetrend

pwkit.environments.casa.tasks.gpdetrend(cfg)[source]

The gpdetrend task.

cfg

A GpdetrendConfig object.

This function runs the gpdetrend task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the GpdetrendConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.GpdetrendConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.gpdetrend(cfg)

This task may also be invoked through the command line, as casatask gpdetrend. Run casatask gpdetrend --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.GpdetrendConfig[source]

This is a configuration object for the gpdetrend task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to gpdetrend().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask gpdetrend. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Remove long-term phase trends from a complex-gain calibration table. For each antenna/spw/pol, the complex gains are divided into separate chunks(e.g., the intention is for one chunk for each visit to the complex-gain calibrator). The mean phase within each chunk is divided out. The effect is to remove long-term phase trends from the calibration table, but preserve short-term ones.

caltable=MS

The input calibration Measurement Set

maxtimegap=int

Measured in minutes. Gaps between solutions of this duration or longer will lead to a new segment being considered. Default is four times the smallest time gap seen in the data set.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

gpplot

pwkit.environments.casa.tasks.gpplot(cfg)[source]

The gpplot task.

cfg

A GpplotConfig object.

This function runs the gpplot task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the GpplotConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.GpplotConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.gpplot(cfg)

This task may also be invoked through the command line, as casatask gpplot. Run casatask gpplot --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.GpplotConfig[source]

This is a configuration object for the gpplot task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to gpplot().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask gpplot. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Plot a gain calibration table. Currently, the supported format is a series of pages showing amplitude and phase against time, with each page showing a particular antenna and polarization. Polarizations are always reported as “R” and “L” since the relevant information is not stored within the bandpass data set.

caltable=MS

The input calibration Measurement Set

dest=PATH

If specified, plots are saved to this file – the format is inferred from the extension, which must allow multiple pages to be saved. If unspecified, the plots are displayed using a Gtk3 backend.

dims=WIDTH,HEIGHT

If saving to a file, the dimensions of a each page. These are in points for vector formats(PDF, PS) and pixels for bitmaps(PNG). Defaults to 1000, 600.

margins=TOP,RIGHT,LEFT,BOTTOM

If saving to a file, the plot margins in the same units as the dims. The default is 4 on every side.

maxtimegap=10

Solutions separated by more than this number of minutes will be drawn with separate lines for clarity.

mjdrange=START,STOP

If specified, gain solutions outside of the MJDs STOP and START will be ignored.

phaseonly=false

If True, plot only phases, and not amplitudes.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

image2fits

pwkit.environments.casa.tasks.image2fits(mspath, fitspath, velocity=False, optical=False, bitpix=-32, minpix=0, maxpix=-1, overwrite=False, dropstokes=False, stokeslast=True, history=True, **kwargs)[source]

Convert an image in MS format to FITS format.

mspath (str)

The path to the input MS.

fitspath (str)

The path to the output FITS file.

velocity (boolean)

(To be documented.)

optical (boolean)

(To be documented.)

bitpix (integer)

(To be documented.)

minpix (integer)

(To be documented.)

maxpix (integer)

(To be documented.)

overwrite (boolean)

Whether the task is allowed to overwrite an existing destination file.

dropstokes (boolean)

Whether the “Stokes” (polarization) axis of the image should be dropped.

stokeslast (boolean)

Whether the “Stokes” (polarization) axis of the image should be placed as the last (innermost?) axis of the image cube.

history (boolean)

(To be documented.)

**kwargs

Forwarded on to the tofits function of the CASA image tool.

importalma

pwkit.environments.casa.tasks.importalma(asdm, ms)[source]

Convert an ALMA low-level ASDM dataset to Measurement Set format.

asdm (str)

The path to the input ASDM dataset.

ms (str)

The path to the output MS dataset.

This implementation automatically infers the value of the “tbuff” parameter.

Example:

from pwkit.environments.casa import tasks
tasks.importalma('myalma.asdm', 'myalma.ms')

importevla

pwkit.environments.casa.tasks.importevla(asdm, ms)[source]

Convert an EVLA low-level SDM dataset to Measurement Set format.

asdm (str)

The path to the input ASDM dataset.

ms (str)

The path to the output MS dataset.

This implementation automatically infers the value of the “tbuff” parameter.

Example:

from pwkit.environments.casa import tasks
tasks.importevla('myvla.sdm', 'myvla.ms')

listobs

pwkit.environments.casa.tasks.listobs(vis)[source]

Textually describe the contents of a measurement set.

vis (str)

The path to the dataset.

Returns

A generator of lines of human-readable output

Errors can only be detected by looking at the output. Example:

from pwkit.environments.casa import tasks

for line in tasks.listobs('mydataset.ms'):
  print(line)

listsdm

pwkit.environments.casa.tasks.listsdm(sdm, file=None)[source]

Generate a standard “listsdm” listing of(A)SDM dataset contents.

sdm (str)

The path to the (A)SDM dataset to parse

file (stream-like object, such as an opened file)

Where to print the human-readable listing. If unspecified, results go to sys.stdout.

Returns

A dictionary of information about the dataset. Contents not yet documented.

Example:

from pwkit.environments.casa import tasks
tasks.listsdm('myalmaa.asdm')

This code based on CASA’s task_listsdm.py, with this version info:

# v1.0: 2010.12.07, M. Krauss
# v1.1: 2011.02.23, M. Krauss: added functionality for ALMA data
#
# Original code based on readscans.py, courtesy S. Meyers

mfsclean

pwkit.environments.casa.tasks.mfsclean(cfg)[source]

The mfsclean task.

cfg

A MfscleanConfig object.

This function runs the mfsclean task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the MfscleanConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.MfscleanConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.mfsclean(cfg)

This task may also be invoked through the command line, as casatask mfsclean. Run casatask mfsclean --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.MfscleanConfig[source]

This is a configuration object for the mfsclean task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to mfsclean().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask mfsclean. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Drive the CASA imager with a very restricted set of options.

For W-projection, set ftmachine=’wproject’ and wprojplanes=64(or so).

vis=

Input visibility MS

imbase=

Base name of output files. We create files named “imbaseEXT” where EXT is all of “mask”, “modelTT”, “imageTT”, “residualTT”, and “psfTT”, and TT is empty if nterms = 1, and “ttN.” otherwise.

cell = 1 [arcsec] ftmachine = ‘ft’ or ‘wproject’ gain = 0.1 imsize = 256,256 mask = (blank) or path of CASA-format region text file niter = 500 nterms = 1 phasecenter = (blank) or ‘J2000 12h34m56.7 -12d34m56.7’ reffreq = 0 [GHz] stokes = I threshold = 0 [mJy] weighting = ‘briggs’(robust=0.5) or ‘natural’ wprojplanes = 1

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

mjd2date

pwkit.environments.casa.tasks.mjd2date(mjd, precision=3)[source]

Convert an MJD to a data string in the format used by CASA.

mjd (numeric)

An MJD value in the UTC timescale.

precision (integer, default 3)

The number of digits of decimal precision in the seconds portion of the returned string

Returns

A string representing the input argument in CASA format: YYYY/MM/DD/HH:MM:SS.SSS.

Example:

from pwkit.environment.casa import tasks
print(tasks.mjd2date(55555))
# yields '2010/12/25/00:00:00.000'

mstransform

pwkit.environments.casa.tasks.mstransform(cfg)[source]

The mstransform task.

cfg

A MstransformConfig object.

This function runs the mstransform task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the MstransformConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.MstransformConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.mstransform(cfg)

This task may also be invoked through the command line, as casatask mstransform. Run casatask mstransform --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.MstransformConfig[source]

This is a configuration object for the mstransform task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to mstransform().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask mstransform. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

vis=

Input visibility MS

out=

Output visibility MS

datacolumn=corrected

The data column on which to operate. Comma-separated list of: data, model, corrected, float_data, lag_data, all

realmodelcol=False

If true, turn a virtual model column into a real one.

keepflags=True

If false, discard completely-flagged rows.

usewtspectrum=False

If true, fill in a WEIGHT_SPECTRUM column in the output data set.

combinespws=False

If true, combine spectral windows

chanaverage=False

If true, average the data in frequency. NOT WIRED UP.

hanning=False

If true, Hanning smooth the data spectrally to remove Gibbs ringing.

regridms=False

If true, put the data on a new spectral window structure or reference frame.

timebin=<seconds>

If specified, time-average the visibilities with the specified binning.

timespan=<undefined>

Allow averaging to span over potential discontinuities in the data set. Comma-separated list of options; allowed values are: scan, state

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

plotants

pwkit.environments.casa.tasks.plotants(vis, figfile)[source]

Plot the physical layout of the antennas described in the MS.

vis (str)

Path to the input dataset

figfile (str)

Path to the output image file.

The output image format will be inferred from the extension of figfile. Example:

from pwkit.environments.casa import tasks
tasks.plotants('dataset.ms', 'antennas.png')

plotcal

pwkit.environments.casa.tasks.plotcal(cfg)[source]

The plotcal task.

cfg

A PlotcalConfig object.

This function runs the plotcal task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the PlotcalConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.PlotcalConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.plotcal(cfg)

This task may also be invoked through the command line, as casatask plotcal. Run casatask plotcal --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.PlotcalConfig[source]

This is a configuration object for the plotcal task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to plotcal().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask plotcal. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Plot values from a calibration dataset in any of a variety of ways.

caltable=

The calibration MS to plot

xaxis=

amp antenna chan freq imag phase real snr time

yaxis=

amp antenna imag phase real snr

iteration=

antenna field spw time

Supported data selection keywords

Limited data selection is supported. Allowed keywords are antenna, field, poln, spw, and timerange. The poln keyword may take on the values RL, R, L, XY, X, Y, and /.

Plot appearance options

To be documented. These keywords control the plot appearance: plotsymbol, plotcolor, fontsize, figfile.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

setjy

pwkit.environments.casa.tasks.setjy(cfg)[source]

The setjy task.

cfg

A SetjyConfig object.

This function runs the setjy task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the SetjyConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.SetjyConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.setjy(cfg)

This task may also be invoked through the command line, as casatask setjy. Run casatask setjy --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.SetjyConfig[source]

This is a configuration object for the setjy task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to setjy().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask setjy. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Insert model data into a measurement set. We force usescratch=False and scalebychan=True. You probably want to specify “field”.

fluxdensity=

Up to four comma-separated numbers giving Stokes IQUV intensities in Jy. Default values are [-1, 0, 0, 0]. If the Stokes I intensity is negative (i.e., the default), a “sensible default” will be used: detailed spectral models if the source is known (see “standard”), or 1 otherwise. If it is zero and “modimage” is used, the flux density of the model image is used. The built-in standards do NOT have polarimetric information, so for pol cal you do need to manually specify the flux density information – or see the program “casatask polmodel”.

modimage=

An image to use as the basis for the source’s spatial structure and, potentialy, flux density (if fluxdensity=0). Only usable for Stokes I. If the verbatim value of “modimage” can’t be opened as a path, it is assumed to be relative to the CASA data directory; a typical value might be “nrao/VLA/CalModels/3C286_C.im”.

spindex=

If using fluxdensity, these specify the spectral dependence of the values, such that S = fluxdensity * (freq/reffreq)**spindex. Reffreq is in GHz. Default values are 0 and 1, giving no spectral dependence.

reffreq=

See spindex.

standard=’Perley-Butler 2013’

Acceptable values are: Baars, Perley 90, Perley-Taylor 95, Perley-Taylor 99, Perley-Butler 2010, Perley-Butler 2013. You can specify the solar-system standard “Butler-JPL-Horizons 2012”, but doing so farms out the work to a stock CASA installation.

Supported data selection keywords

Only a subset of the standard data selection keywords are supported: field, observation, scan, spw, timerange..

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

split

pwkit.environments.casa.tasks.split(cfg)[source]

The split task.

cfg

A SplitConfig object.

This function runs the split task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the SplitConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.SplitConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.split(cfg)

This task may also be invoked through the command line, as casatask split. Run casatask split --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.SplitConfig[source]

This is a configuration object for the split task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to split().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask split. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

timebin=

Time-average data into bins of “timebin” seconds; defaults to no averaging

step=

Frequency-average data in bins of “step” channels; defaults to no averaging

col=all

Extract the column “col” as the DATA column. If “all”, copy all available columns without renaming. Possible values: all, DATA, MODEL_DATA, CORRECTED_DATA, FLOAT_DATA, LAG_DATA.

combine=[col1,col2,…]

When time-averaging, don’t start a new bin when the specified columns change. Acceptable column names: scan, state.

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

tsysplot

pwkit.environments.casa.tasks.tsysplot(cfg)[source]

The tsysplot task.

cfg

A TsysplotConfig object.

This function runs the tsysplot task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the TsysplotConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.TsysplotConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.tsysplot(cfg)

This task may also be invoked through the command line, as casatask tsysplot. Run casatask tsysplot --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.TsysplotConfig[source]

This is a configuration object for the tsysplot task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to tsysplot().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask tsysplot. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Plot a system temperature(Tsys) calibration table.

caltable=MS

The input calibration Measurement Set

dest=PATH

If specified, plots are saved to this file – the format is inferred from the extension, which must allow multiple pages to be saved. If unspecified, the plots are displayed using a Gtk3 backend.

dims=WIDTH,HEIGHT

If saving to a file, the dimensions of a each page. These are in points for vector formats(PDF, PS) and pixels for bitmaps(PNG). Defaults to 1000, 600.

margins=TOP,RIGHT,LEFT,BOTTOM

If saving to a file, the plot margins in the same units as the dims. The default is 4 on every side.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

uvsub

pwkit.environments.casa.tasks.uvsub(cfg)[source]

The uvsub task.

cfg

A UvsubConfig object.

This function runs the uvsub task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the UvsubConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.UvsubConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.uvsub(cfg)

This task may also be invoked through the command line, as casatask uvsub. Run casatask uvsub --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.UvsubConfig[source]

This is a configuration object for the uvsub task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to uvsub().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask uvsub. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Subtract MODEL_DATA from CORRECTED_DATA. If CORRECTED_DATA doesn’t already exist, it defaults to DATA, so that the effect is to set CORRECTED = DATA - MODEL.

vis=

The input data set.

reverse=

Boolean, default false, indicating whether we should add rather than subtract MODEL.

Standard data selection keywords

This task can filter input data using any of the following keywords, specified as in the standard CASA interface: antenna, array, correlation, field, intent, observation, scan, spw, taql, timerange, uvrange.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.

xyphplot

pwkit.environments.casa.tasks.xyphplot(cfg)[source]

The xyphplot task.

cfg

A XyphplotConfig object.

This function runs the xyphplot task. For documentation of the general functionality of this task and the parameters it takes, see the documentation for the XyphplotConfig object below. Example:

from pwkit.environments.casa import tasks

cfg = tasks.XyphplotConfig()
cfg.vis = 'mydataset.ms'
# ... set other parameters ...
tasks.xyphplot(cfg)

This task may also be invoked through the command line, as casatask xyphplot. Run casatask xyphplot --help to see another version of the documentation provided below.

class pwkit.environments.casa.tasks.XyphplotConfig[source]

This is a configuration object for the xyphplot task. This object contains no methods. Rather it contains placeholders (and default values) for parameters that can be passed to xyphplot().

The following documentation is written to target the command-line version of this task, which may be invoked as casatask xyphplot. “Keywords” refer attributes of this structure, “comma-separated lists” should become Python lists, and so on.

Plot a frequency-dependent X/Y phase calibration table.

caltable=MS

The input calibration Measurement Set

dest=PATH

If specified, plots are saved to this file – the format is inferred from the extension, which must allow multiple pages to be saved. If unspecified, the plots are displayed using a Gtk3 backend.

dims=WIDTH,HEIGHT

If saving to a file, the dimensions of a each page. These are in points for vector formats(PDF, PS) and pixels for bitmaps(PNG). Defaults to 1000, 600.

margins=TOP,RIGHT,LEFT,BOTTOM

If saving to a file, the plot margins in the same units as the dims. The default is 4 on every side.

loglevel=

Level of detail from CASA logging system. Default value is warn. Allowed values are: severe, warn, info, info1, info2, info3, info4, info5, debug1, debug2, debugging.