from __future__ import absolute_import
from casatasks.private.casa_transition import *
from casatools import table, quanta
from casatools import ms as mstool
from casatasks import casalog
from .mstools import write_history
from mstools import write_history
passall, field, spw, selectdata, antenna, timerange, scan, array,
mode, nchan, start, width, interpolation,
phasecenter, restfreq, outframe, veltype, hanning):
""" regrid an MS to a new spectral window / channel structure or frame
vis -- Name of input visibility file
default: none; example: vis='ngc5921.ms'
outputvis -- Name of output measurement set (required)
default: none; example: vis='ngc5921-regridded.ms'
passall -- if False, data not meeting the selection on field or spw
is omitted; if True, data not meeting the selection
is passed through without modification
passall=False : only data from NGC5921 is included in output MS,
no data from other fields (e.g. 1331+305) is included
passall=True : data from NGC5921 is transformed by cvel, all other
fields are passed through unchanged
field -- Select fields in MS. Use field id(s) or field name(s).
['go listobs' to obtain the list id's or names]
If field string is a non-negative integer, it is assumed to
be a field index otherwise, it is assumed to be a
field='0~2'; field ids 0,1,2
field='0,4,5~7'; field ids 0,4,5,6,7
field='3C286,3C295'; field named 3C286 and 3C295
field = '3,4C*'; field id 3, all names starting with 4C
spw --Select spectral window/channels
NOTE: This selects the data passed as the INPUT to mode
default: ''=all spectral windows and channels
spw='0~2,4'; spectral windows 0,1,2,4 (all channels)
spw='0:5~61'; spw 0, channels 5 to 61
spw='<2'; spectral windows less than 2 (i.e. 0,1)
spw='0,10,3:3~45'; spw 0,10 all channels, spw 3,
spw='0~2:2~6'; spw 0,1,2 with channels 2 through 6 in each.