[cig-commits] r15025 - seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/UTILS/seis_process

tan2 at geodynamics.org tan2 at geodynamics.org
Thu May 21 12:33:38 PDT 2009


Author: tan2
Date: 2009-05-21 12:33:38 -0700 (Thu, 21 May 2009)
New Revision: 15025

Modified:
   seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/UTILS/seis_process/convolve_stf.c
Log:
Fixed a scaling error in convolution.

SAC's FFT routine normalizes the result in the forward transform already.


Modified: seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/UTILS/seis_process/convolve_stf.c
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/UTILS/seis_process/convolve_stf.c	2009-05-21 11:51:50 UTC (rev 15024)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/pluggable/UTILS/seis_process/convolve_stf.c	2009-05-21 19:33:38 UTC (rev 15025)
@@ -85,7 +85,7 @@
     
     fft(ccorr.xreal, ccorr.ximag, ncorr, -1);
     for (i = 0; i < nconv; ++i) {
-        conv[i] = ccorr.xreal[i] / (float)ncorr;
+        conv[i] = ccorr.xreal[i] * ncorr;
     }
     
     free(buffer);
@@ -134,7 +134,7 @@
     data = NULL;
     for (j=3; j<argc; j++) {
         sac_int_t max, npts, nlen, nerr;
-        float beg, del, dt, origin, scale, tmp[1];
+        float beg, del, dt, origin, tmp[1];
         sac_int_t nstf, nconv, i;
         float hstf, *stf, *conv;
         char *outf;
@@ -180,8 +180,7 @@
 
         /* get additional info */
         getfhv("delta", &dt, &nerr, strlen("delta"));
-        getfhv("scale", &scale, &nerr, strlen("scale"));
-        
+
         getfhv("o", &origin, &nerr, strlen("o"));
         if(nerr) {
             /* Assuming origin time is 0, per convention of SPECFEM */
@@ -226,7 +225,7 @@
         /* creat convolution time series */
         convolve(&conv,&nconv,data,npts,stf,nstf);
         for(i=0; i<nconv; i++)
-            conv[i] *= dt * scale;
+            conv[i] *= dt;
 
 
         /* update sac file header */



More information about the CIG-COMMITS mailing list