##################### generated by xml-casa (v2) from hifv_exportdata.xml ###########
##################### 01994676b2623dab06c68cd715b696e9 ##############################
from __future__ import absolute_import
import numpy
from casatools.typecheck import CasaValidator as _val_ctor
_pc = _val_ctor( )
from casatools.coercetype import coerce as _coerce
from .private.task_hifv_exportdata import hifv_exportdata as _hifv_exportdata_t
from casatasks.private.task_logging import start_log as _start_log
from casatasks.private.task_logging import end_log as _end_log
class _hifv_exportdata:
"""
hifv_exportdata ---- Prepare interferometry data for export
The hifv_exportdata task for the VLA CASA pipeline exports the data defined
in the pipeline context and exports it to the data products directory,
converting and or packing it as necessary.
The current version of the task exports the following products
o an XML file containing the pipeline processing request
o a tar file per ASDM / MS containing the final flags version
o a text file per ASDM / MS containing the final calibration apply list
o a FITS image for each selected calibrator source image
o a FITS image for each selected science target source image
o a tar file per session containing the caltables for that session
o a tar file containing the file web log
o a text file containing the final list of CASA commands
Issues
Support for merging the calibration state information into the pipeline
context / results structure and retrieving it still needs to be added.
Support for merging the clean results into the pipeline context / results
structure and retrieving it still needs to be added.
Support for creating the final pipeline results entity still needs to
be added.
Session information is not currently handled by the pipeline context.
By default all ASDMs are combined into one session.
Output:
results -- If pipeline mode is 'getinputs' then None is returned. Otherwise
the results object for the pipeline task is returned.
--------- parameter descriptions ---------------------------------------------
vis List of visibility data files for which flagging and calibration
information will be exported. Defaults to the list maintained in the
pipeline context. Not available in pipelinemode='automatic'.
example: vis=['X227.ms', 'X228.ms']
session List of sessions one per visibility file. Currently defaults
to a single virtual session containing all the visibility files in vis.
In the future, this will default to the set of observing sessions defined
in the context. Not available in pipelinemode='automatic'.
example: session=['session1', 'session2']
imaging_products_only Export science target imaging products only
exportmses Export the final MeasurementSets instead of the final flags,
calibration tables, and calibration instructions.
exportcalprods Export flags and caltables in addition to MeasurementSets.
this parameter is only valid when exportmses = True.
pprfile Name of the pipeline processing request to be exported. Defaults
to a file matching the template 'PPR_*.xml'. Not available in pipelinemode='automatic'.
example: pprfile=['PPR_GRB021004.xml']
calintents List of calibrator image types to be exported. Defaults to
all standard calibrator intents, 'BANDPASS', 'PHASE', 'FLUX'.
Not available in pipelinemode='automatic'.
example: 'PHASE'
calimages List of calibrator images to be exported. Defaults to all
calibrator images recorded in the pipeline context.
Not available in pipelinemode='automatic'.
example: calimages=['3C454.3.bandpass', '3C279.phase']
targetimages List of science target images to be exported. Defaults to all
science target images recorded in the pipeline context.
Not available in pipelinemode='automatic'.
example: targetimages=['NGC3256.band3', 'NGC3256.band6']
products_dir Name of the data products subdirectory. Defaults to './'
Not available in pipelinemode='automatic'.
example: '../products'
gainmap The value of gainmap parameter in hifv_restoredata task put in
casa_piperestorescript.py
pipelinemode The pipeline operating mode. In 'automatic' mode the pipeline
determines the values of all context defined pipeline inputs automatically.
In 'interactive' mode the user can set the pipeline context defined
parameters manually. In 'getinputs' mode the user can check the settings
of all pipeline parameters without running the task.
dryrun Run the task (False) or display task command (True).
Only available in pipelinemode='interactive'.
acceptresults Add the results of the task to the pipeline context (True) or
reject them (False). Only available in pipelinemode='interactive'.
--------- examples -----------------------------------------------------------
1. Export the pipeline results for a single session to the data products
directory
!mkdir ../products
hifv_exportdata (products_dir='../products')
2. Export the pipeline results to the data products directory specify that
only the gain calibrator images be saved.
!mkdir ../products
hifv_exportdata (products_dir='../products', calintents='*PHASE*')
"""
_info_group_ = """pipeline"""
_info_desc_ = """Prepare interferometry data for export"""
def __call__( self, vis=[ ], session=[ ], imaging_products_only=False, exportmses=False, exportcalprods=False, pprfile='', calintents='', calimages=[ ], targetimages=[ ], products_dir='', gainmap=False, pipelinemode='automatic', dryrun=False, acceptresults=True ):
schema = {'vis': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'session': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'imaging_products_only': {'type': 'cBool'}, 'exportmses': {'type': 'cBool'}, 'exportcalprods': {'type': 'cBool'}, 'pprfile': {'type': 'cStr', 'coerce': _coerce.to_str}, 'calintents': {'type': 'cStr', 'coerce': _coerce.to_str}, 'calimages': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'targetimages': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}, 'products_dir': {'type': 'cStr', 'coerce': _coerce.to_str}, 'gainmap': {'type': 'cBool'}, 'pipelinemode': {'type': 'cStr', 'coerce': _coerce.to_str, 'allowed': [ 'automatic', 'interactive', 'getinputs' ]}, 'dryrun': {'type': 'cBool'}, 'acceptresults': {'type': 'cBool'}}
doc = {'vis': vis, 'session': session, 'imaging_products_only': imaging_products_only, 'exportmses': exportmses, 'exportcalprods': exportcalprods, 'pprfile': pprfile, 'calintents': calintents, 'calimages': calimages, 'targetimages': targetimages, 'products_dir': products_dir, 'gainmap': gainmap, 'pipelinemode': pipelinemode, 'dryrun': dryrun, 'acceptresults': acceptresults}
assert _pc.validate(doc,schema), str(_pc.errors)
_logging_state_ = _start_log( 'hifv_exportdata', [ 'vis=' + repr(_pc.document['vis']), 'session=' + repr(_pc.document['session']), 'imaging_products_only=' + repr(_pc.document['imaging_products_only']), 'exportmses=' + repr(_pc.document['exportmses']), 'exportcalprods=' + repr(_pc.document['exportcalprods']), 'pprfile=' + repr(_pc.document['pprfile']), 'calintents=' + repr(_pc.document['calintents']), 'calimages=' + repr(_pc.document['calimages']), 'targetimages=' + repr(_pc.document['targetimages']), 'products_dir=' + repr(_pc.document['products_dir']), 'gainmap=' + repr(_pc.document['gainmap']), 'pipelinemode=' + repr(_pc.document['pipelinemode']), 'dryrun=' + repr(_pc.document['dryrun']), 'acceptresults=' + repr(_pc.document['acceptresults']) ] )
return _end_log( _logging_state_, 'hifv_exportdata', _hifv_exportdata_t( _pc.document['vis'], _pc.document['session'], _pc.document['imaging_products_only'], _pc.document['exportmses'], _pc.document['exportcalprods'], _pc.document['pprfile'], _pc.document['calintents'], _pc.document['calimages'], _pc.document['targetimages'], _pc.document['products_dir'], _pc.document['gainmap'], _pc.document['pipelinemode'], _pc.document['dryrun'], _pc.document['acceptresults'] ) )
hifv_exportdata = _hifv_exportdata( )