from __future__ import absolute_import
from casatasks.private.casa_transition import *
from casatools import quanta, measures, table, ms, imager
from casatasks import casalog
from .mstools import write_history
def fixvis(vis, outputvis='',field='', refcode='', reuse=True, phasecenter='', distances='', datacolumn='all'):
vis -- Name of the input visibility set
outputvis -- Name of the output visibility set, default: same as vis
field -- field selection string
refcode -- Reference frame to convert to,
default: the refcode of PHASE_DIR in the FIELD table
reuse -- base recalculation on existing UVW coordinates? default=True
ignored if parameter 'phasecenter' is set
phasecenter -- if set to a valid direction: change the phase center for the given field
example: 'J2000 9h25m00s 05d12m00s'
If given without the equinox, e.g. '0h01m00s 00d12m00s', the parameter
is interpreted as a pair of offsets in RA and DEC to the present phasecenter.
distances -- (experimental) List of the distances (as quanta) of the fields selected by field
to be used for refocussing.
If empty, the distances of all fields are assumed to be infinity.
If not a list but just a single value is given, this is applied to
examples: ['2E6km', '3E6km'] '15au'
datacolumn -- when applying a phase center shift, modify visibilities only in this/these column(s)
default: 'all' (DATA, CORRECTED, and MODEL)
example: 'DATA,CORRECTED' (will not modify MODEL)
fixvis('NGC3256.ms','NGC3256-fixed.ms')
will recalculate the UVW coordinates for all fields based on the existing
phase center information in the FIELD table.
fixvis('0925+0512.ms','0925+0512-fixed.ms','0925+0512', '', 'J2000 9h25m00s 05d12m00s')
will set the phase center for field '0925+0512' to the given direction and recalculate