Changeset 2933


Ignore:
Timestamp:
04/22/14 12:50:16 (11 years ago)
Author:
WataruKawasaki
Message:

New Development: No

JIRA Issue: Yes CAS-6465

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sd

Description: modified sd.scantable.parse_spw_selection() so that adjacent channel ranges in the same spw in the output merged into one range. for example, a result before this modification {20:0.0,30.0],[31.0,40.0} now should be {20:0.0,40.0}.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r2932 r2933  
    21462146        for spw in res.keys():
    21472147            if spw in valid_ifs:
    2148                 # remove duplicated chennal ranges
     2148                # remove duplicated channel ranges
    21492149                for i in reversed(xrange(len(res[spw]))):
    21502150                    for j in xrange(i):
    2151                         if ((res[spw][i][0]-res[spw][j][1])*(res[spw][i][1]-res[spw][j][0]) <= 0):
     2151                        if ((res[spw][i][0]-res[spw][j][1])*(res[spw][i][1]-res[spw][j][0]) <= 0) or \
     2152                            (min(abs(res[spw][i][0]-res[spw][j][1]),abs(res[spw][j][0]-res[spw][i][1])) == 1):
    21522153                            res[spw][j][0] = min(res[spw][i][0], res[spw][j][0])
    21532154                            res[spw][j][1] = max(res[spw][i][1], res[spw][j][1])
Note: See TracChangeset for help on using the changeset viewer.