Changeset 402 for trunk/python


Ignore:
Timestamp:
02/09/05 22:30:23 (20 years ago)
Author:
kil064
Message:

add lines arg to funciton set_restfreqs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r393 r402  
    496496        return list(self._getrestfreqs())
    497497
    498     def set_restfreqs(self, freqs, unit='Hz', source=None, theif=None):
     498    def lines(self):
     499        """
     500        Print the list of known spectral lines
     501        """
     502        sdtable._lines(self)
     503
     504    def set_restfreqs(self, freqs=None, unit='Hz', lines=None, source=None, theif=None):
    499505        """
    500506        Select the restfrequency for the specified source and IF OR
     
    511517        E.g. 'freqs=[1e9,2e9]'  would mean IF 0 gets restfreq 1e9 and
    512518        IF 1 gets restfreq 2e9.
    513         Parameters:
    514             freqs:   rest frequencies
     519
     520        You can also specify the frequencies via known line names
     521        in the argument 'lines'.  Use 'freqs' or 'lines'.  'freqs'
     522        takes precedence. See the list of known names via function
     523        scantable.lines()
     524        Parameters:
     525            freqs:   list of rest frequencies
    515526            unit:    unit for rest frequency (default 'Hz')
     527            lines:   list of known spectral lines names (alternative to freqs).
     528                     See possible list via scantable.lines()
    516529            source:  Source name (blank means all)
    517530            theif:   IF (-1 means all)
     
    527540        if t is int or t is float:
    528541           freqs = [freqs]
    529         sdtable._setrestfreqs(self, freqs, unit, source, theif)
     542        if freqs is None:
     543           freqs = []
     544        t = type(lines)
     545        if t is str:
     546           lines = [lines]
     547        if lines is None:
     548           lines = []
     549        sdtable._setrestfreqs(self, freqs, unit, lines, source, theif)
    530550        return
    531551
Note: See TracChangeset for help on using the changeset viewer.