[cig-commits] r22893 - in seismo/3D/SPECFEM3D_GLOBE/trunk/utils: lib seis_process
dkomati1 at geodynamics.org
dkomati1 at geodynamics.org
Fri Sep 27 18:10:30 PDT 2013
Author: dkomati1
Date: 2013-09-27 18:10:30 -0700 (Fri, 27 Sep 2013)
New Revision: 22893
Added:
seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac
seismo/3D/SPECFEM3D_GLOBE/trunk/utils/seis_process/asc2sac
Removed:
seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac.c
Log:
switched to a working "asc2sac" that calls SAC to perform the conversion
Added: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac 2013-09-28 01:10:30 UTC (rev 22893)
@@ -0,0 +1 @@
+link ../seis_process/asc2sac
\ No newline at end of file
Property changes on: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac
___________________________________________________________________
Added: svn:special
+ *
Deleted: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac.c
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac.c 2013-09-28 01:05:18 UTC (rev 22892)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/lib/asc2sac.c 2013-09-28 01:10:30 UTC (rev 22893)
@@ -1 +0,0 @@
-link ../seis_process/asc2sac/asc2sac.c
\ No newline at end of file
Added: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/seis_process/asc2sac
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/seis_process/asc2sac (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/seis_process/asc2sac 2013-09-28 01:10:30 UTC (rev 22893)
@@ -0,0 +1,31 @@
+#!/bin/csh -f
+# Luis Rivera, CNRS, France, 2001: conversion from ASCII to SAC
+# input ASCII format is time and displacement on two columns
+# 8 digits of precision
+
+\rm -f *_TMP >& /dev/null
+
+foreach file ($*)
+ echo $file
+
+# time step
+ set T0 = `head -1 $file | gawk '{print $1}'`
+ set T1 = `head -2 $file |tail -1 | gawk '{print $1}'`
+ set dt = `echo $T0 $T1 | gawk '{print $2-$1}'`
+
+# second column
+ gawk '{print $2}' ${file} |\
+ sed -e "s/[Dd]/ e/" |\
+ gawk '{print int($1*1e8)/1e8, $2}' |\
+ sed -e "s/ e/e/" >! ${file}_TMP
+
+ sac << LASTLINE
+ ra ${file}_TMP
+ ch b $T0
+ ch delta $dt
+ write ${file}.sac
+ q
+LASTLINE
+
+ \rm -f ${file}_TMP
+end
Property changes on: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/seis_process/asc2sac
___________________________________________________________________
Added: svn:executable
+ *
More information about the CIG-COMMITS
mailing list