mom_correlate
macro name = mom_correlate
Comments
*******************************************************************
* mom_correlate - macro to find the best scale factor beteen 2
*                 time series in the least squares sense
*                 10/20/00  C.A. Langston
*                 Based on *.cor.macro previously written
*******************************************************************
*macro mom_correlate synthfile datafile windowtime1 windowtime2
*******************************************************************
r $1
mul 1000.
r more $2
synchronize
*p1
*pause
* write to temporary files
w junks junkd
*  decimate data to 0.2 sec
r junkd
decimate 4
w junkd
*  window phase of interest
evaluate to b1 $3
evaluate to b2 $4
cut on %b1% %b2%
r junks junkd
lp bu co 0.1 n 2 p 1
* p1
*pause
*  correlate seismograms
correlate
* p1pause
w synth.cor data.xcor
*      define time window to get correlation value
mtw 0 0.2
*
* cross correlation value
*
r data.xcor
markptp T0
evaluate to a1 &1,T0
*
* autocorrelation of synthetic
*
r synth.cor
markptp T0
evaluate to a2 &1,T0
*
*   relative amplitude estimate
*
setbb c1 (%a2% / %a1% )
*p
*pause
*  write to the error result file
sc echo $1 $3 $4 %c1% >> model.fit 
 
 

Comments are put in with an *
 
 

How it is invoked with dependent arguments
 
 
 
 
 
 
 
 
 

Decimation needed because the two time series had
  different sampling rates
 

use blackboard variables
 
 
 

lowpass filter
"pause" command used when debugging
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Here is how you can output results to a file on disk.  Cool trick.
 

Return



last modified 3/05/01