[cig-commits] r13309 - in seismo/3D/ADJOINT_TOMO/measure_adj: PLOTS scripts_tomo

carltape at geodynamics.org carltape at geodynamics.org
Fri Nov 14 08:33:49 PST 2008


Author: carltape
Date: 2008-11-14 08:33:48 -0800 (Fri, 14 Nov 2008)
New Revision: 13309

Modified:
   seismo/3D/ADJOINT_TOMO/measure_adj/PLOTS/plot_win_stats_all.pl
   seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_2_adj_src_all.pl
   seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_3_adj_src_all.pl
   seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/prepare_mt_measure_adj.pl
   seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/run_tomo.pl
Log:
Updated run scripts.


Modified: seismo/3D/ADJOINT_TOMO/measure_adj/PLOTS/plot_win_stats_all.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/measure_adj/PLOTS/plot_win_stats_all.pl	2008-11-14 13:46:51 UTC (rev 13308)
+++ seismo/3D/ADJOINT_TOMO/measure_adj/PLOTS/plot_win_stats_all.pl	2008-11-14 16:33:48 UTC (rev 13309)
@@ -10,10 +10,10 @@
 # The set of final histograms are copied to an output directory.
 # 
 # EXAMPLE:
-#    plot_win_stats_all.pl 6/40 m07 0
-#    plot_win_stats_all.pl 6/40 m07 1 (plot histogram)
-#    plot_win_stats_all.pl 2/40 m07 0
-#    plot_win_stats_all.pl 2/40 m07 1 (plot histogram)
+#    plot_win_stats_all.pl 6/30 m12 0
+#    plot_win_stats_all.pl 6/30 m12 1 (plot histogram)
+#    plot_win_stats_all.pl 2/30 m12 0
+#    plot_win_stats_all.pl 2/30 m12 1 (plot histogram)
 #
 #-----------------------------------
 
@@ -25,24 +25,25 @@
 ($Tmin,$Tmax) = split("/",$Ts);
 $sTmin = sprintf("T%3.3i",$Tmin);
 $sTmax = sprintf("T%3.3i",$Tmax);
+$Ttag = "${sTmin}_${sTmax}";
 $sTper = sprintf("T = %i - %i s",$Tmin,$Tmax);
 
-$dir_source = "/home/carltape/results/SOURCES/socal_10";
-$dir_source_text = "${dir_source}/v10_files_text";
-$file_eids = "${dir_source}/SOCAL_FINAL_CMT_v10_eid";
-#$file_eids = "/net/sierra/raid1/carltape/results/EID_LISTS/syn_run_m07";
+$dir_source = "/home/carltape/results/SOURCES/socal_11";
+$dir_source_text = "${dir_source}/v11_files_text";
+$file_eids = "${dir_source}/SOCAL_FINAL_CMT_v11_eid";
+#$file_eids = "/net/sierra/raid1/carltape/results/EID_LISTS/syn_run_m12";
 if (not -f $file_eids) {die("\n check if $file_eids exists\n")}
 open(IN,$file_eids); @eids = <IN>; $nevent = @eids;
 
 # directories
 $odir    = "/net/sierra/raid1/carltape/results/MEASUREMENTS";
-$dir_all = "$odir/$smodel/ALL_${sTmin}";
+$dir_all = "$odir/$smodel/PDF_EID_${Ttag}";
 $dir_run = "/net/sierra/raid1/carltape/socal/socal_3D/RUNS";
 if (not -e $dir_all) {die("check if $dir_all exist or not\n")}
 if (not -e $dir_run) {die("check if $dir_run exist or not\n")}
 
 # name of file containing ALL source focal mechanisms in PSMECA format (see socal_tomo_sources.m)
-$cmtall_psmeca = "${dir_source}/SOCAL_FINAL_CMT_v10_psmeca_eid";
+$cmtall_psmeca = "${dir_source}/SOCAL_FINAL_CMT_v11_psmeca_eid";
 if (not -f $cmtall_psmeca) {die("\n check if $cmtall_psmeca exists\n")}
 
 #$nevent = 5;
@@ -59,24 +60,24 @@
 # loop over all events
 $k = 0;
 $imin = 1; $imax = $nevent;   # default
-#$imin = 1; $imax = 10;
+#$imin = 1; $imax = 20;
 #$imin = 204; $imax = $imin;
 
 for ($i = $imin; $i <= $imax; $i = $i+1) {
 
   $eid = $eids[$i-1]; chomp($eid);
-  $ftag = "${eid}_${sTmin}";
+  $ftag = "${eid}_${Ttag}";
 
   print "\n------------------------------";
   print "\n $i, $eid \n";
 
   # name of file containing measurements (see mt_sub.f90)
-  $dir_meas = "${dir_run}/${eid}/${smodel}/MEASURE_${sTmin}";
+  $dir_meas = "${dir_run}/${eid}/${smodel}/MEASURE_${Ttag}";
   $meas_file = "${dir_meas}/${ftag}_window_chi";
   if (-f $meas_file) {
 
     # name of stations file
-    $sta_file = "${dir_meas}/ADJOINT_${sTmin}/STATIONS_ADJOINT";
+    $sta_file = "${dir_meas}/ADJOINT_${Ttag}/STATIONS_ADJOINT";
 
     # file containing text for plotting here
     $eid_text = "${dir_source_text}/${eid}_text";
@@ -128,7 +129,7 @@
 
 $fontno = 1;
 
-$name = "ALL_${sTmin}_win_stats";
+$name = "ALL_${Ttag}_${smodel}_win_stats";
 $psfile = "$name.ps";
 $jpgfile = "$name.jpg";
 $pdffile = "$name.pdf";
@@ -253,7 +254,7 @@
 print CSH "convert $psfile $jpgfile\n";
 print CSH "ps2pdf $psfile $pdffile\n";
 #print CSH "rm $psfile\n";
-print CSH "xv $jpgfile &\n";
+print CSH "ghostview $psfile &\n";
 
 #-----------------------------------------
 close(CSH);
@@ -263,8 +264,8 @@
 #================================================
 
 # concatenate pdf files into one
-$ofile = "ALL_${smodel}_${sTmin}_win_stats_full.pdf";
-`/home/carltape/bin/pdcat -r $pdffile \[0-9\]*${sTmin}*.pdf $ofile`;
+$ofile = "ALL_${smodel}_${Ttag}_win_stats_full.pdf";
+`/home/carltape/bin/pdcat -r $pdffile \[0-9\]*${Ttag}*.pdf $ofile`;
 
 # copy composite file to output directory
 `cp $ofile $odir/$ofile`;

Modified: seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_2_adj_src_all.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_2_adj_src_all.pl	2008-11-14 13:46:51 UTC (rev 13308)
+++ seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_2_adj_src_all.pl	2008-11-14 16:33:48 UTC (rev 13309)
@@ -24,7 +24,7 @@
 
 # list of event IDs
 #$file_eids = "/net/sierra/raid1/carltape/results/SOURCES/eid_run";     # favorites
-$file_eids = "/net/sierra/raid1/carltape/results/SOURCES/socal_10/EIDs_only_eid";
+$file_eids = "/net/sierra/raid1/carltape/results/SOURCES/socal_11/EIDs_only_eid";
 if (not -f $file_eids) {die("\n check if $file_eids exists\n")}
 open(IN,$file_eids); @eids = <IN>; $nevent = @eids;
 

Modified: seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_3_adj_src_all.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_3_adj_src_all.pl	2008-11-14 13:46:51 UTC (rev 13308)
+++ seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/combine_3_adj_src_all.pl	2008-11-14 16:33:48 UTC (rev 13309)
@@ -8,7 +8,7 @@
 # for a set of events.
 # 
 # EXAMPLE:
-#    combine_3_adj_src_all.pl 2/30 3/30 6/30 cc cc cc m11
+#    combine_3_adj_src_all.pl 2/30 3/30 6/30 cc cc cc m13
 #
 #-----------------------------------
 
@@ -25,8 +25,8 @@
 $Ttag3 = sprintf("T%3.3i_T%3.3i",$Tmin3,$Tmax3);
 
 # list of event IDs
-$file_eids = "/net/sierra/raid1/carltape/results/EID_LISTS/kernels_run_${smodel}";  # favorites
-#$file_eids = "/net/sierra/raid1/carltape/results/SOURCES/socal_09/EIDs_only_eid";
+$file_eids = "/net/sierra/raid1/carltape/results/EID_LISTS/kernels_run_${smodel}";
+#$file_eids = "/net/sierra/raid1/carltape/results/SOURCES/socal_11/EIDs_only_eid";
 if (not -f $file_eids) {die("\n check if $file_eids exists\n")}
 open(IN,$file_eids); @eids = <IN>; $nevent = @eids;
 
@@ -54,8 +54,8 @@
 # loop over all events
 $k = 0;
 $imin = 1; $imax = $nevent;   # default
-#$imin = 1; $imax = 29;
-#$imin = 22; $imax = $imin;
+#$imin = 1; $imax = 17;
+#$imin = 92; $imax = $imin;
 
 for ($i = $imin; $i <= $imax; $i = $i+1) {
 

Modified: seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/prepare_mt_measure_adj.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/prepare_mt_measure_adj.pl	2008-11-14 13:46:51 UTC (rev 13308)
+++ seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/prepare_mt_measure_adj.pl	2008-11-14 16:33:48 UTC (rev 13309)
@@ -99,7 +99,7 @@
 
 # CMTSOLUTION file
 #$dir_cmt = "/net/sierra/raid1/carltape/results/SOURCES/socal_6/CMT_files_post_inverted";
-$dir_cmt = "/net/sierra/raid1/carltape/results/SOURCES/socal_10/CMT_files_pre_inverted";
+$dir_cmt = "/net/sierra/raid1/carltape/results/SOURCES/socal_11/CMT_files_pre_inverted";
 $cmtfile = "${dir_cmt}/CMTSOLUTION_${eid}";
 if (not -f $cmtfile) {die("check if cmtfile $cmtfile exist or not\n")}
 print CSH "\\rm CMTSOLUTION*\n";

Modified: seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/run_tomo.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/run_tomo.pl	2008-11-14 13:46:51 UTC (rev 13308)
+++ seismo/3D/ADJOINT_TOMO/measure_adj/scripts_tomo/run_tomo.pl	2008-11-14 16:33:48 UTC (rev 13309)
@@ -10,9 +10,9 @@
 #  events for which the windowing code has been run.
 #
 #  EXAMPLE (from working measure_adj directory) :
-#    run_tomo.pl m12 0 6/30 0.011 1/1/1  2.0/2.5/3.5/3.0 0.7/0.7/5.0/1.0 1.0/1.0 1.0
-#    run_tomo.pl m12 0 3/30 0.011 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/3.0/1.0 0.8/0.8 1.0
-#    run_tomo.pl m12 0 2/30 0.011 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/2.0/1.0 0.6/0.6 1.0
+#    run_tomo.pl m13 0 6/30 0.011 1/1/1  2.0/2.5/3.5/3.0 0.7/0.7/5.0/1.0 1.0/0.5 1.0
+#    run_tomo.pl m13 0 3/30 0.011 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/3.0/1.0 1.0/0.5 1.0
+#    run_tomo.pl m13 0 2/30 0.011 1/1/1 0.25/0.5/3.5/3.0 0.7/0.7/2.0/1.0 1.0/0.5 1.0
 #
 #  socal m00 - m04
 #    run_tomo.pl m04 0 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
@@ -23,6 +23,7 @@
 #  socal m09, MAX: 4.0 pm 0.6 (2-30s), 4.0 pm 0.8 (3-30s), 5.0 pm 0.8 (6-30s)
 #  socal m10, MAX: 2.0 pm 0.6 (2-30s), 3.0 pm 0.8 (3-30s), 5.0 pm 0.8 (6-30s)
 #  socal m12, MAX: 2.0 pm 0.6 (2-30s), 3.0 pm 0.8 (3-30s), 5.0 pm 1.0 (6-30s)
+#  socal m13, MAX: 2.0 pm 1.0 (2-30s), 3.0 pm 1.0 (3-30s), 5.0 pm 1.0 (6-30s)
 #  
 #==========================================================
 
@@ -49,7 +50,7 @@
 if (not -e $dir_pdf_all) {die("check if dir_pdf_all $dir_pdf_all exist or not\n")}
 
 # file containing event IDs, half-durations for source, and number of time-steps for simulations
-$file_eid = "$dir0/results/SOURCES/socal_10/EIDs_simulation_duration";
+$file_eid = "$dir0/results/SOURCES/socal_11/EIDs_simulation_duration";
 if (not -f ${file_eid}) {die("check if ${file_eid} exist or not\n")}
 open(IN,"${file_eid}"); @elines = <IN>; close(IN);
 $nevent = @elines;
@@ -73,7 +74,7 @@
 #die("testing");
 
 $imin = 1; $imax = $nevent;
-#$imin = 1; $imax = 100;
+#$imin = 1; $imax = 91;
 #$imin = 133; $imax = $imin;
 
 # EXAMPLE lines from EIDs_simulation_duration
@@ -108,6 +109,9 @@
    $lcut = "${lcut_min}/${lcut_max}";
 
    # time vector for adjoint sources
+   # KEY: The factor -1.5 is because this factor is used in SPECFEM3D.
+   #      When the kernel simulation is run, it will pick the start time
+   #      to be -1.5 hdur, where hdur comes from the CMTSOLUTION.
    $tstart = -1.5*$hdur;
    $tvec = "$tstart/$dt/$nstep";
 
@@ -133,6 +137,11 @@
      print "--> DO NOT RUN: no window file exists ($window_file)\n";
 
      } else {
+
+       print "--> delete individual PDF files in ${dir_pdf_all}\n";
+       print CSH "rm -rf ${dir_pdf_all}*/${eid}*\n";
+       print CSH "sleep 3s\n";
+
        print "--> run the measurement code and make adjoint sources\n";
        print CSH "prepare_mt_measure_adj.pl $smodel 0 1 0 $Ts $eid\n";
 



More information about the CIG-COMMITS mailing list