singledishms

class singledishms[source]

New single dish tool interface to process an MS

Methods Summary

apply_baseline_table

Apply baseline table to MS.

atmcor

Offline atmospheric correction of calibrated data

close

Close the sdms tool, with data written on disk, keeping sdms running for future use

done

Close the sdms tool

fit_line

Invoke line fitting

importasap

Import ASAP Scantable to MS.

importnro

Import NOSTAR data to MS.

name

Provide the name of the attached MeasurementSet

open

Open a new MeasurementSet for processing after closing current MeasurementSet

set_selection

Select Measurementset to process

singledishms

Construct singledishms tool

smooth

Smooth data with arbitrary smoothing kernel

subtract_baseline

Invoke baseline subtraction

subtract_baseline_cspline

Invoke baseline subtraction

subtract_baseline_sinusoid

Invoke baseline subtraction

subtract_baseline_variable

Invoke baseline subtraction by parameters stored in a file.

apply_baseline_table(bltable='', datacolumn='data', spw='', updateweight=False, sigmavalue='stddev', outfile='')[source]

Apply baseline table to MS.

For each row of given baseline table, read baseline parameters, construct baseline, then subtract it from the corresponding spectrum in the MS.

Parameters

  • bltable (string='') - The name of input Baseline Table

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • updateweight (bool=False) - Update weight based on sigmavalue of residual data

  • sigmavalue (string='stddev') - sigma value for computing weight

  • outfile (string='') - The name of output MeasurementSet

atmcor(config='', datacolumn='data', outfile='')[source]

Offline atmospheric correction of calibrated data

Parameters

  • config (record='') - Configuration for atmospheric correction

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • outfile (string='') - The name of output MeasurementSet

close()[source]

Close the sdms tool, with data written on disk, keeping sdms running for future use

This is used to close sdms tools. Note that the data is written to disk and detached from sdms tool. This is a synonym for done.

done()[source]

Close the sdms tool

This is used to close and sdms tools. Note that the data is written to disk and detached from sdms tool. This is a synonym for close.

fit_line(datacolumn='data', spw='', pol='', timebin='', timespan='', polaverage='', fitfunc='gaussian', nfit='0', linefinding=False, threshold=5.0, avg_limit=4, minwidth=4, edge=[0, 0], tempfile='', tempoutfile='')[source]

Invoke line fitting

Fit line profile to selected spectra and obtain the best-fit parameter values

Parameters

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • pol (variant='') - Select data by polarization(s)

  • timebin (string='') - Bin width for time averaging

  • timespan (string='') - Span the timebin across ‘scan’, ‘state’, ‘field’, or a combination of them (e.g., ‘scan,state’)

  • polaverage (string='') - polarization averaging mode (‘’, ‘stokes’, or ‘geometric’)

  • fitfunc (string='gaussian') - Function of line profile

  • nfit (string='0') - Comma-separated numbers of gaussian/lorentzian lines to fit in maskline region. ignored when linefinding=true.

  • linefinding (bool=False) - do line finding

  • threshold (float=5.0) - S/N threshold for line finder

  • avg_limit (int=4) - channel averaging for broad lines in line finding

  • minwidth (int=4) - the minimum channel width to detect as a line by line finder

  • edge (intArray=[0, 0]) - channels to drop at beginning and end of spectrum in line finding

  • tempfile (string='') - The name of temporary file to keep fitting results

  • tempoutfile (string='') - The name of temporary ms file

importasap(infile='', outfile='', parallel=False)[source]

Import ASAP Scantable to MS.

Import ASAP Scantable data to MeasurementSet.

Parameters

  • infile (string='') - The name of input ASAP Scantable

  • outfile (string='') - The name of output MeasurementSet

  • parallel (bool=False) - Turn on parallel execution

importnro(infile='', outfile='', parallel=False)[source]

Import NOSTAR data to MS.

Import NOSTAR data to MeasurementSet.

Parameters

  • infile (string='') - The name of input NOSTAR data

  • outfile (string='') - The name of output MeasurementSet

  • parallel (bool=False) - Turn on parallel execution

name()[source]

Provide the name of the attached MeasurementSet

Returns the name of the attached MeasurementSet.

open()[source]

Open a new MeasurementSet for processing after closing current MeasurementSet

Close the current MeasurementSet and open a new MeasurementSet instead. The current state of sdms is retained, except for the data selection.

Parameters

  • ms_name (string='') - New MeasurementSet to be processed

set_selection(spw='', field='', antenna='', timerange='', scan='', observation='', polarization='', beam='', intent='', feed='', taql='', reindex=True)[source]

Select Measurementset to process

Parameters

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • field (variant='') - Field Ids (0 relative) or Field names (msselection syntax and wilcards are used) to select

  • antenna (variant='') - Antenna Ids (0 relative) or Antenna names (msselection syntax and wilcards are used) to select

  • timerange (variant='') - Limit data selected to be within a given time range. Syntax is defined in the msselection link

  • scan (variant='') - Limit data selected on scan numbers. Syntax is defined in the msselection link

  • observation (variant='') - Select data by observation ID(s). Syntax is the same as for scan numbers.

  • polarization (variant='') - Select data by polarization(s)

  • beam (variant='') - Beam Ids (0 relative) to select; CURRENTLY NOT AVAILABLE!!!

  • intent (any='') - Select data by intent(s)

  • feed (any='') - Select data by feed(s)

  • taql (string='') - For the TAQL experts, flexible data selection using the TAQL syntax

  • reindex (bool=True) - Re-index indices in subtables based on data selection

singledishms()[source]

Construct singledishms tool

This is used to construct a singledishms tool instance. The created instance is just like the default one (‘sdms’) but physically independent from it. This is useful when users want to create their own tool instance inside scripts/modules to avoid possible conflicts that may happen when using the default tool instance from various places.

smooth(type='gaussian', width=0.0, datacolumn='data', outfile='')[source]

Smooth data with arbitrary smoothing kernel

NOTE: currently only Gaussian kernel is supported.

Parameters

  • type (string='gaussian') - Smoothing kernel type

  • width (float=0.0) - Smoothing kernel width

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • outfile (string='') - The name of output MeasurementSet

subtract_baseline(datacolumn='data', outfile='', bloutput='', dosubtract=True, spw='', updateweight=False, sigmavalue='stddev', blfunc='poly', order=5, clip_threshold_sigma=3.0, num_fitting_max=1, linefinding=False, threshold=5.0, avg_limit=4, minwidth=4, edge=[0, 0])[source]

Invoke baseline subtraction

Fit baseline and subtract it from selected spectra

Parameters

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • outfile (string='') - The name of output MeasurementSet

  • bloutput (string='') - The name(s) of Baseline to be output

  • dosubtract (bool=True) - Execute baseline subtraction from the input data

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • updateweight (bool=False) - Update weight based on sigmavalue of residual data

  • sigmavalue (string='stddev') - sigma value for computing weight

  • blfunc (string='poly') - baseline function

  • order (int=5) - polynomial order

  • clip_threshold_sigma (float=3.0) - threshold for clipping in unit of sigma

  • num_fitting_max (int=1) - maximum number of recursive clipping

  • linefinding (bool=False) - do line finding

  • threshold (float=5.0) - S/N threshold for line finder

  • avg_limit (int=4) - channel averaging for broad lines in line finding

  • minwidth (int=4) - the minimum channel width to detect as a line by line finder

  • edge (intArray=[0, 0]) - channels to drop at beginning and end of spectrum in line finding

subtract_baseline_cspline(datacolumn='data', outfile='', bloutput='', dosubtract=True, spw='', updateweight=False, sigmavalue='stddev', npiece=5, clip_threshold_sigma=3.0, num_fitting_max=1, linefinding=False, threshold=5.0, avg_limit=4, minwidth=4, edge=[0, 0])[source]

Invoke baseline subtraction

Fit baseline and subtract it from selected spectra

Parameters

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • outfile (string='') - The name of output MeasurementSet

  • bloutput (string='') - The name(s) of Baseline to be output

  • dosubtract (bool=True) - Execute baseline subtraction from the input data

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • updateweight (bool=False) - Update weight based on sigmavalue of residual data

  • sigmavalue (string='stddev') - sigma value for computing weight

  • npiece (int=5) - cspline npiece

  • clip_threshold_sigma (float=3.0) - threshold for clipping in unit of sigma

  • num_fitting_max (int=1) - maximum number of recursive clipping

  • linefinding (bool=False) - do line finding

  • threshold (float=5.0) - S/N threshold for line finder

  • avg_limit (int=4) - channel averaging for broad lines in line finding

  • minwidth (int=4) - the minimum channel width to detect as a line by line finder

  • edge (intArray=[0, 0]) - channels to drop at beginning and end of spectrum in line finding

subtract_baseline_sinusoid(datacolumn='data', outfile='', bloutput='', dosubtract=True, spw='', updateweight=False, sigmavalue='stddev', addwn='0', rejwn='', applyfft=False, fftmethod='fft', fftthresh='3.0', clip_threshold_sigma=3.0, num_fitting_max=1, linefinding=False, threshold=5.0, avg_limit=4, minwidth=4, edge=[0, 0])[source]

Invoke baseline subtraction

Fit baseline and subtract it from selected spectra

Parameters

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • outfile (string='') - The name of output MeasurementSet

  • bloutput (string='') - The name(s) of Baseline to be output

  • dosubtract (bool=True) - Execute baseline subtraction from the input data

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • updateweight (bool=False) - Update weight based on sigmavalue of residual data

  • sigmavalue (string='stddev') - sigma value for computing weight

  • addwn (string='0') - additional wave numbers to use

  • rejwn (string='') - reject specified wave numbers

  • applyfft (bool=False) - automatically set wave numbers of sinusoids

  • fftmethod (string='fft') - method to automatically set wave numbers of sinusoids [‘fft’]

  • fftthresh (variant='3.0') - threshold to select wave numbers of sinusoids

  • clip_threshold_sigma (float=3.0) - threshold for clipping in unit of sigma

  • num_fitting_max (int=1) - maximum number of recursive clipping

  • linefinding (bool=False) - do line finding

  • threshold (float=5.0) - S/N threshold for line finder

  • avg_limit (int=4) - channel averaging for broad lines in line finding

  • minwidth (int=4) - the minimum channel width to detect as a line by line finder

  • edge (intArray=[0, 0]) - channels to drop at beginning and end of spectrum in line finding

subtract_baseline_variable(datacolumn='data', outfile='', bloutput='', dosubtract=True, spw='', updateweight=False, sigmavalue='stddev', verbose=False)[source]

Invoke baseline subtraction by parameters stored in a file.

Fit baseline and subtract it from selected spectra. Fit parameters for each spectrum are obtained from a text file.

Parameters

  • datacolumn (string='data') - The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)

  • outfile (string='') - The name of output MeasurementSet

  • bloutput (string='') - The name(s) of Baseline to be output

  • dosubtract (bool=True) - Execute baseline subtraction from the input data

  • spw (variant='') - Spectral Window Ids (0 relative) to select; -1 interpreted as all

  • updateweight (bool=False) - Update weight based on sigmavalue of residual data

  • sigmavalue (string='stddev') - sigma value for computing weight

  • blparam (string='') - The name of text file that stores fit parameters for each spectrum of selected MS

  • verbose (bool=False) - Print fitting parameters of each spectrum to logger