Previous topic

Module tracesTreatment

Next topic

Module tracesFunctions

This Page

Define the treatment of the traces.

Module tracesDefineTreatments

Specify a list of ordered processing for the traces for the functions makeTreatmentTraceBeforeNewFrequence() and makeTreatmentTraceAfterNewFrequence(). Functions can be import from the module traces.tracesFunctions or others available libraries as numpy, scipy, obspy, etc...

traces.tracesDefineTreatments.makeTreatmentTraceBeforeNewFrequence(Trace, Frequence)

Specify a list of ordered processing for the traces before resampling. Functions can be import from the module traces.tracesFunctions or others available libraries as numpy, scipy, obspy, etc...

Examples:

  • Make treatment with a function foo() in the module bar with parameters p1, p2. Then add a code like this (verify the signature!):

    p1 = aValue
    p2 = None
    Trace = bar.foo(Trace, p1, p2)
    
  • Filter the trace between 1 second and 3 seconds with the function filtfilt() (see here) of the library scipy . Define also a Butterworth of order 3. Write:

    OrderButter = 3
    PeriodMin = 1
    PeriodMax = 3
    arrayForButter = numpy.array([1./float(PeriodMax), 1./float(PeriodMin)])*2/float(Frequence)
    b, a = scipy.signal.filter_design.iirfilter(OrderButter, arrayForButter)
    Trace = scipy.signal.filtfilt(b, a, Trace)
    
traces.tracesDefineTreatments.makeTreatmentTraceAfterNewFrequence(Trace, Frequence)

Specify a list of ordered processing for the traces after resampling. Functions can be import from the module traces.tracesFunctions or others available libraries as scipy, obspy, etc...

Examples:

  • Make a treatment with the function glitchCorrectionWithFactorStd() contains in the module traces.tracesFunctions:

    factorTestStd = 10
    numberOfStd = 3
    factorReplaceWithStd = 0
    Trace = tracesFunctions.glitchCorrectionWithFactorStd(Trace, factorTestStd, numberOfStd, factorReplaceWithStd)
    
  • Use the function highpass() of the library obspy :

    FreqMin = 50 #Hz
    Order = 4
    zerophase=True
    Trace = obspy.signal.filter.highpass(Trace, FreqMin, Frequence, Order, zerophase)
    


Whisper project: FP7 ERC Advanced grant 227507 (WHISPER).
Codes are develop for the Whisper project (Seismic ambient noise).
If you use this code, specify it is provide by: Whisper project FP7 ERC Advanced grant 227507 (WHISPER).
Author: Xavier Briand. For questions, send email to xav.briand.whisper@gmail.com with subject begin exactly with [whisper].