Changeset 1402
- Timestamp:
- 01/31/08 14:09:52 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1395 r1402 1775 1775 self.set_freqframe(rcParams['scantable.freqframe']) 1776 1776 1777 def __getitem__(self, key): 1778 if key < 0: 1779 key += self.nrow() 1780 if key >= self.nrow(): 1781 raise IndexError("Row index out of range.") 1782 return self._getspectrum(key) 1783 1784 def __setitem__(self, key, value): 1785 if key < 0: 1786 key += self.nrow() 1787 if key >= self.nrow(): 1788 raise IndexError("Row index out of range.") 1789 if not hasattr(value, "__len__") or \ 1790 len(value) > self.nchan(self.getif(key)): 1791 raise ValueError("Spectrum length doesn't match.") 1792 return self._setspectrum(value, key) 1793 1794 def __len__(self): 1795 return self.nrow() 1796 1797 def __iter__(self): 1798 for i in range(len(self)): 1799 yield self[i]
Note:
See TracChangeset
for help on using the changeset viewer.