from __future__ import absolute_import
from casatasks.private.casa_transition import *
from .parallel.parallel_task_helper import ParallelTaskHelper
from . import JPLephem_reader2 as jplreader
from casatools import ms as mstool
from casatools import table as tbtool
from casatools import imager as imtool
from casatools import measures, quanta
from casatasks import casalog
from .mstools import write_history
from mstools import write_history
from parallel.parallel_task_helper import ParallelTaskHelper
import recipes.ephemerides.JPLephem_reader2 as jplreader
def fixplanets(vis, field, fixuvw=False, direction='', refant=0, reftime='first'):
Fix FIELD, SOURCE, and UVW for given fields based on given direction or pointing
This task's main purpose is to correct observations which were performed
with correct pointing and correlation but for which incorrect direction
information was entered in the FIELD and SOURCE table of the MS.
If you actually want to change the phase center of the visibilties in an MS,
you should use task fixvis.
vis -- Name of the input visibility set
field -- field selection string
fixuvw -- recalc uvw coordinates? (default: False)
direction -- if set, don't use pointing table but set direction to this value.
The direction can either be given explicitly or as the path
to a JPL Horizons ephemeris (for an example of the format,
see directory data/ephemerides/JPL-Horizons/).
Alternatively, the ephemeris table can also be provided as mime format file,
i.e. a saved email as obtained via the commands (for example):
import recipes.ephemerides.request as jplreq
jplreq.request_from_JPL(objnam='Mars',startdate='2012-01-01',enddate='2014-12-31',
date_incr='0.1 d', get_axis_orientation=False, get_axis_ang_orientation=True,
get_sub_long=True, use_apparent=False, get_sep=False,
return_address='YOUR_EMAIL_ADDESS', mailserver='YOUR_MAIL_SERVER_ADDRESS')
example: 'J2000 19h30m00 -40d00m00', default= '' (use pointing table)
refant -- if using pointing table information, use it from this antenna
default: 0 (antenna id 0)
examples: 'DV06' (antenna with name DV06)