Changeset 1165 for trunk/python


Ignore:
Timestamp:
08/22/06 12:52:53 (18 years ago)
Author:
mar637
Message:

added auto location on peak>ymax. changed argument offset to doppler to accomodate frequency changing over the band

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapplotter.py

    r1164 r1165  
    419419            location:     the location of the line annotation from the 'top',
    420420                          'bottom' or alternate (None - the default)
     421        Notes:
     422        If the spectrum is flagged no line will be drawn in that location.
    421423        """
    422424        if not self._data: return
     
    430432            lims = self._plotter.axes.get_xlim()
    431433            for row in range(linecat.nrow()):
    432                 freq = linecat.get_frequency(row)/1000.0 + offset
     434                restf = linecat.get_frequency(row)/1000.0
     435                c = 299792.458
     436                freq = restf*(doppler+c)/c
    433437                if lims[0] < freq < lims[1]:
    434438                    if location is None:
     
    461465                            s = slice(lower, upper)
    462466                            y = line._y_orig[s]
    463                             maxys.append(ma.maximum(y))
     467                            maxy = ma.maximum(y)
     468                            if isinstance( maxy, float):
     469                                maxys.append(maxy)
    464470                    if len(maxys):
    465471                        peak = max(maxys)
     472                        if peak > self._plotter.axes.get_ylim()[1]:
     473                            loc = 'bottom'
    466474                    else:
    467                         print "DEBUG - ignoring line as spectrum was masked at this frequency"
    468475                        continue
     476                    print freq,peak
    469477                    self._plotter.vline_with_label(freq, peak,
    470478                                                   linecat.get_name(row),
Note: See TracChangeset for help on using the changeset viewer.