Examples

If you already have your SD data in MS format, you can operate on that data as follows. Here is an example to fit 3rd order polynomials to spectra stored in the FLOAT_DATA column with field='M100' and with spw=5 and 7, subtract it, then save the residual spectra into another file:

sdms.open('foo.ms')

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

sdms.subtract_baseline(order=3, datacolumn='float_data', outfile='bar.ms')

sdms.close()

When importing SD data from other data formats than MS, do as follows:

sdms.importnro(infile='foo.Y', outfile='bar.ms')      # import from NOSTAR format

 or

sdms.importasap(infile='foo.asap', outfile='baz.ms')  # import from Scantable

Once you get your data in MS format, you can process it as shown in the code sample at the top of this page.