sdsmooth

sdsmooth(infile, datacolumn='data', antenna='', field='', spw='', timerange='', scan='', pol='', intent='', reindex=True, kernel='gaussian', kwidth=5, outfile='', overwrite=False)[source]

Smooth spectral data

[Description] [Examples] [Development] [Details]

Parameters
  • infile (path) - name of input SD dataset

  • datacolumn (string=’data’) - name of data column to be used [“data”, “float_data”, or “corrected”]

  • antenna (string=’’) - select data by antenna name or ID, e.g. “PM03”

  • field (string=’’) - select data by field IDs and names, e.g. “3C2*” (“”=all)

  • spw (string=’’) - select data by spectral window IDs, e.g. “3,5,7” (“”=all)

  • timerange (string=’’) - select data by time range, e.g. “09:14:0~09:54:0” (“”=all) (see examples in help)

  • scan (string=’’) - select data by scan numbers, e.g. “21~23” (“”=all)

  • pol (string=’’) - select data by polarization IDs, e.g. “0,1” (“”=all)

  • intent (string=’’) - select data by observational intent, e.g. “ON_SOURCE” (“”=all)

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

  • kernel (string=’gaussian’) - spectral smoothing kernel type

    kernel = gaussian
    • kwidth (int=5) - smoothing kernel width in channel

    kernel = boxcar
    • kwidth (int=5) - smoothing kernel width in channel

  • outfile (string=’’) - name of output file

  • overwrite (bool=False) - overwrite the output file if already exists [True, False]

Description

Task sdsmooth performs smoothing along the spectral axis using a user-specified smoothing kernel. Currently, ‘Gaussian’ and ‘boxcar’ kernels are supported.

The default Kernel shape is ‘Gaussian’. The width of the function is specified with the kwidth parameter, in number of channels.

Standard data selection parameters are used: antenna, field, spw, scan, timerange, pol, and intent.

Weights are propagated to smoothed spectra following:

\(W^{k}_{m out} = \frac{ (\sum_{i=1}^{n} c_{i})^{2} } { (\sum_{i=1}^{n} c^{2}_{i} / W^{j+i}_{m inp}) }\)

where \(W\) is the input/output weight, \(c\) is the spectral smoothing kernel originated from a channel \(k\) where the weight is evaluated, and \(n\) is the width of the spectral smoothing kernel in channels. In the case of Gaussian, \(n\) corresponds to FWHM in channels.

Examples

To spectrally smooth part of a data set for both polarizations, selecting by frequency and scan with a boxcar kernel having a width of 50 channels:

sdsmooth(infile='sd_data.ms', spw='116~117GHz', scan='21~23', pol='0,1',
         kernel='boxcar', kwidth='50', antenna='PM03', outfile='sd_data_smoothed.ms',
         overwrite=True)
Development

No additional development details

Parameter Details

Detailed descriptions of each function parameter

infile (path) - name of input SD dataset
datacolumn (string='data') - name of data column to be used [“data”, “float_data”, or “corrected”]
antenna (string='') - select data by antenna name or ID, e.g. “PM03”
field (string='') - select data by field IDs and names, e.g. “3C2*” (“”=all)
spw (string='') - select data by spectral window IDs, e.g. “3,5,7” (“”=all)
timerange (string='') - select data by time range, e.g. “09:14:0~09:54:0” (“”=all) (see examples in help)
scan (string='') - select data by scan numbers, e.g. “21~23” (“”=all)
pol (string='') - select data by polarization IDs, e.g. “0,1” (“”=all)
intent (string='') - select data by observational intent, e.g. “ON_SOURCE” (“”=all)
reindex (bool=True) - Re-index indices in subtables based on data selection
kernel (string='gaussian') - spectral smoothing kernel type
kwidth (int=5) - smoothing kernel width in channel
outfile (string='') - name of output file
overwrite (bool=False) - overwrite the output file if already exists