singledishms
- class singledishms[source]
New single dish tool interface to process an MS
Methods Summary
For each row of given baseline table, read baseline parameters, construct baseline, then subtract it from the corresponding spectrum in the MS.
Offline atmospheric correction of calibrated data
This is used to close sdms tools.
This is used to close and sdms tools.
Fit line profile to selected spectra and obtain the best-fit parameter values
Import ASAP Scantable data to MeasurementSet.
Import NOSTAR data to MeasurementSet.
Returns the name of the attached MeasurementSet.
Close the current MeasurementSet and open a new MeasurementSet instead.
Select Measurementset to process
This is used to construct a singledishms tool instance.
NOTE: currently only Gaussian kernel is supported.
Fit baseline and subtract it from selected spectra
Fit baseline and subtract it from selected spectra
Fit baseline and subtract it from selected spectra
Fit baseline and subtract it from selected spectra.
- apply_baseline_table(bltable='', datacolumn='data', spw='', updateweight=False, sigmavalue='stddev', outfile='')[source]
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 Tabledatacolumn (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 allupdateweight (bool=False)
- Update weight based on sigmavalue of residual datasigmavalue (string='stddev')
- sigma value for computing weightoutfile (string='')
- The name of output MeasurementSet
Returns
bool
Examples
sdms.open('m100_sd.ms') sdms.set_selection(field='M100') sdms.apply_baseline_table('m100_sd.bltable')
- atmcor(config='', datacolumn='data', outfile='')[source]
Offline atmospheric correction of calibrated data
Parameters
config (record='')
- Configuration for atmospheric correctiondatacolumn (string='data')
- The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)outfile (string='')
- The name of output MeasurementSet
Returns
bool
- close()[source]
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]
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]
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 allpol (variant='')
- Select data by polarization(s)timebin (string='')
- Bin width for time averagingtimespan (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 profilenfit (string='0')
- Comma-separated numbers of gaussian/lorentzian lines to fit in maskline region. ignored when linefinding=True.linefinding (bool=False)
- do line findingthreshold (float=5.0)
- S/N threshold for line finderavg_limit (int=4)
- channel averaging for broad lines in line findingminwidth (int=4)
- the minimum channel width to detect as a line by line finderedge (intVec=[0, 0])
- channels to drop at beginning and end of spectrum in line findingtempfile (string='')
- The name of temporary file to keep fitting resultstempoutfile (string='')
- The name of temporary ms file
Returns
bool
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])
- importasap(infile='', outfile='', parallel=False)[source]
Import ASAP Scantable data to MeasurementSet.
Parameters
infile (string='')
- The name of input ASAP Scantableoutfile (string='')
- The name of output MeasurementSetparallel (bool=False)
- Turn on parallel execution
Returns
bool
- importnro(infile='', outfile='', parallel=False)[source]
Import NOSTAR data to MeasurementSet.
Parameters
infile (string='')
- The name of input NOSTAR dataoutfile (string='')
- The name of output MeasurementSetparallel (bool=False)
- Turn on parallel execution
Returns
bool
- open()[source]
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 (path='')
- New MeasurementSet to be processed
Returns
bool
Examples
sdms.open('m100_sd.ms')
- 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 allfield (variant='')
- Field Ids (0 relative) or Field names (msselection syntax and wilcards are used) to selectantenna (variant='')
- Antenna Ids (0 relative) or Antenna names (msselection syntax and wilcards are used) to selecttimerange (variant='')
- Limit data selected to be within a given time range. Syntax is defined in the msselection linkscan (variant='')
- Limit data selected on scan numbers. Syntax is defined in the msselection linkobservation (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 syntaxreindex (bool=True)
- Re-index indices in subtables based on data selection
Returns
bool
Examples
sdms.set_selection(field='M100', spw='3,5')
- singledishms()[source]
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]
NOTE: currently only Gaussian kernel is supported.
Parameters
type (string='gaussian')
- Smoothing kernel typewidth (float=0.0)
- Smoothing kernel widthdatacolumn (string='data')
- The name of data column to process (‘data’, ‘float_data’, or ‘corrected’)outfile (string='')
- The name of output MeasurementSet
Returns
bool
- 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]
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 MeasurementSetbloutput (string='')
- The name(s) of Baseline to be outputdosubtract (bool=True)
- Execute baseline subtraction from the input dataspw (variant='')
- Spectral Window Ids (0 relative) to select; -1 interpreted as allupdateweight (bool=False)
- Update weight based on sigmavalue of residual datasigmavalue (string='stddev')
- sigma value for computing weightblfunc (string='poly')
- baseline functionorder (int=5)
- polynomial orderclip_threshold_sigma (float=3.0)
- threshold for clipping in unit of sigmanum_fitting_max (int=1)
- maximum number of recursive clippinglinefinding (bool=False)
- do line findingthreshold (float=5.0)
- S/N threshold for line finderavg_limit (int=4)
- channel averaging for broad lines in line findingminwidth (int=4)
- the minimum channel width to detect as a line by line finderedge (intVec=[0, 0])
- channels to drop at beginning and end of spectrum in line finding
Returns
bool
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)
- 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]
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 MeasurementSetbloutput (string='')
- The name(s) of Baseline to be outputdosubtract (bool=True)
- Execute baseline subtraction from the input dataspw (variant='')
- Spectral Window Ids (0 relative) to select; -1 interpreted as allupdateweight (bool=False)
- Update weight based on sigmavalue of residual datasigmavalue (string='stddev')
- sigma value for computing weightnpiece (int=5)
- cspline npiececlip_threshold_sigma (float=3.0)
- threshold for clipping in unit of sigmanum_fitting_max (int=1)
- maximum number of recursive clippinglinefinding (bool=False)
- do line findingthreshold (float=5.0)
- S/N threshold for line finderavg_limit (int=4)
- channel averaging for broad lines in line findingminwidth (int=4)
- the minimum channel width to detect as a line by line finderedge (intVec=[0, 0])
- channels to drop at beginning and end of spectrum in line finding
Returns
bool
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)
- 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]
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 MeasurementSetbloutput (string='')
- The name(s) of Baseline to be outputdosubtract (bool=True)
- Execute baseline subtraction from the input dataspw (variant='')
- Spectral Window Ids (0 relative) to select; -1 interpreted as allupdateweight (bool=False)
- Update weight based on sigmavalue of residual datasigmavalue (string='stddev')
- sigma value for computing weightaddwn (string='0')
- additional wave numbers to userejwn (string='')
- reject specified wave numbersapplyfft (bool=False)
- automatically set wave numbers of sinusoidsfftmethod (string='fft')
- method to automatically set wave numbers of sinusoids [‘fft’]fftthresh (variant='3.0')
- threshold to select wave numbers of sinusoidsclip_threshold_sigma (float=3.0)
- threshold for clipping in unit of sigmanum_fitting_max (int=1)
- maximum number of recursive clippinglinefinding (bool=False)
- do line findingthreshold (float=5.0)
- S/N threshold for line finderavg_limit (int=4)
- channel averaging for broad lines in line findingminwidth (int=4)
- the minimum channel width to detect as a line by line finderedge (intVec=[0, 0])
- channels to drop at beginning and end of spectrum in line finding
Returns
bool
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)
- subtract_baseline_variable(datacolumn='data', outfile='', bloutput='', dosubtract=True, spw='', updateweight=False, sigmavalue='stddev', verbose=False)[source]
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 MeasurementSetbloutput (string='')
- The name(s) of Baseline to be outputdosubtract (bool=True)
- Execute baseline subtraction from the input dataspw (variant='')
- Spectral Window Ids (0 relative) to select; -1 interpreted as allupdateweight (bool=False)
- Update weight based on sigmavalue of residual datasigmavalue (string='stddev')
- sigma value for computing weightblparam (path='')
- The name of text file that stores fit parameters for each spectrum of selected MSverbose (bool=False)
- Print fitting parameters of each spectrum to logger
Returns
bool
Examples
sdms.open('m100_sd.ms') sdms.set_selection(field='M100') sdms.subtract_baseline_variable('m100_fitparam.txt')