[cig-commits] [commit] pluggable: Assuming origin time is 0 if undefined in SAC file. SAC will still print an ugly error message though. (1e01579)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Apr 9 08:55:59 PDT 2014


Repository : ssh://geoshell/specfem3d_globe

On branch  : pluggable
Link       : https://github.com/geodynamics/specfem3d_globe/compare/64e1b38f0c5ebb4056cce0b15d41c0b9f94ab6e5...099a4d330d5b173b21e51ad441f9f429e5d37842

>---------------------------------------------------------------

commit 1e01579d49f14b9c98ce5900862b09e17c1443b7
Author: Eh Tan <tan2 at earth.sinica.edu.tw>
Date:   Sun May 10 18:45:07 2009 +0000

    Assuming origin time is 0 if undefined in SAC file. SAC will still print an ugly error message though.


>---------------------------------------------------------------

1e01579d49f14b9c98ce5900862b09e17c1443b7
 UTILS/seis_process/convolve_stf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/UTILS/seis_process/convolve_stf.c b/UTILS/seis_process/convolve_stf.c
index 696585f..91cf2ff 100644
--- a/UTILS/seis_process/convolve_stf.c
+++ b/UTILS/seis_process/convolve_stf.c
@@ -184,8 +184,10 @@ main(int argc, char *argv[])
         
         getfhv("o", &origin, &nerr, strlen("o"));
         if(nerr) {
-            fprintf(stderr,"No origin time is defined for the sac file\n");
-            return 1;
+            /* Assuming origin time is 0, per convention of SPECFEM */
+	    fprintf(stderr, "  Assuming origin time is 0\n");
+            origin = 0.0;
+            setfhv("o", &origin, &nerr, strlen("o"));
         }
 
 



More information about the CIG-COMMITS mailing list