- Timestamp:
- 09/01/10 18:34:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r1883 r1918 1 from asap.scantable import scantable , is_ms1 from asap.scantable import scantable 2 2 from asap.parameters import rcParams 3 3 from asap.logging import asaplog, asaplog_post_dec … … 946 946 # Import the table toolkit from CASA 947 947 import casac 948 from asap.scantable import is_ms 948 949 tbtool = casac.homefinder.find_home_by_name('tableHome') 949 950 tb = tbtool.create() … … 972 973 prefix=filename.rstrip('/') 973 974 # Now do the actual splitting. 974 # 2010/08/20 TN975 # The antenna parameter for scantable constructor is ineffective at the moemnt.976 # Thus, we should go back to original implementation of splitant.977 ## outfiles=[]978 ## tb.open(tablename=filename+'/ANTENNA',nomodify=True)979 ## nant=tb.nrows()980 ## antnames=tb.getcol('NAME',0,nant,1)981 ## antpos=tb.getcol('POSITION',0,nant,1).transpose()982 ## tb.close()983 ## tb.open(tablename=filename,nomodify=True)984 ## ant1=tb.getcol('ANTENNA1',0,-1,1)985 ## tb.close()986 ## for antid in set(ant1):987 ## scan=scantable(filename,average=False,getpt=True,antenna=int(antid))988 ## outname=prefix+antnames[antid]+'.asap'989 ## scan.save(outname,format='ASAP',overwrite=overwrite)990 ## del scan991 ## outfiles.append(outname)992 975 outfiles=[] 993 976 tb.open(tablename=filename+'/ANTENNA',nomodify=True) … … 1001 984 for antid in set(ant1): 1002 985 tb.open(tablename=filename,nomodify=True) 1003 #tbsel=tb.query('ANTENNA1 == %s && ANTENNA2 == %s'%(antid,antid))1004 #tbsel.copy(tmpname,deep=True)1005 986 tbsel=tb.query('ANTENNA1 == %s && ANTENNA2 == %s'%(antid,antid),tmpname) 987 scan=scantable(tmpname,average=False,getpt=True,antenna=int(antid)) 988 outname=prefix+antnames[antid]+'.asap' 989 scan.save(outname,format='ASAP',overwrite=overwrite) 1006 990 tbsel.close() 1007 991 tb.close() 1008 992 del tbsel 1009 scan=scantable(tmpname,average=False,getpt=True,antenna=int(antid))1010 outname=prefix+antnames[antid]+'.asap'1011 scan.save(outname,format='ASAP',overwrite=overwrite)1012 993 del scan 1013 994 outfiles.append(outname) 1014 995 os.system('rm -rf '+tmpname) 1015 tb.close()1016 996 del tb 1017 997 return outfiles
Note:
See TracChangeset
for help on using the changeset viewer.