Changeset 868 for SHX/trunk


Ignore:
Timestamp:
11/22/12 12:11:56 (8 years ago)
Author:
marcus
Message:
  • simulation filter access with python
File:
1 edited

Legend:

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

    r866 r868  
    195195 
    196196 
    197 def simulate(tracelist, flf): 
     197def simulate(tracelist, flf, start=None, stop=None): 
    198198    """ 
    199199    Method for simulating instruments. Basically a FILI / FILTER wrapper. 
     
    201201    This method accepts the following arguments: 
    202202 
    203     tracelist: accepts string input holding trace numbers (count start at one). 
    204                e.g. "1-3" or list of Trace objects 
     203    tracelist: accepts string input holding trace numbers (count start at one), 
     204               e.g. "1-3" or a list (or Stream) of Trace objects. 
    205205    flf:       Filter file name without extension. 
     206    start:     If not None, filter only part of trace. "start" denotes relative 
     207               offset. 
     208    stop:      See "start". 
     209 
     210    Example: 
     211    >>> from SeismicHandler.core import * 
     212    >>> readfile("data/GEC2_19-NOV-2012_10-03-00-006.ASC") 
     213    >>> x = simulate("1", "GRSN_S+G_WWSSN_SP") 
     214    >>> x.plot() #DOCTEST: +SKIP 
    206215 
    207216    Please note that only FLF filter files are supported! 
     
    220229    nt = [] 
    221230    for t in traces: 
    222         nt.append(_filter.filter(t, chain)) 
     231        x = _filter.filter(t, chain, start, stop) 
     232        nt.append(x) 
    223233 
    224234    return Stream(nt) 
Note: See TracChangeset for help on using the changeset viewer.