# Source code for casatools.singledishms

```#
# stub class definition file for docstring parsing
#

[docs]class singledishms:
r"""
New single dish tool interface to process an MS

"""

[docs]    def singledishms(self):
r"""
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.

"""

pass

[docs]    def open(self, ):
r"""
Close the current MeasurementSet and open a new MeasurementSet instead. The current state of sdms is retained, except for the data selection.

.. rubric:: Parameters

- ``ms_name (path='')`` - New MeasurementSet to be processed

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')

"""

pass

[docs]    def close(self):
r"""
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.

"""

pass

[docs]    def done(self):
r"""
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.

"""

pass

[docs]    def name(self):
r"""
Returns the name of the attached MeasurementSet.

"""

pass

[docs]    def subtract_baseline(self, 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]):
r"""
Fit baseline and subtract it from selected spectra

.. rubric:: 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 (intVec=[0, 0])`` - channels to drop at beginning and end of spectrum in line finding

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')
sdms.set_selection(field='M100')
sdms.subtract_baseline(order=3,clip_threshold_sigma=5.0,num_fitting_max=6)

"""

pass

[docs]    def subtract_baseline_cspline(self, 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]):
r"""
Fit baseline and subtract it from selected spectra

.. rubric:: 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 (intVec=[0, 0])`` - channels to drop at beginning and end of spectrum in line finding

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')
sdms.set_selection(field='M100')
sdms.subtract_baseline_cspline(npiece=3,clip_threshold_sigma=5.0,num_fitting_max=6)

"""

pass

[docs]    def subtract_baseline_sinusoid(self, 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]):
r"""
Fit baseline and subtract it from selected spectra

.. rubric:: 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
- ``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 (intVec=[0, 0])`` - channels to drop at beginning and end of spectrum in line finding

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')
sdms.set_selection(field='M100')
sdms.subtract_baseline_sinusoid(applyfft=True,clip_threshold_sigma=5.0,num_fitting_max=6)

"""

pass

[docs]    def subtract_baseline_variable(self, datacolumn='data', outfile='', bloutput='', dosubtract=True, spw='', updateweight=False, sigmavalue='stddev', verbose=False):
r"""
Fit baseline and subtract it from selected spectra. Fit parameters for each spectrum are obtained from a text file.

.. rubric:: 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 (path='')`` - 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

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')
sdms.set_selection(field='M100')
sdms.subtract_baseline_variable('m100_fitparam.txt')

"""

pass

[docs]    def apply_baseline_table(self, bltable='', datacolumn='data', spw='', updateweight=False, sigmavalue='stddev', outfile=''):
r"""
For each row of given baseline table, read baseline parameters, construct baseline, then subtract it from the corresponding spectrum in the MS.

.. rubric:: 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

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')
sdms.set_selection(field='M100')
sdms.apply_baseline_table('m100_sd.bltable')

"""

pass

[docs]    def fit_line(self, 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=''):
r"""
Fit line profile to selected spectra and obtain the best-fit parameter values

.. rubric:: 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 (intVec=[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

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.open('m100_sd.ms')
sdms.set_selection(field='M100')
sdms.fit_line(fitfunc='gauss',spw='0:1000~2000;4000~5000',nfit=[1,1])

"""

pass

[docs]    def set_selection(self, spw='', field='', antenna='', timerange='', scan='', observation='', polarization='', beam='', intent='', feed='', taql='', reindex=True):
r"""
Select Measurementset to process

.. rubric:: 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

.. rubric:: Returns

``bool``

.. rubric:: Examples

::

sdms.set_selection(field='M100', spw='3,5')

"""

pass

[docs]    def smooth(self, type='gaussian', width=0.0, datacolumn='data', outfile=''):
r"""
NOTE: currently only Gaussian kernel is supported.

.. rubric:: 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

.. rubric:: Returns

``bool``

"""

pass

[docs]    def atmcor(self, config='', datacolumn='data', outfile=''):
r"""
Offline atmospheric correction of calibrated data

.. rubric:: 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

.. rubric:: Returns

``bool``

"""

pass

[docs]    def importasap(self, infile='', outfile='', parallel=False):
r"""
Import ASAP Scantable data to MeasurementSet.

.. rubric:: Parameters

- ``infile (string='')`` - The name of input ASAP Scantable
- ``outfile (string='')`` - The name of output MeasurementSet
- ``parallel (bool=False)`` - Turn on parallel execution

.. rubric:: Returns

``bool``

"""

pass

[docs]    def importnro(self, infile='', outfile='', parallel=False):
r"""
Import NOSTAR data to MeasurementSet.

.. rubric:: Parameters

- ``infile (string='')`` - The name of input NOSTAR data
- ``outfile (string='')`` - The name of output MeasurementSet
- ``parallel (bool=False)`` - Turn on parallel execution

.. rubric:: Returns

``bool``

"""

pass

```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5509859,"math_prob":0.833686,"size":13746,"snap":"2023-14-2023-23","text_gpt3_token_len":3705,"char_repetition_ratio":0.15419881,"word_repetition_ratio":0.56683034,"special_character_ratio":0.3128183,"punctuation_ratio":0.1737818,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9965638,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-03-31T00:42:50Z\",\"WARC-Record-ID\":\"<urn:uuid:52d5285f-5bb2-45c5-b7a6-12b885754803>\",\"Content-Length\":\"54056\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9738e6cd-f8d6-47fa-9969-c06c74acaabc>\",\"WARC-Concurrent-To\":\"<urn:uuid:5e2e649d-7096-4654-81c3-fdf5d3e5c622>\",\"WARC-IP-Address\":\"104.17.32.82\",\"WARC-Target-URI\":\"https://casadocs.readthedocs.io/en/stable/_modules/casatools/singledishms.html\",\"WARC-Payload-Digest\":\"sha1:LUJK5D6GSLUCEPRLHL6Y45XVX3PGSNVM\",\"WARC-Block-Digest\":\"sha1:XSILBHPNBJEBW2QRYWS24H3VSFN6QJDH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-14/CC-MAIN-2023-14_segments_1679296949506.62_warc_CC-MAIN-20230330225648-20230331015648-00050.warc.gz\"}"}