Changeset 1880 for trunk/python
- Timestamp:
- 08/20/10 12:53:05 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r1862 r1880 945 945 """ 946 946 # Import the table toolkit from CASA 947 948 947 import casac 949 948 tbtool = casac.homefinder.find_home_by_name('tableHome') 950 949 tb = tbtool.create() 951 tb2 = tbtool.create()952 950 # Check the input filename 953 951 if isinstance(filename, str): … … 973 971 prefix=filename.rstrip('/') 974 972 # Now do the actual splitting. 973 # 2010/08/20 TN 974 # The antenna parameter for scantable constructor is ineffective at the moemnt. 975 # Thus, we should go back to original implementation of splitant. 976 ## outfiles=[] 977 ## tb.open(tablename=filename+'/ANTENNA',nomodify=True) 978 ## nant=tb.nrows() 979 ## antnames=tb.getcol('NAME',0,nant,1) 980 ## antpos=tb.getcol('POSITION',0,nant,1).transpose() 981 ## tb.close() 982 ## tb.open(tablename=filename,nomodify=True) 983 ## ant1=tb.getcol('ANTENNA1',0,-1,1) 984 ## tb.close() 985 ## for antid in set(ant1): 986 ## scan=scantable(filename,average=False,getpt=True,antenna=int(antid)) 987 ## outname=prefix+antnames[antid]+'.asap' 988 ## scan.save(outname,format='ASAP',overwrite=overwrite) 989 ## del scan 990 ## outfiles.append(outname) 975 991 outfiles=[] 976 992 tb.open(tablename=filename+'/ANTENNA',nomodify=True) 977 993 nant=tb.nrows() 978 994 antnames=tb.getcol('NAME',0,nant,1) 979 antpos=tb.getcol('POSITION',0,nant,1).transpose()980 995 tb.close() 981 996 tb.open(tablename=filename,nomodify=True) 982 997 ant1=tb.getcol('ANTENNA1',0,-1,1) 983 t b.close()998 tmpname='asapmath.splitant.tmp' 984 999 for antid in set(ant1): 985 scan=scantable(filename,average=False,getpt=True,antenna=int(antid)) 1000 tbsel=tb.query('ANTENNA1 == %s && ANTENNA2 == %s'%(antid,antid)) 1001 tbsel.copy(tmpname,deep=True) 1002 #tbsel=tb.query('ANTENNA1 == %s && ANTENNA2 == %s'%(antid,antid),tmpname) 1003 tbsel.close() 1004 del tbsel 1005 scan=scantable(tmpname,average=False,getpt=True,antenna=int(antid)) 986 1006 outname=prefix+antnames[antid]+'.asap' 987 1007 scan.save(outname,format='ASAP',overwrite=overwrite) 988 1008 del scan 989 1009 outfiles.append(outname) 990 del tb, tb2 1010 os.system('rm -rf '+tmpname) 1011 tb.close() 1012 del tb 991 1013 return outfiles 992 1014
Note:
See TracChangeset
for help on using the changeset viewer.