Compact-source photometry with discrete Fourier transformations (pwkit.environments.casa.dftphotom)

This module implements an algorithm to compute light curves for point sources in interferometric visibility data. CASA doesn’t have a task to do this.

The algorithm is accessible from the command line as casatask dftphotom, but it can also be invoked from within Python. For help on usage from the command line, run casatask dftphotom --help. The command’s help text will also describe some of the parameters below in more detail than is currently found here.

Usage from Within Python

Basic usage from within Python looks like this:

from pwkit.astutil import parsehours, parsedeglat
from pwkit.environments.casa import dftphotom

# Here's a sample way to specify the coordinates to
# use; anything that produces J2000 RA/Dec in radians
# will work:
ra = parsehours('17:45:00') # result is in radians
dec = parsedeglat('-23:00:00') # result is in radians

cfg = dftphotom.Config()
cfg.vis = 'path/to/vis/data.ms'
cfg.format = dftphotom.PandasOutputFormat()
cfg.outstream = open('mydata.txt', 'w')
cfg.rephase = (ra, dec)

dftphotom.dftphotom(cfg)

The main algorithm is implemented in the dftphotom() function. All of the algorithm parameters are passed to the function via a Config structure. You can create one Config and call dftphotom() with it repeatedly, altering the parameters each time if you have a series of related computations to run.

API Reference

class pwkit.environments.casa.dftphotom.Config[source]
vis = KeywordOptions(required=True, subval=<class 'str'>)

The path to the visibility MeasurementSet to process. No default; you must specify a value before calling dftphotom().

datacol = 'data'

A string specifying which visibility data column to process: data, corrected_data, or model_data. Default 'data'.

believeweights = False

Whether to trust that the data-weight information in the MS accurately describe the noise in their corresponding visibilities. Default False.

outstream

A file-like object into which the output table of data will be written. No default in the Python interface.

datascale = 1000000.0

The amount by which to scale the computed values before emitting them as text. The default is 1e6, which means that the output will be in microJanskys if the underlying data are calibrated to Jansky units.

format

An instance of a class that will format the algorithm outputs into text. Either HumaneOutputFormat or PandasOutputFormat.

rephase

A coordinate tuple (ra, dec), giving a location towards which to rephase the visibility data. The inputs are in radians. If left as None, the visibilities will not be rephased.

Generic CASA data-selection options

array = <class 'str'>
baseline = <class 'str'>
field = <class 'str'>
observation = <class 'str'>
polarization = 'RR,LL'
scan = <class 'str'>
scanintent = <class 'str'>
spw = <class 'str'>
taql = <class 'str'>
time = <class 'str'>
uvdist = <class 'str'>

Generic CASA task options

loglevel = 'warn'
pwkit.environments.casa.dftphotom.dftphotom(cfg)[source]

Run the discrete-Fourier-transform photometry algorithm.

See the module-level documentation and the output of casatask dftphotom --help for help. All of the algorithm configuration is specified in the cfg argument, which is an instance of Config.

pwkit.environments.casa.dftphotom.dftphotom_cli(argv)[source]

Command-line access to the dftphotom() algorithm.

This function implements the behavior of the command-line casatask dftphotom tool, wrapped up into a single callable function. The argument argv is a list of command-line arguments, in Unix style where the zeroth item is the name of the command.

class pwkit.environments.casa.dftphotom.HumaneOutputFormat[source]
class pwkit.environments.casa.dftphotom.PandasOutputFormat[source]