Changeset 1005 for trunk/python


Ignore:
Timestamp:
04/07/06 10:10:50 (19 years ago)
Author:
mar637
Message:

added doc for get/set_selection. added default argument to set_selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1003 r1005  
    227227    def get_selection(self):
    228228        """
     229        Get the selection object currently set on this scantable.
     230        Parameters:
     231            none
     232        Example:
     233            sel = scan.get_selection()
     234            sel.set_ifs(0)              # select IF 0
     235            scan.set_selection(sel)     # apply modified selection
    229236        """
    230237        return selector(self._getselection())
    231238
    232     def set_selection(self, selection):
    233         """
     239    def set_selection(self, selection=selector()):
     240        """
     241        Select a subset of the data. All following operations on this scantable
     242        are only applied to thi selection.
     243        Parameters:
     244            selection:    a selector object (default unset the selection)
     245        Examples:
     246            sel = selector()         # create a selection object
     247            self.set_scans([0,3])    # select SCANNO 0 and 3
     248            scan.set_selection(sel)  # set the selection
     249            scan.summary()           # will only print summary of scanno 0 an 3
     250            scan.set_selection()     # unset the selection
    234251        """
    235252        self._setselection(selection)
Note: See TracChangeset for help on using the changeset viewer.