/* ======== IGeoS ===== Distribition full ===== IGeoS ========= ** ** templ1t_pp.C : Created by 'seisweb' on Wed Apr 1 17:31:52 2020 ** ** Product : IGeoS - Integrated Geoscience Software ** ** Description : System for seismic, well log, and potential-field data analysis ** ** =================== Limited License: =================================== ** ** This software is provided free under the following terms and conditions: ** ** 1. Permission to use, copy, and modify this software ** for non-commercial purposes without fee is hereby granted, provided ** that this copyright notice, the warranty disclaimer, and this ** permission notice appear in all copies. ** ** 2. Distribution of this software or any part of it "bundled" in with ** any product is considered to be a 'commercial purpose'. ** ** 3. Any new or adapted code developed to operate as a part of this ** software shall be contributed to the authors and distributed under ** the same license. ** ** ================== Warranty Disclaimer: ================================ ** ** This software is provided "as is", with no support and without ** obligation on the part of the author to assist in its use, correction, ** modification, or enhancement. No guarantees or warranties, ** either express or implied, and regarding the accuracy, safety, or ** fitness for any particular purpose are provided by any contributor ** to this software package. ** ** ======== IGeoS ===== Distribition full ===== IGeoS ========= */ /* ========= S - I - A === S - I - A === S - I - A === S - I - A ========== ** ** templ1t_pp.C: Created by 'seisweb' on Fri Oct 20 19:19:51 2006 ** This file is a part of SIA distribution 'full' ** ** Copyright (c) 1995-2006, Igor Morozov, all rights reserved ** ** =================== Limited License: =================================== ** This software is provided free under the following terms and conditions: ** ** 1. Permission to use, copy, and modify this software ** for non-commercial purposes without fee is hereby granted, provided ** that this copyright notice, the warranty disclaimer, and this ** permission notice appear in all copies. ** ** 2. Distribution of this software or any part of it "bundled" in with ** any product is considered to be a 'commercial purpose'. ** ** 3. Any new or adapted code developed to operate as a part of this ** software shall be contributed to the authors and distributed under ** the same license. ** ** ================== Warranty Disclaimer: ================================ ** This software is provided "as is", with no support and without ** obligation on the part of the author to assist in its use, correction, ** modification, or enhancement. No guarantees or warranties, ** either express or implied, and regarding the accuracy, safety, or ** fitness for any particular purpose are provided by any contributor ** to this software package. ** ** ========= S - I - A ========== S - I - A ========== S - I - A ========== */ //#define DEBUG // uncomment this to enable debugging printouts, if any #include "sia_module.C.h" #include "templ1t.h" boolean TEMPL1T::proc(TRACE *t ) { double par1 = param1.value(t); // this obtains parameter value from t /*--- examples of obtaining the typical trace parameters -------*/ int ns = t->num_samples(); // number of trace data samples double si = t->sample_interval(), // sampling interval ts = t->time_start(); DATA_SAMPLE *d = t->data_start(); // pointer to the trace data array double time = pick(d,ns,si,ts); // pick the time from the array of samples // this is youf function below out_header.set_value(t,time); // output the value into trace header // ...... end of picking example ............................... // ...... sample FFT for spectral operations .................... SIA_FFT fft(ns); // initialize the FFT transformer int nfreq = fft.num_freq(); // number of FFT frequency samples COMPLEX *buf = ALLOC_TEMP(nfreq,COMPLEX); // allocate temporary buffer for complex spectrum // (using alloca(), so that the buffer is freed automatically // as this method returns fft.forward(d,buf); // forward real-to-complex FFT into the buffer double *filter = ALLOC_TEMP(nfreq,double); // filter aray // ... fill the filter array somehow... for ( int i=0; i < nfreq; i++ ) // apply the amplitude filter, keep the phase buf[i] *= filter[i]; fft.inverse(buf,d); // inverse complex-to-real FFT into trace data array // ...... end of FFT example .................................. /*--- process phase functions return Boolean values ----------*/ return OK; // OK means the trace has been processed and passed to the output // FAIL (FALSE) woul mean "wait for more input data" } double TEMPL1T::pick( DATA_SAMPLE *d, int num_samples, double sample_interval, double time_start ) { return time_start; // no picking yet } /*========================================================================== Process phase - called every time the system tries to produce an output (e.g., when there is a trace in the input gather) ==========================================================================*/ boolean TEMPL1T::process() { /*-- the following passes one trace from the input to output gather and performs the required processing on it -----*/ TRACE *t = SIA.input()->pass_trace(SIA.output()); return t ? proc(t) : FAIL; }