[cig-commits] [commit] devel: updates seis_process scripts (9ac3b62)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Dec 23 05:06:58 PST 2014
Repository : https://github.com/geodynamics/specfem3d
On branch : devel
Link : https://github.com/geodynamics/specfem3d/compare/c92aeae6613ca38c29e96dd169c292160dc53e21...c3b9c7ef07feb7d057fa71da18323d53b9c27233
>---------------------------------------------------------------
commit 9ac3b6264c1552bcb4dcba801d3704f66dc3c0d8
Author: daniel peter <peterda at ethz.ch>
Date: Tue Dec 23 13:25:45 2014 +0100
updates seis_process scripts
>---------------------------------------------------------------
9ac3b6264c1552bcb4dcba801d3704f66dc3c0d8
src/specfem3D/initialize_simulation.f90 | 2 +-
utils/seis_process/process_data.pl | 8 ++++++--
utils/seis_process/process_syn.pl | 3 ++-
utils/seis_process/rotate.pl | 17 +++++++++++------
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/specfem3D/initialize_simulation.f90 b/src/specfem3D/initialize_simulation.f90
index 1ef201e..0f1c1ce 100644
--- a/src/specfem3D/initialize_simulation.f90
+++ b/src/specfem3D/initialize_simulation.f90
@@ -382,7 +382,7 @@
! checks number of sources for adjoint simulations
! The limit below is somewhat arbitrary. For pure adjoint simulations (SIMULATION_TYPE == 2),
- ! the code outputs displacement (S00001.NT.BXX.semd,..) and strains (S00001.NT.SEE.semd,..)
+ ! the code outputs displacement (NT.S00001.BXX.semd,..) and strains (NT.S00001.SEE.semd,..)
! as well as source derivative kernels (src_frechet.00001,..) all for each point source.
! The naming convention for these files uses (.., i6.6,..), which limits the number of sources to 999999.
! If that is still too low, you can increase it further (if so, change all the occurrences of (.., i6.6,..) in the code).
diff --git a/utils/seis_process/process_data.pl b/utils/seis_process/process_data.pl
index edb62a7..86049da 100755
--- a/utils/seis_process/process_data.pl
+++ b/utils/seis_process/process_data.pl
@@ -84,9 +84,13 @@ foreach $file (@ARGV) {
$no_resp=0;
if (! -f $file) {die("No such file to be processed!!\n"); }
print "Processing data file $file \n";
+
+ ($filename) = split(" ",`basename $file`);
+ ($net,$sta,$comp)=split(/\./,$filename);
+
if (not $opt_d) {$outfile = $file.$ext;}
- else { ($filename) = split(" ",`basename $file`);
- $outfile = "$out_dir/${filename}${ext}";}
+ else {$outfile = "$out_dir/${filename}${ext}";}
+
($filedir) = split(" ",`dirname $file`);
if ($ext or $opt_d) {system("\\cp -f $file $outfile");}
diff --git a/utils/seis_process/process_syn.pl b/utils/seis_process/process_syn.pl
index 2cfe299..8c25e49 100755
--- a/utils/seis_process/process_syn.pl
+++ b/utils/seis_process/process_syn.pl
@@ -101,7 +101,8 @@ foreach $file (@ARGV) {
if (not defined $begin_time) {die("Check if the file is SAC format\n")};
($filename) = split(" ",`basename $file`);
- ($sta,$net,$comp)=split(/\./,$filename);
+ ($net,$sta,$comp)=split(/\./,$filename);
+
if (not $opt_d) {$outfile = $file.$ext;}
else {$outfile = "$opt_d/${filename}${ext}";}
if ($ext or $opt_d) {system("\\cp -f $file $outfile");}
diff --git a/utils/seis_process/rotate.pl b/utils/seis_process/rotate.pl
index 9f024f7..ec2cb27 100755
--- a/utils/seis_process/rotate.pl
+++ b/utils/seis_process/rotate.pl
@@ -29,27 +29,32 @@ exit(1)
if (!getopts('l:L:cdts')) {die('Check input arguments\n');}
@ARGV > 0 or Usage();
if (!$opt_l) {$opt_l = 0;}
-$saclst = "/opt/seismo-util/bin/saclst";
-if (not -f $saclst) {die("No such file as $saclst\n");}
+
+#$saclst = "/opt/seismo-util/bin/saclst";
+#if (not -f $saclst) {die("No such file as $saclst\n");}
+$saclst = "saclst";
+
$undef=-12345.0;
$eps=0.1;
-
foreach $file (@ARGV) {
print "processing $file\n";
if (! -f $file) {die (" check to see if $file exists or not\n");}
+
(undef,$comp)=split(" ",`$saclst kcmpnm f $file`);
if ($comp eq "-12345") {die("No component name defined in the file\n");}
if (not ($comp=~/E/ or $comp=~/1/)) {die("Please input only E/1 comp\n");}
+
$ecomp = $comp; $ncomp = $ecomp; $rcomp = $ecomp; $tcomp = $ecomp;
$ncomp=~s/E/N/; $ncomp =~s/1/2/;
$tcomp=~s/E/T/; $tcomp =~s/1/T/;
$rcomp=~s/E/R/; $rcomp =~s/1/R/;
($dir) = split(" ",`dirname $file`);$east = $file;
if ($opt_d) {
- (undef,undef,undef,undef,undef,undef,$network,undef)=split(/\./,`basename $file`);
- (undef,$east1) = split(/\.$network\./,$file);
- $east1 = "$network.$east1";
+ #(undef,undef,undef,undef,undef,undef,$network,undef)=split(/\./,`basename $file`);
+ ($network,$sta,undef,undef)=split(/\./,`basename $file`);
+ (undef,$east1) = split(/\.$sta\./,$file);
+ $east1 = "$sta.$east1";
$north1 = $east1; $north1=~s/$ecomp/$ncomp/;
($north) = split(" ",`ls -1 $dir/*$north1`);
$tang1=$east1;$radial1=$east1;
More information about the CIG-COMMITS
mailing list