Changeset 1256
- Timestamp:
- 09/11/06 14:17:47 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Release2.1.0b/python/asapplotter.py
r1252 r1256 412 412 if self._data: self.plot(self._data) 413 413 414 def plot_lines(self, linecat=None, doppler=0.0, deltachan=10, rotate= 0.0,414 def plot_lines(self, linecat=None, doppler=0.0, deltachan=10, rotate=90.0, 415 415 location=None): 416 416 """ … … 421 421 deltachan: the number of channels to include each side of the 422 422 line to determine a local maximum/minimum 423 rotate: the rotation for the text label423 rotate: the rotation (in degrees) )for the text label (default 90.0) 424 424 location: the location of the line annotation from the 'top', 425 425 'bottom' or alternate (None - the default) … … 427 427 If the spectrum is flagged no line will be drawn in that location. 428 428 """ 429 if not self._data: return 429 if not self._data: 430 raise RuntimeError("No scantable has been plotted yet.") 430 431 from asap._asap import linecatalog 431 if not isinstance(linecat, linecatalog): return 432 if not self._data.get_unit().endswith("GHz"): return 432 if not isinstance(linecat, linecatalog): 433 raise ValueError("'linecat' isn't of type linecatalog.") 434 if not self._data.get_unit().endswith("Hz"): 435 raise RuntimeError("Can only overlay linecatalogs when data is in frequency.") 433 436 from matplotlib.numerix import ma 434 437 for j in range(len(self._plotter.subplots)): … … 436 439 lims = self._plotter.axes.get_xlim() 437 440 for row in range(linecat.nrow()): 438 restf = linecat.get_frequency(row)/1000.0 441 # get_frequency returns MHz 442 base = { "GHz": 1000.0, "MHz": 1.0, "Hz": 1.0e-6 } 443 restf = linecat.get_frequency(row)/base[self._data.get_unit()] 439 444 c = 299792.458 440 445 freq = restf*(1.0-doppler/c)
Note:
See TracChangeset
for help on using the changeset viewer.