[cig-commits] r11960 - in seismo/3D/mt_measure_adj: PLOTS scripts_tomo
carltape at geodynamics.org
carltape at geodynamics.org
Tue May 13 08:16:37 PDT 2008
Author: carltape
Date: 2008-05-13 08:16:36 -0700 (Tue, 13 May 2008)
New Revision: 11960
Modified:
seismo/3D/mt_measure_adj/PLOTS/plot_win_stats.pl
seismo/3D/mt_measure_adj/PLOTS/plot_win_stats_all.pl
seismo/3D/mt_measure_adj/scripts_tomo/combine_adj_src_all.pl
seismo/3D/mt_measure_adj/scripts_tomo/run_mt_cc_plot.pl
seismo/3D/mt_measure_adj/scripts_tomo/run_mt_measure_adj.pl
seismo/3D/mt_measure_adj/scripts_tomo/run_tomo.pl
Log:
Modified plotting scripts to have a variable option for the record lengths in plotting data and synthetics. This accomodates the flexibility for having many different simulation lenghts in one dataset.
Modified: seismo/3D/mt_measure_adj/PLOTS/plot_win_stats.pl
===================================================================
--- seismo/3D/mt_measure_adj/PLOTS/plot_win_stats.pl 2008-05-13 04:16:02 UTC (rev 11959)
+++ seismo/3D/mt_measure_adj/PLOTS/plot_win_stats.pl 2008-05-13 15:16:36 UTC (rev 11960)
@@ -112,8 +112,11 @@
#`awk '{print \$21}' $meas_file > $file4`; ($min4,$max4) = split(" ",`minmax -C $file4`); $st4 = sprintf("min/max = %.2f / %.2f",$min4,$max4);
# create a new measurement file for plotting the histograms
-$file0 = "${eid}_cc_dT_dA_dTsigma_dAsigma";
-`awk '{print \$15,\$16,\$20,\$21,\$15/\$20,\$16/\$21}' $meas_file > $file0`;
+$file0 = "${eid}_cc_dT_dA_dTsigma_dAsigma"; # see mt_measure_adj.f90
+
+#`awk '{print \$15,\$16,\$20,\$21,\$15/\$20,\$16/\$21}' $meas_file > $file0`;
+`awk '{print \$15,\$16,\$19,\$20,\$15/\$19,\$16/\$20}' $meas_file > $file0`;
+
($min1,$max1,$min2,$max2,$min3,$max3,$min4,$max4,$min5,$max5,$min6,$max6) = split(" ",`minmax -C $file0`);
$st1 = sprintf("min/max = %.2f / %.2f",$min1,$max1);
$st2 = sprintf("min/max = %.2f / %.2f",$min2,$max2);
Modified: seismo/3D/mt_measure_adj/PLOTS/plot_win_stats_all.pl
===================================================================
--- seismo/3D/mt_measure_adj/PLOTS/plot_win_stats_all.pl 2008-05-13 04:16:02 UTC (rev 11959)
+++ seismo/3D/mt_measure_adj/PLOTS/plot_win_stats_all.pl 2008-05-13 15:16:36 UTC (rev 11960)
@@ -57,7 +57,7 @@
# loop over all events
$k = 0;
$imin = 1; $imax = $nevent; # default
-#$imin = 1; $imax = 10;
+#$imin = 1; $imax = 3;
#$imin = 1; $imax = $imin;
for ($i = $imin; $i <= $imax; $i = $i+1) {
@@ -252,7 +252,7 @@
#================================================
# concatenate pdf files into one
-$ofile = "ALL_${sTmin}_win_stats_full.pdf";
+$ofile = "ALL_${smodel}_${sTmin}_win_stats_full.pdf";
`/home/carltape/bin/pdcat -r $pdffile \[0-9\]*${sTmin}*.pdf $ofile`;
# copy composite file to output directory
Modified: seismo/3D/mt_measure_adj/scripts_tomo/combine_adj_src_all.pl
===================================================================
--- seismo/3D/mt_measure_adj/scripts_tomo/combine_adj_src_all.pl 2008-05-13 04:16:02 UTC (rev 11959)
+++ seismo/3D/mt_measure_adj/scripts_tomo/combine_adj_src_all.pl 2008-05-13 15:16:36 UTC (rev 11960)
@@ -42,7 +42,7 @@
# loop over all events
$k = 0;
$imin = 1; $imax = $nevent; # default
-#$imin = 1; $imax = 20;
+#$imin = 20; $imax = $nevent;
#$imin = 189; $imax = $imin; # 133 (9818433)
for ($i = $imin; $i <= $imax; $i = $i+1) {
@@ -72,6 +72,7 @@
print " --> $odir already exists";
} else {
+ #if ( -f $sta_file1 && -f $sta_file2) {
if ( -f $sta_file1 || -f $sta_file2) {
print " --> at least one STATIONS_ADJOINT file exists";
Modified: seismo/3D/mt_measure_adj/scripts_tomo/run_mt_cc_plot.pl
===================================================================
--- seismo/3D/mt_measure_adj/scripts_tomo/run_mt_cc_plot.pl 2008-05-13 04:16:02 UTC (rev 11959)
+++ seismo/3D/mt_measure_adj/scripts_tomo/run_mt_cc_plot.pl 2008-05-13 15:16:36 UTC (rev 11960)
@@ -10,23 +10,23 @@
#
# EXAMPLE:
#
-# run_mt_cc_plot.pl 6/40 -0.6/0.011/18200 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
-# run_mt_cc_plot.pl 6/40 -0.6/0.011/18200 0 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN)
+# run_mt_cc_plot.pl 6/40 -10/180 -0.6/0.011/18200 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
+# run_mt_cc_plot.pl 6/40 -10/180 -0.6/0.011/18200 0 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN)
#
#==========================================================
-if (@ARGV < 7) {die("Usage: run_mt_cc_plot.pl Tmin/Tmax tstart/dt/npt itest iparbools par1 par2 par3\n")}
-($Ts,$tvec,$itest,$iparbools,$par1,$par2,$par3) = @ARGV;
+if (@ARGV < 8) {die("Usage: run_mt_cc_plot.pl Tmin/Tmax tstart/dt/npt Ldur itest iparbools par1 par2 par3\n")}
+($Ts,$lcut,$tvec,$itest,$iparbools,$par1,$par2,$par3) = @ARGV;
$pwd = $ENV{PWD};
($Tmin,$Tmax) = split("/",$Ts);
# time interval to cut for plotting
-$Lstart = -10;
-$Lend = 180;
-if($Tmin==2) {$Lend = 120;}
-$lcut = "$Lstart/$Lend";
+#$Lstart = -10;
+#$Lend = 180;
+#if($Tmin==2) {$Lend = 120;}
+#$lcut = "$Lstart/$Lend";
if ($itest == 0) {
$dir_syn = "SYN"; $dir_data = "DATA"; $dir_meas = "MEASURE"; $dir_recon = "RECON";
Modified: seismo/3D/mt_measure_adj/scripts_tomo/run_mt_measure_adj.pl
===================================================================
--- seismo/3D/mt_measure_adj/scripts_tomo/run_mt_measure_adj.pl 2008-05-13 04:16:02 UTC (rev 11959)
+++ seismo/3D/mt_measure_adj/scripts_tomo/run_mt_measure_adj.pl 2008-05-13 15:16:36 UTC (rev 11960)
@@ -23,24 +23,24 @@
# iboth plot both MT and CC adjoint sources (=1) or not (=0)
#
# EXAMPLE (T = [6s, 40s]):
-# run_mt_measure_adj.pl 0 0 6/40 -0.6/0.011/18200 1 1 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
-# run_mt_measure_adj.pl 2 3 6/40 -0.6/0.011/18200 1 1 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
-# run_mt_measure_adj.pl 1 1 6/40 -0.6/0.011/18200 1 1 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
+# run_mt_measure_adj.pl 0 0 6/40 -10/180 -0.6/0.011/18200 1 1 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
+# run_mt_measure_adj.pl 2 3 6/40 -10/180 -0.6/0.011/18200 1 1 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
+# run_mt_measure_adj.pl 1 1 6/40 -10/180 -0.6/0.011/18200 1 1 1 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
#
-# run_mt_measure_adj.pl 2 3 6/40 -0.6/0.011/18200 0 1 0 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN, TT-xcorr, errors)
-# run_mt_measure_adj.pl 2 3 6/40 -0.6/0.011/18200 0 1 0 1/1/0 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN, TT-xcorr, no errors)
+# run_mt_measure_adj.pl 2 3 6/40 -10/180 -0.6/0.011/18200 0 1 0 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN, TT-xcorr, errors)
+# run_mt_measure_adj.pl 2 3 6/40 -10/180 -0.6/0.011/18200 0 1 0 1/1/0 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN, TT-xcorr, no errors)
#
# No errors included:
-# run_mt_measure_adj.pl 2 3 6/40 -0.6/0.011/18200 1 1 1 1/1/0 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
+# run_mt_measure_adj.pl 2 3 6/40 -10/180 -0.6/0.011/18200 1 1 1 1/1/0 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
#
# EXAMPLE (T = [2s, 40s]):
-# run_mt_measure_adj.pl 2 3 2/40 -0.6/0.011/18200 1 1 0 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
-# run_mt_measure_adj.pl 2 3 2/40 -0.6/0.011/18200 0 1 0 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN)
+# run_mt_measure_adj.pl 2 3 2/40 -10/120 -0.6/0.011/18200 1 1 0 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA_TEST/SYN_TEST)
+# run_mt_measure_adj.pl 2 3 2/40 -10/120 -0.6/0.011/18200 0 1 0 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.1 (DATA/SYN)
#
#==========================================================
-if (@ARGV < 11) {die("Usage: run_mt_measure_adj.pl iker itaper Tmin/Tmax tstart/dt/npt itest iplot iboth iparbools par1 par2 par3\n")}
-($iker,$itaper,$Ts,$tvec,$itest,$iplot,$iboth,$iparbools,$par1,$par2,$par3) = @ARGV;
+if (@ARGV < 12) {die("Usage: run_mt_measure_adj.pl iker itaper Tmin/Tmax tstart/dt/npt itest iplot iboth iparbools par1 par2 par3\n")}
+($iker,$itaper,$Ts,$lcut,$tvec,$itest,$iplot,$iboth,$iparbools,$par1,$par2,$par3) = @ARGV;
$plot_adj_dir = "PLOTS/ADJOINT_SOURCES";
#$iboth = 0; # option to plot both cross-correlation and multitaper adjoint sources
@@ -112,11 +112,10 @@
# remove any plot files
#print CSH "\\rm PLOTS/*pdf PLOTS/*jpg PLOTS/*ps\n";
- #$iker = 2;
- $Lstart = -10;
- $Lend = 180;
- if($Tmin==2) {$Lend = 120;}
- $lcut = "$Lstart/$Lend"; # time interval to cut for plotting
+ #$Lstart = -10;
+ #$Lend = 180;
+ #if($Tmin==2) {$Lend = 120;}
+ #$lcut = "$Lstart/$Lend"; # time interval to cut for plotting
print CSH "cd PLOTS\n";
print CSH "plot_win_adj_all.pl -l $lcut -m ../$cmtfile -b $iboth -k $iker -a $stafile2 -d $dir_data -s $dir_syn -c $dir_recon -w MEASUREMENT.WINDOWS\n";
Modified: seismo/3D/mt_measure_adj/scripts_tomo/run_tomo.pl
===================================================================
--- seismo/3D/mt_measure_adj/scripts_tomo/run_tomo.pl 2008-05-13 04:16:02 UTC (rev 11959)
+++ seismo/3D/mt_measure_adj/scripts_tomo/run_tomo.pl 2008-05-13 15:16:36 UTC (rev 11960)
@@ -4,23 +4,26 @@
#
# run_tomo.pl
# Carl Tape
-# 07-Feb-2008
+# 12-May-2008
#
# This is the master program for running the measurement code on all the
# events for which the windowing code has been run.
#
# EXAMPLE (from working mt_measure_adj directory) :
-# run_tomo.pl m0 6/40 0.011 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.2
-# run_tomo.pl m0 2/40 0.011 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.2
+# run_tomo.pl m0 6/40 0.011 1/1/1 2.0/2.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.2 0.8
+# run_tomo.pl m0 2/40 0.011 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/8.0/1.0 0.2/0.2 0.5
#
#==========================================================
-if (@ARGV < 7) {die("Usage: run_tomo.pl smodel Tmin/Tmax dt itest iparbools par1 par2 par3\n")}
-($smodel,$Ts,$dt,$iparbools,$par1,$par2,$par3) = @ARGV;
+if (@ARGV < 8) {die("Usage: run_tomo.pl smodel Tmin/Tmax dt itest iparbools par1 par2 par3\n")}
+($smodel,$Ts,$dt,$iparbools,$par1,$par2,$par3,$lcut_frac) = @ARGV;
($Tmin,$Tmax) = split("/",$Ts);
$sTmin = sprintf("T%2.2i",$Tmin);
+# for plotting purposes only
+($lcut_min,$lcut_max) = split("/",$lcut);
+
$dir0 = "/net/sierra/raid1/carltape/socal/socal_3D/RUNS";
$dir_all = "/net/sierra/raid1/carltape/results/MEASUREMENTS/${smodel}/ALL_${sTmin}";
if (not -e $dir0) {die("check if $dir0 exist or not\n")}
@@ -67,6 +70,11 @@
print "$ievent -- $imin to $imax : $eid\n";
print CSH "echo $ievent -- $imin to $imax : $eid\n";
+ # duration of records for plotting
+ $lcut_min = -10;
+ $lcut_max = $lcut_frac*$Ldur_round;
+ $lcut = "${lcut_min}/${lcut_max}";
+
# time vector for adjoint sources
$tstart = -1.5*$hdur;
$tvec = "$tstart/$dt/$nstep";
@@ -98,10 +106,10 @@
# KEY: for T >=6, do both surface wave and body wave measurements
if ($Tmin <= 2 || $eid == 14095540) {
- # special case for a particular event
- print CSH "run_mt_measure_adj.pl 2 3 $Ts $tvec 0 1 0 $iparbools $par1 $par2 $par3\n";
+ # special case for a particular event -- do cross-correlation only
+ print CSH "run_mt_measure_adj.pl 2 3 $Ts $lcut $tvec 0 1 0 $iparbools $par1 $par2 $par3\n";
} else {
- print CSH "run_mt_cc_plot.pl $Ts $tvec 0 $iparbools $par1 $par2 $par3\n";
+ print CSH "run_mt_cc_plot.pl $Ts $lcut $tvec 0 $iparbools $par1 $par2 $par3\n";
}
$infile1 = "window_chi"; $outfile1 = "$dir_meas/${ftag}_${infile1}";
More information about the cig-commits
mailing list