Changeset 386


Ignore:
Timestamp:
05/18/2011 12:20:31 PM (12 years ago)
Author:
marcus
Message:

obspy patches

Location:
SHX/trunk/SeismicHandler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/__init__.py

    r383 r386  
    2020# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA 
    2121 
    22 # patching obspy's Trace and Stream 
    23 from obspy.core import Trace, Stream 
    24 from SeismicHandler.patches.obspy import * 
    25  
    26 # traces in a stream are merge automatically 
    27 Stream.__shx_init__, Stream.__init__ = Stream.__init__, streamAutoMergeInit 
    28 Stream.__shx_append, Stream.append = Stream.append, streamAutoMergeAppend 
    29 Stream.__shx_extend, Stream.extend = Stream.extend, streamAutoMergeExtend 
    30 Stream.__shx_insert, Stream.insert = Stream.insert, streamAutoMergeInsert 
    31 Stream.__shx_add__, Stream.__add__ = Stream.__add__, streamAutoMergeAdd 
    32  
    33 # add method for faster plotting 
    34 Trace.shx_prepareImageData = tracePrepareDataForImage 
     22# enable obspy patches 
     23from SeismicHandler.patches.Obspy import * 
  • SHX/trunk/SeismicHandler/patches/obspy.py

    r383 r386  
    2626 
    2727import numpy as np 
     28from obspy.core import Stream, Trace 
    2829#from obspy.core import UTCDateTime 
    2930 
    3031__all__ = [ 
    31     "streamAutoMergeInit", 
    32     "streamAutoMergeAppend", 
    33     "streamAutoMergeExtend", 
    34     "streamAutoMergeInsert", 
    35     "streamAutoMergeAdd", 
    36     "tracePrepareDataForImage", 
     32    "patched", 
    3733] 
    3834 
     
    121117    else: 
    122118        norm = norm 
     119 
     120# traces in a stream are merge automatically 
     121Stream.__shx_init__, Stream.__init__ = Stream.__init__, streamAutoMergeInit 
     122Stream.__shx_append, Stream.append = Stream.append, streamAutoMergeAppend 
     123Stream.__shx_extend, Stream.extend = Stream.extend, streamAutoMergeExtend 
     124Stream.__shx_insert, Stream.insert = Stream.insert, streamAutoMergeInsert 
     125Stream.__shx_add__, Stream.__add__ = Stream.__add__, streamAutoMergeAdd 
     126 
     127# add method for faster plotting 
     128Trace.shx_prepareImageData = tracePrepareDataForImage 
     129 
     130patched = True 
Note: See TracChangeset for help on using the changeset viewer.