casa
$Rev:20696$
|
00001 # 00002 # This file was generated using xslt from its XML file 00003 # 00004 # Copyright 2009, Associated Universities Inc., Washington DC 00005 # 00006 import sys 00007 import os 00008 from casac import * 00009 import string 00010 from taskinit import casalog 00011 #from taskmanager import tm 00012 import task_caltabconvert 00013 def caltabconvert(caltabold='', vis='', ptype='complex', caltabnew=''): 00014 00015 """Convert old-style caltables into new-style caltables.\n 00016 This task converts old-style (up to CASA 3.3.0) caltables into new-style 00017 (CASA 3.4.0 and later) caltables. It is provided as a convenience and 00018 is strictly temporary. The information transferred should be enough 00019 for most calibration purposes. BPOLY and GSPLINE versions are not 00020 supported. Only simple bugs will be fixed. If there are other issues, 00021 it is suggested that a new-style caltable be created directly. 00022 00023 Arguments: 00024 00025 caltabold -- Name of the old-style caltable. 00026 default: none 00027 example: caltabold='gronk.g0' 00028 00029 vis -- Name of the visibility file (MS) associated with the old-style 00030 caltable. 00031 default: none 00032 example: vis='blurp.ms' 00033 00034 ptype -- Type of data in the new-format caltable. 00035 default: "complex"; allowed values: "complex" or "float" 00036 example: ptype="complex" 00037 00038 NB: The old-style caltables do not have this information, so it is 00039 imperative that users get it correct. "complex" refers to caltables that 00040 have complex gains (e.g., produced by gaincal, bpcal, etc.). "float" refers 00041 to caltables that real numbers such as delays (e.g., produced by gencal). 00042 00043 caltabnew -- Name of the new-style caltable. 00044 default: "" --> the suffix ".new" is appended to the name of the old-style 00045 caltable 00046 example: caltabold='gronk_new.g0' 00047 00048 """ 00049 00050 # 00051 # The following is work around to avoid a bug with current python translation 00052 # 00053 mytmp = {} 00054 00055 mytmp['caltabold'] = caltabold 00056 mytmp['vis'] = vis 00057 mytmp['ptype'] = ptype 00058 mytmp['caltabnew'] = caltabnew 00059 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00060 trec = casac.utils().torecord(pathname+'caltabconvert.xml') 00061 00062 casalog.origin('caltabconvert') 00063 if trec.has_key('caltabconvert') and casac.utils().verify(mytmp, trec['caltabconvert']) : 00064 result = task_caltabconvert.caltabconvert(caltabold, vis, ptype, caltabnew) 00065 00066 else : 00067 result = False 00068 return result