Changeset 880 for SHX/trunk


Ignore:
Timestamp:
11/29/12 11:12:31 (8 years ago)
Author:
marcus
Message:
  • changed simulate core method
  • lastsession now contains only commands
Location:
SHX/trunk/SeismicHandler
Files:
2 edited

Legend:

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

    r872 r880  
    195195 
    196196 
    197 def simulate(tracelist, flf, start=None, stop=None): 
    198     """ 
    199     Method for simulating instruments. Basically a FILI / FILTER wrapper. 
    200  
    201     This method accepts the following arguments: 
    202  
    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. 
    205     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". 
     197def simulate(tracelist, instrument): 
     198    """ 
     199    Method for simulating instruments. 
     200 
     201    This method accepts the following arguments: 
     202 
     203    tracelist:  accepts string input holding trace numbers (count start at 
     204                one), e.g. "1-3" or a list (or Stream) of Trace objects. 
     205    instrument: Name of simulation instrument, e.g. "wwssn-sp". 
     206    start:      If not None, filter only part of trace. "start" denotes 
     207                relative offset. 
     208    stop:       See "start". 
    209209 
    210210    Example: 
    211211    >>> from SeismicHandler.core import * 
    212212    >>> readfile("data/GEC2_19-NOV-2012_10-03-00-006.ASC") 
    213     >>> x = simulate("1", "GRSN_S+G_WWSSN_SP") 
     213    >>> x = simulate("1", "WWSSN-SP") 
    214214    >>> x.plot() #DOCTEST: +SKIP 
    215215 
     
    219219    individually at trace.shx.original. 
    220220    """ 
    221     from SeismicHandler.commands.fili import fili 
    222     from SeismicHandler.commands.filter_ import _filter 
     221    from SeismicHandler.commands.simulate import simulate 
    223222 
    224223    if isinstance(tracelist, basestring): 
     
    226225    else: 
    227226        traces = tracelist 
    228     chain = fili.load([flf]) 
    229227 
    230228    nt = [] 
    231229    for t in traces: 
    232         x = _filter.filter(t, chain, start, stop) 
     230        x = simulate.simulate(t, instrument) 
    233231        nt.append(x) 
    234232 
  • SHX/trunk/SeismicHandler/modules/history.py

    r667 r880  
    4848            f = open(Settings.config.history.session[0], "w") 
    4949            for h in self.history: 
    50                 f.write("%s \t %s %s %s\n" % (h[0], h[1], str(h[2]), str(h[3]))) 
     50                f.write("%s\n" % h[1]) 
    5151            f.close() 
    5252        except Exception, e: 
Note: See TracChangeset for help on using the changeset viewer.