Changeset 1918


Ignore:
Timestamp:
09/01/10 18:34:16 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Bug fix on splitant.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r1883 r1918  
    1 from asap.scantable import scantable, is_ms
     1from asap.scantable import scantable
    22from asap.parameters import rcParams
    33from asap.logging import asaplog, asaplog_post_dec
     
    946946    # Import the table toolkit from CASA
    947947    import casac
     948    from asap.scantable import is_ms
    948949    tbtool = casac.homefinder.find_home_by_name('tableHome')
    949950    tb = tbtool.create()
     
    972973        prefix=filename.rstrip('/')
    973974    # Now do the actual splitting.
    974     # 2010/08/20 TN
    975     # 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 scan
    991 ##         outfiles.append(outname)
    992975    outfiles=[]
    993976    tb.open(tablename=filename+'/ANTENNA',nomodify=True)
     
    1001984    for antid in set(ant1):
    1002985        tb.open(tablename=filename,nomodify=True)
    1003         #tbsel=tb.query('ANTENNA1 == %s && ANTENNA2 == %s'%(antid,antid))
    1004         #tbsel.copy(tmpname,deep=True)
    1005986        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)
    1006990        tbsel.close()
    1007991        tb.close()
    1008992        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)
    1012993        del scan
    1013994        outfiles.append(outname)
    1014995        os.system('rm -rf '+tmpname)
    1015     tb.close()
    1016996    del tb
    1017997    return outfiles
Note: See TracChangeset for help on using the changeset viewer.