Changeset 1588 for trunk/python


Ignore:
Timestamp:
07/02/09 11:02:45 (15 years ago)
Author:
Malte Marquarding
Message:

Added method get_row_selector, which returns a selection object for the a specific row

Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r1586 r1588  
    3232    os.mkdir(userdir)
    3333    shutil.copyfile(asapdata+"/data/ipythonrc-asap", userdir+"/ipythonrc-asap")
    34     shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 
     34    shutil.copyfile(asapdata+"/data/ipy_user_conf.py",
    3535                    userdir+"/ipy_user_conf.py")
    3636    f = file(userdir+"/asapuserfuncs.py", "w")
     
    4141    # upgrade to support later ipython versions
    4242    if not os.path.exists(userdir+"/ipy_user_conf.py"):
    43         shutil.copyfile(asapdata+"/data/ipy_user_conf.py", 
     43        shutil.copyfile(asapdata+"/data/ipy_user_conf.py",
    4444                        userdir+"/ipy_user_conf.py")
    4545
     
    284284
    285285def _n_bools(n, val):
    286     return [ val for i in xrange(n) ] 
     286    return [ val for i in xrange(n) ]
    287287
    288288def _is_sequence_or_number(param, ptype=int):
     
    395395def is_ipython():
    396396    return '__IP' in dir(sys.modules["__main__"])
     397   
    397398if is_ipython():
    398399    def version(): print  "ASAP %s(%s)"% (__version__, __date__)
    399    
    400     def list_scans(t = scantable):       
     400
     401    def list_scans(t = scantable):
    401402        import inspect
    402403        print "The user created scantables are: ",
     
    499500            stddev          - Determine the standard deviation of the current
    500501                              beam/if/pol
     502            get_row_selector - get the selection object for a specified row
     503                               number
    501504     [Selection]
    502505         selector              - a selection object to set a subset of a scantable
  • trunk/python/scantable.py

    r1586 r1588  
    16971697        s = None
    16981698        if isinstance(other, scantable):
    1699             s = scantable(self._math._binaryop(self, other, "SUB"))
     1699            s = scantable(self._math._binaryop(self, other, "SUB"))
    17001700        elif isinstance(other, float):
    17011701            s = scantable(self._math._unaryop(self, other, "SUB", False))
     
    17131713        s = None
    17141714        if isinstance(other, scantable):
    1715             s = scantable(self._math._binaryop(self, other, "MUL"))
     1715            s = scantable(self._math._binaryop(self, other, "MUL"))
    17161716        elif isinstance(other, float):
    17171717            s = scantable(self._math._unaryop(self, other, "MUL", False))
     
    17761776        self.set_selection(basesel)
    17771777
     1778    def get_row_selector(self, rowno):
     1779        return selector(beams=self.getbeam(rowno),
     1780                        ifs=self.getif(rowno),
     1781                        pols=self.getpol(rowno),
     1782                        scans=self.getscan(rowno),
     1783                        cycles=self.getcycle(rowno))
    17781784
    17791785    def _add_history(self, funcname, parameters):
Note: See TracChangeset for help on using the changeset viewer.