Ignore:
Timestamp:
07/21/2011 03:45:31 PM (12 years ago)
Author:
marcus
Message:
  • more pubsub messaging system
  • removed cross dependencies between frame and canvas
  • general debug method
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/patches/ObsPy.py

    r417 r419  
    2929import numpy as np 
    3030import math 
    31 import time 
    3231from obspy.core import Stream, Trace 
    3332from obspy.core.util import AttribDict 
     33from SeismicHandler.utils.pubsub import pub as msgs 
    3434#from obspy.core import UTCDateTime 
    3535 
     
    7777    norm : norm method: "window", "total" or value (effects y extension) 
    7878    """ 
     79    msgs.sendMessage('log.debug.patches', 
     80                                message=["Preparing plotting data...", self.id]) 
     81 
    7982    if not timescale: 
    8083        # use trace's total dimensions 
     
    113116        self.shx.PlotData = pt.data.copy() 
    114117    else: 
    115         print time.time(), "using cachedX data for", CacheTraceID[:3] 
     118        msgs.sendMessage('log.devel.patches', message=["using cachedX data for", 
     119                                                              CacheTraceID[:3]]) 
    116120 
    117121    # use minmax approach if more than 4 data points per pixel 
     
    138142            joined = np.append(joined, [remaining.min(), remaining.max()]) 
    139143 
    140         print time.time(), "pixel_width", pixel_width, "minmax", "npts", npts, "dpp", dpp, "dimx", dimx, \ 
    141               "covered", covered, "len_rest", len(remaining), "data_len", \ 
    142               len(data), "joined", len(joined), "width", width 
     144        msgs.sendMessage( 
     145            'log.devel.patches', 
     146            message=[ 
     147                 "pixel_width", pixel_width, "minmax", "npts", npts, "dpp", 
     148                 dpp, "dimx", dimx, "covered", covered, "len_rest", 
     149                 len(remaining), "data_len", len(data), "joined", len(joined), 
     150                 "width", width 
     151                ] 
     152        ) 
    143153 
    144154        # At this stage the x-transformed data can be cached! If pixel_width 
     
    146156        self.shx.PlotData = joined 
    147157 
    148     print time.time(), width, height, norm, type(self.shx.PlotData) 
     158    msgs.sendMessage('log.devel.patches', 
     159                         message=[width, height, norm, type(self.shx.PlotData)]) 
    149160 
    150161    if cachedY: 
    151         print time.time(), "using cachedY data for", CacheTraceID[3:] 
     162        msgs.sendMessage('log.devel.patches', 
     163                           message=["using cachedY data for", CacheTraceID[3:]]) 
    152164        return 
    153165     
Note: See TracChangeset for help on using the changeset viewer.