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_sdcoadd 00013 def sdcoadd(infiles=[''], antenna=0, fluxunit='', telescopeparm='', specunit='', frame='', doppler='', scanaverage=False, timeaverage=False, tweight='none', polaverage=False, pweight='none', outfile='', outform='ASAP', overwrite=False): 00014 00015 """ASAP SD task: coadd multiple scantables into one 00016 Keyword arguments: 00017 infiles -- list of names of input SD dataset 00018 antenna -- antenna name or id (only effective for MS input). 00019 fluxunit -- units for line flux 00020 options: 'K','Jy','' 00021 default: '' (keep current fluxunit of the first data in the infiles) 00022 00023 >>> fluxunit expandable parameter 00024 telescopeparm -- the telescope characteristics 00025 options: (str) name or (list) list of gain info 00026 default: '' (none set) 00027 example: if telescopeparm='', it tries to get the telescope 00028 name from the data. 00029 Full antenna parameters (diameter,ap.eff.) known 00030 to ASAP are 00031 'ATPKSMB', 'ATPKSHOH', 'ATMOPRA', 'DSS-43', 00032 'CEDUNA','HOBART'. For GBT, it fixes default fluxunit 00033 to 'K' first then convert to a new fluxunit. 00034 telescopeparm=[104.9,0.43] diameter(m), ap.eff. 00035 telescopeparm=[0.743] gain in Jy/K 00036 telescopeparm='FIX' to change default fluxunit 00037 see description below 00038 00039 specunit -- units for spectral axis 00040 options: (str) 'channel','km/s','GHz','MHz','kHz','Hz' 00041 default: '' (=current) 00042 example: this will be the units for masklist 00043 frame -- frequency frame for spectral axis 00044 options: (str) 'LSRK','REST','TOPO','LSRD','BARY', 00045 'GEO','GALACTO','LGROUP','CMB' 00046 default: currently set frame in scantable 00047 WARNING: frame='REST' not yet implemented 00048 doppler -- doppler mode 00049 options: (str) 'RADIO','OPTICAL','Z','BETA','GAMMA' 00050 default: currently set doppler in scantable 00051 scanaverage -- average integrations within scans 00052 options: (bool) True,False 00053 default: False 00054 example: if True, this happens in read-in 00055 For GBT, set False! 00056 timeaverage -- average times for multiple scan cycles 00057 options: (bool) True,False 00058 default: False 00059 example: if True, this happens after calibration 00060 00061 >>>timeaverage expandable parameter 00062 tweight -- weighting for time average 00063 options: 'none' 00064 'var' (1/var(spec) weighted) 00065 'tsys' (1/Tsys**2 weighted) 00066 'tint' (integration time weighted) 00067 'tintsys' (Tint/Tsys**2) 00068 'median' ( median averaging) 00069 default: 'none' 00070 00071 polaverage -- average polarizations 00072 options: (bool) True,False 00073 default: False 00074 00075 >>>polaverage expandable parameter 00076 pweight -- weighting for polarization average 00077 options: 'none' 00078 'var' (1/var(spec) weighted) 00079 'tsys' (1/Tsys**2 weighted) 00080 default: 'none' 00081 00082 outfile -- Name of output file 00083 default: '' (scantable) 00084 example: 00085 outform -- format of output file 00086 options: 'ASCII','SDFITS','MS','ASAP' 00087 default: 'ASAP' 00088 example: the ASAP format is easiest for further sd 00089 processing; use MS for CASA imaging. 00090 If ASCII, then will append some stuff to 00091 the outfile name 00092 overwrite -- overwrite the output file if already exists 00093 options: (bool) True,False 00094 default: False 00095 WARNING: if outform='ASCII', this parameter is ignored 00096 00097 00098 00099 DESCRIPTION: 00100 00101 Task sdcoadd performs co-add multiple single dish spectral data given by 00102 a list of spectral data file names in any of the following formats, 00103 ASAP, MS2,SDFITS, and ASCII. 00104 The units of line flux, the units of spectral axis, frame, and doppler 00105 are assumed to be those of the first one in the infiles if not 00106 specified. 00107 timaverage and polaverage are used to perform time 00108 and polarization averaging over scans on the co-added scantable before 00109 saving to a file on disk. 00110 00111 WARNING for the GBT raw SDFITS format data as input: 00112 SDtasks are able to handle GBT raw SDFITS format data since the 00113 data filler is available. However, the functionality is not well 00114 tested yet, so that there may be unknown bugs. 00115 00116 00117 """ 00118 if type(infiles)==str: infiles=[infiles] 00119 00120 # 00121 # The following is work around to avoid a bug with current python translation 00122 # 00123 mytmp = {} 00124 00125 mytmp['infiles'] = infiles 00126 mytmp['antenna'] = antenna 00127 mytmp['fluxunit'] = fluxunit 00128 mytmp['telescopeparm'] = telescopeparm 00129 mytmp['specunit'] = specunit 00130 mytmp['frame'] = frame 00131 mytmp['doppler'] = doppler 00132 mytmp['scanaverage'] = scanaverage 00133 mytmp['timeaverage'] = timeaverage 00134 mytmp['tweight'] = tweight 00135 mytmp['polaverage'] = polaverage 00136 mytmp['pweight'] = pweight 00137 mytmp['outfile'] = outfile 00138 mytmp['outform'] = outform 00139 mytmp['overwrite'] = overwrite 00140 pathname='file:///'+os.environ.get('CASAPATH').split()[0]+'/share/xml/' 00141 trec = casac.utils().torecord(pathname+'sdcoadd.xml') 00142 00143 casalog.origin('sdcoadd') 00144 if trec.has_key('sdcoadd') and casac.utils().verify(mytmp, trec['sdcoadd']) : 00145 result = task_sdcoadd.sdcoadd(infiles, antenna, fluxunit, telescopeparm, specunit, frame, doppler, scanaverage, timeaverage, tweight, polaverage, pweight, outfile, outform, overwrite) 00146 00147 else : 00148 result = False 00149 return result