Ignore:
Timestamp:
08/21/06 10:48:45 (18 years ago)
Author:
mar637
Message:

lots of changes to support soft refresh, for things like text overlays, linecatlogs etc. reworked plot_lines to to auto-peak detection. added forwarding functions to matplotlib.axes. drawing functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1145 r1153  
    55from asap import selector
    66from asap import NUM
     7from asap import linecatalog
    78
    89class scantable(Scantable):
     
    707708        E.g. 'freqs=[1e9, 2e9]'  would mean IF 0 gets restfreq 1e9 and
    708709        IF 1 gets restfreq 2e9.
    709         You can also specify the frequencies via known line names
    710         from the built-in Lovas table.
     710        You can also specify the frequencies via a linecatalog/
     711
    711712        Parameters:
    712713            freqs:   list of rest frequency values or string idenitfiers
     
    738739        t = type(freqs)
    739740        if isinstance(freqs, int) or isinstance(freqs, float):
    740             self._setrestfreqs(freqs, unit)
     741            self._setrestfreqs(freqs, "",unit)
    741742        elif isinstance(freqs, list) or isinstance(freqs, tuple):
    742743            if isinstance(freqs[-1], int) or isinstance(freqs[-1], float):
     
    746747                    sel.set_ifs([i])
    747748                    self._setselection(sel)
    748                     self._setrestfreqs(freqs[i], unit)
     749                    self._setrestfreqs(freqs[i], "",unit)
    749750                self._setselection(savesel)
    750751            elif isinstance(freqs[-1], str):
    751752                # not yet implemented
    752753                pass
     754        elif isinstance(freqs, linecatalog):
     755            sel = selector()
     756            savesel = self._getselection()
     757            for i in xrange(freqs.nrow()):
     758                sel.set_ifs([i])
     759                self._setselection(sel)
     760                self._setrestfreqs(freqs.get_frequency(i),
     761                                   freqs.get_name(i), "MHz")
     762                # ensure that we are not iterating past nIF
     763                if i == self.nif()-1: break
     764            self._setselection(savesel)
    753765        else:
    754766            return
Note: See TracChangeset for help on using the changeset viewer.