Changeset 1153 for trunk/python/scantable.py
- Timestamp:
- 08/21/06 10:48:45 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1145 r1153 5 5 from asap import selector 6 6 from asap import NUM 7 from asap import linecatalog 7 8 8 9 class scantable(Scantable): … … 707 708 E.g. 'freqs=[1e9, 2e9]' would mean IF 0 gets restfreq 1e9 and 708 709 IF 1 gets restfreq 2e9. 709 You can also specify the frequencies via known line names710 from the built-in Lovas table. 710 You can also specify the frequencies via a linecatalog/ 711 711 712 Parameters: 712 713 freqs: list of rest frequency values or string idenitfiers … … 738 739 t = type(freqs) 739 740 if isinstance(freqs, int) or isinstance(freqs, float): 740 self._setrestfreqs(freqs, unit)741 self._setrestfreqs(freqs, "",unit) 741 742 elif isinstance(freqs, list) or isinstance(freqs, tuple): 742 743 if isinstance(freqs[-1], int) or isinstance(freqs[-1], float): … … 746 747 sel.set_ifs([i]) 747 748 self._setselection(sel) 748 self._setrestfreqs(freqs[i], unit)749 self._setrestfreqs(freqs[i], "",unit) 749 750 self._setselection(savesel) 750 751 elif isinstance(freqs[-1], str): 751 752 # not yet implemented 752 753 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) 753 765 else: 754 766 return
Note: See TracChangeset
for help on using the changeset viewer.