[cig-commits] r12546 - in seismo/3D/ADJOINT_TOMO/flexwin: scripts user_files/socal_3D

carltape at geodynamics.org carltape at geodynamics.org
Wed Aug 6 08:05:25 PDT 2008


Author: carltape
Date: 2008-08-06 08:05:25 -0700 (Wed, 06 Aug 2008)
New Revision: 12546

Added:
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00_orig
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T004_m07
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00_orig.f90
Modified:
   seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl
   seismo/3D/ADJOINT_TOMO/flexwin/scripts/plot_windows_all.pl
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m07
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_m00
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00.f90
   seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m07.f90
Log:
Added more parameter files for socal data and modified run scripts.


Modified: seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/scripts/pick_all_windows.pl	2008-08-06 15:05:25 UTC (rev 12546)
@@ -27,7 +27,7 @@
 #    iexecute      boolean: whether to execute the Shell script
 #
 #  DIRECTORIES:
-#    dir_data       directory containing data directories
+#    dir_data      directory containing data directories
 #    dir_syn       directory containing synthetics directories
 #    dir_win_code  directory for compiling the windowing code
 #    dir_win_run   directory for running the windowing code
@@ -39,6 +39,7 @@
 #
 #  EXAMPLES:
 #    pick_all_windows.pl m07 0 6/40   1/204 1/1/1/0 1 0     # make plots and WINDOWS file, T = 6-40s
+#    pick_all_windows.pl m07 0 4/40   1/204 1/1/1/1 1 0     # 
 #    pick_all_windows.pl m07 0 2/40   1/204 1/1/1/1 1 0     # make plots and WINDOWS file, T = 2-40s
 #
 #    pick_all_windows.pl m00 0 6/40 179/179 1/1/0/0 1 0     # make plots only, T = 6-40s
@@ -362,7 +363,9 @@
 	print CSH "\\cp ${reclist_dist} ${reclist_out}\n";
 
 	# generate composite PDF file using plot_windows_all.pl
-        # NOTE: This takes a long time, and is not really necessary if you plot them in mt_measure_adj
+        # NOTE: This takes a long time, and is not really necessary
+        #       if have already determined the windowing code parameters
+        #       and you are planning to plot them in mt_measure_adj.
         if($iplotall == 1) {
 	   $pdffile = "$odir/${eout}_all.pdf";
 	   print CSH "${plot_windows_perl} ${dir_win_code} ${dir_win_run_meas} ${reclist_dist} $pdffile\n";

Modified: seismo/3D/ADJOINT_TOMO/flexwin/scripts/plot_windows_all.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/scripts/plot_windows_all.pl	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/scripts/plot_windows_all.pl	2008-08-06 15:05:25 UTC (rev 12546)
@@ -26,16 +26,12 @@
 if (@ARGV < 4) {die("Usage: plot_windows_all.pl dir_win dir_win_run_meas recfile outfile \n")}
 ($dir_win,$dir_win_run_meas,$recfile,$outfile) = @ARGV;
 
+$pwd = $ENV{PWD};
+
 # get output directory
 $ofile_base = `basename $outfile`; chomp($ofile_base);
 ($odir) = split($ofile_base,$outfile);
 
-# ls twice (for running from narsil or elendil)
-if (not -e $odir) {`ls $odir`}
-if (not -e $odir) {`ls $odir`}
-
-#$outfile1 = "${dir_win_run_meas}/$outfile0";
-
 # directory containing the plotting scripts
 $dir_scripts = "${dir_win}/scripts";
 if (not -e ${dir_scripts}) {die("check if ${dir_scripts} exist or not\n")}
@@ -56,18 +52,13 @@
 
 print "\n $nrec number of total receivers \n";
 
-# write the C-shell script to file
-$cshfile1 = "plot_windows_all_1.csh";
-print "\nWriting to $cshfile1 ...\n";
-open(CSH,">$cshfile1");
-
 for ($irec = 1; $irec <= $nrec; $irec++) {
 
    # get receiver information
    #($namerec,$namenet,$az,$nwin,$winstr) = split(" ",$reclines[$irec-1]);
   ($junk1,$dist,$junk2,$junk3,$junk4,$junk5,$namerec,$namenet) = split(" ",$reclines[$irec-1]);
 
-  print CSH "echo $irec out of $nrec -- $namerec\n";
+  print "$irec out of $nrec -- $namerec\n";
   #print "\n $namerec $namenet $az $nwin $winstr";
 
    for ($icomp = 1; $icomp <= $ncomp; $icomp++) {
@@ -75,25 +66,21 @@
       #$filename = "$namerec.$namenet.$comps[$icomp-1].$suffix";
       $filename = "$namerec.$namenet.$comps[$icomp-1]";
       $obsfile = "${dir_win_run_meas}/${filename}.obs";
-      print "\n $obsfile";
 
-      # generate output PDF files
+      # generate output PDF files -- make sure that plot_seismos_gmt.sh is doing this
       if (-f $obsfile)  {
-         print CSH "${dir_scripts}/plot_seismos_gmt.sh ${dir_win_run_meas}/$filename\n";
+         print "$obsfile\n";
+         $ftag = "${dir_win_run_meas}/${filename}";
+         `${dir_scripts}/plot_seismos_gmt.sh $ftag`;
       }
    }
-
 }  # rec
 
-close(CSH);
-system("csh -f $cshfile1");
-#die("testing");
-
 #======================
 # concatenate the PDF files into one document
 
 # convert overall stats figures to pdfs
-# THIS IS NOW DONE IN extract_event_windowing_stats_carl.sh
+# THIS IS DONE IN extract_event_windowing_stats_carl.sh
 $allstats = "${dir_win_run_meas}/event_winstats";
 $recordsec = "${dir_win_run_meas}/event_recordsection";
 #`cp ${allstats}.eps ${allstats}.ps`;
@@ -144,82 +131,4 @@
 
 print "\n ";
 
-##======================
-## concatenate the PDF files into one document
-
-## write the C-shell script to file
-#$cshfile2 = "plot_windows_all_2.csh";
-#print "\nWriting to $cshfile2 ...\n";
-#open(CSH,">$cshfile2");
-
-## convert overal stats figures to pdfs
-#$allstats = "${dir_win_run_meas}/event_winstats";
-#$recordsec = "${dir_win_run_meas}/event_recordsection";
-#print CSH "cp ${allstats}.eps ${allstats}.ps\n";
-#print CSH "cp ${recordsec}.eps ${recordsec}.ps\n";
-#print CSH "ps2pdf ${allstats}.ps ${allstats}.pdf\n";
-#print CSH "ps2pdf ${recordsec}.ps ${recordsec}.pdf\n";
-
-## concatenate pdf files
-#$k = 1;
-#@pdcat = "/home/carltape/bin/pdcat -r";
-#$pdcat[$k] = "${allstats}.pdf"; $k = $k+1;
-#$pdcat[$k] = "${recordsec}.pdf"; $k = $k+1;
-
-## this ensures that the order of concatenation in the PDF file
-## is done according to the order in the recfile
-
-#for ($irec = 1; $irec <= $nrec; $irec++) {
-
-#   # get receiver information
-#  ($junk1,$dist,$junk2,$junk3,$junk4,$junk5,$namerec,$namenet) = split(" ",$reclines[$irec-1]);
-#  #($namerec,$namenet,$az,$nwin,$winstr) = split(" ",$reclines[$irec-1]);
-
-#  print "\n $namerec $namenet";
-
-#   for ($icomp = 1; $icomp <= $ncomp; $icomp++) {
-
-#      #$filename = "$namerec.$namenet.$comps[$icomp-1].$suffix";
-#      $filename = "$namerec.$namenet.$comps[$icomp-1]";
-#      print CSH "echo $filename\n";
-
-#      $file1tag = "${dir_win_run_meas}/$filename.$figfiles[0]";
-#      $file2tag = "${dir_win_run_meas}/$filename.$figfiles[1]";
-#      $file3tag = "${dir_win_run_meas}/$filename.$figfiles[2]";
-
-#      if (-f "${file1tag}.pdf")  {
-#         $pdcat[$k] = "${file1tag}.pdf"; $k = $k+1;
-#      }
-
-#      #if (-f "${file1tag}.eps")  {
-#      #   print CSH "cp ${file1tag}.eps ${file1tag}.ps\n";
-#      #   print CSH "ps2pdf ${file1tag}.ps ${file1tag}.pdf\n";
-#      #   $pdcat[$k] = "${file1tag}.pdf"; $k = $k+1;
-#      #}
-#      #if (-f "${file2tag}.eps")  {
-#      #   print CSH "cp ${file2tag}.eps ${file2tag}.ps\n";
-#      #   print CSH "ps2pdf ${file2tag}.ps ${file2tag}.pdf\n";
-#      #   $pdcat[$k] = "${file2tag}.pdf"; $k = $k+1;
-#      #}
-#      #if (-f "${file3tag}.eps")  {
-#      #   print CSH "cp ${file3tag}.eps ${file3tag}.ps\n";
-#      #   print CSH "ps2pdf ${file3tag}.ps ${file3tag}.pdf\n";
-#      #   $pdcat[$k] = "${file3tag}.pdf"; $k = $k+1;
-#      #}
-#   }
-
-#}  # rec
-
-##======================
-
-##`rm $outfile`;   # remove the output file if it exists
-#$pdcat[$k] = "$outfile";
-
-#print CSH "@pdcat\n";
-
-#close(CSH);
-#system("csh -f $cshfile2");
-
-#print "\n ";
-
 #=================================================================

Modified: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00	2008-08-06 15:05:25 UTC (rev 12546)
@@ -30,7 +30,7 @@
 
 # -------------------------------------------------------------
 # TSHIFT
-TSHIFT_BASE                     = 6.0
+TSHIFT_BASE                     = 5.0
 
 # -------------------------------------------------------------
 # limit on CC for window acceptance
@@ -57,7 +57,7 @@
 # -------------------------------------------------------------
 # Fine tuning constants 
 C_0  (internal minima)          = 1.0
-C_1  (small windows)            = 4.0
+C_1  (small windows)            = 5.0
 C_2  (prominence)               = 0.0
 C_3a (separation height)        = 4.0 
 C_3b (separation time)          = 2.5 

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00_orig
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00_orig	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m00_orig	2008-08-06 15:05:25 UTC (rev 12546)
@@ -0,0 +1,69 @@
+# -------------------------------------------------------------
+#
+#    This is the parameter file for FLEXWIN.  It is based on the
+#    same syntax as the Par_file for SPECFEM.  Variable names are
+#    put first, values are placed after the 34th column.
+#
+#    Comment lines and blank lines are significant.  If you
+#    change the layout of this file or add/remove parameters
+#    you must also modify the user_variables module and the 
+#    read_parameter_file subroutine at the start of seismo_subs.f90.
+#    
+# -------------------------------------------------------------
+ 
+# -------------------------------------------------------------
+# boolean parameters
+DEBUG                           = .true.
+MAKE_SEISMO_PLOTS               = .true.
+MAKE_WINDOW_FILES               = .true.
+BODY_WAVE_ONLY                  = .true.
+
+# -------------------------------------------------------------
+# period min/max for filtering
+RUN_BANDPASS                    = .false.
+WIN_MIN_PERIOD                  = 2.00
+WIN_MAX_PERIOD                  = 40.00
+
+# -------------------------------------------------------------
+# E(t) water level
+STALTA_BASE                     = 0.07
+
+# -------------------------------------------------------------
+# TSHIFT
+TSHIFT_BASE                     = 6.0
+
+# -------------------------------------------------------------
+# limit on CC for window acceptance
+CC_BASE                         = 0.85
+
+# -------------------------------------------------------------
+# limit on dlnA (dA/A) for window acceptance
+DLNA_BASE                       = 1.0
+
+# -------------------------------------------------------------
+# boolean switch for check_data_quality
+DATA_QUALITY                    = .true.
+
+# if DATA_QUALITY = .true. and if two different measurements of
+# signal-to-noise ratios exceeds these two base levels,
+# then the data time series (and syn) is kept
+SNR_INTEGRATE_BASE              = 2.5  
+SNR_MAX_BASE                    = 3.5
+
+# -------------------------------------------------------------
+# limit on signal to noise ratio in a particular window.
+WINDOW_AMP_BASE                 = 4.0
+
+# -------------------------------------------------------------
+# Fine tuning constants 
+C_0  (internal minima)          = 1.0
+C_1  (small windows)            = 4.0
+C_2  (prominence)               = 0.0
+C_3a (separation height)        = 4.0 
+C_3b (separation time)          = 2.5 
+C_4a (curtail on left)          = 2.0 
+C_4b (curtail on right)         = 6.0 
+
+WEIGHT_SPACE_COVERAGE           = 1.0
+WEIGHT_AVERAGE_CC               = 0.0
+WEIGHT_N_WINDOWS                = 5.0

Modified: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m07
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m07	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T002_m07	2008-08-06 15:05:25 UTC (rev 12546)
@@ -57,7 +57,7 @@
 # -------------------------------------------------------------
 # Fine tuning constants 
 C_0  (internal minima)          = 1.0
-C_1  (small windows)            = 6.0
+C_1  (small windows)            = 5.0
 C_2  (prominence)               = 0.0
 C_3a (separation height)        = 4.0 
 C_3b (separation time)          = 2.5 

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T004_m07
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T004_m07	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T004_m07	2008-08-06 15:05:25 UTC (rev 12546)
@@ -0,0 +1,69 @@
+# -------------------------------------------------------------
+#
+#    This is the parameter file for FLEXWIN.  It is based on the
+#    same syntax as the Par_file for SPECFEM.  Variable names are
+#    put first, values are placed after the 34th column.
+#
+#    Comment lines and blank lines are significant.  If you
+#    change the layout of this file or add/remove parameters
+#    you must also modify the user_variables module and the 
+#    read_parameter_file subroutine at the start of seismo_subs.f90.
+#    
+# -------------------------------------------------------------
+ 
+# -------------------------------------------------------------
+# boolean parameters
+DEBUG                           = .true.
+MAKE_SEISMO_PLOTS               = .true.
+MAKE_WINDOW_FILES               = .true.
+BODY_WAVE_ONLY                  = .false.
+
+# -------------------------------------------------------------
+# period min/max for filtering
+RUN_BANDPASS                    = .false.
+WIN_MIN_PERIOD                  = 4.00
+WIN_MAX_PERIOD                  = 40.00
+
+# -------------------------------------------------------------
+# E(t) water level  (0.23)
+STALTA_BASE                     = 0.22
+
+# -------------------------------------------------------------
+# TSHIFT
+TSHIFT_BASE                     = 4.0
+
+# -------------------------------------------------------------
+# limit on CC for window acceptance
+CC_BASE                         = 0.80
+
+# -------------------------------------------------------------
+# limit on dlnA (dA/A) for window acceptance
+DLNA_BASE                       = 1.5
+
+# -------------------------------------------------------------
+# boolean switch for check_data_quality
+DATA_QUALITY                    = .true.
+
+# if DATA_QUALITY = .true. and if two different measurements of
+# signal-to-noise ratios exceeds these two base levels,
+# then the data time series (and syn) is kept
+SNR_INTEGRATE_BASE              = 3.0  
+SNR_MAX_BASE                    = 3.5
+
+# -------------------------------------------------------------
+# limit on signal to noise ratio in a particular window.
+WINDOW_AMP_BASE                 = 2.5
+
+# -------------------------------------------------------------
+# Fine tuning constants 
+C_0  (internal minima)          = 0.7
+C_1  (small windows)            = 3.0
+C_2  (prominence)               = 0.0
+C_3a (separation height)        = 3.0 
+C_3b (separation time)          = 2.0 
+C_4a (curtail on left)          = 2.5
+C_4b (curtail on right)         = 12.0 
+
+WEIGHT_SPACE_COVERAGE           = 1.0
+WEIGHT_AVERAGE_CC               = 0.0
+WEIGHT_N_WINDOWS                = 0.0

Modified: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_m00
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_m00	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/PAR_FILE_T006_m00	2008-08-06 15:05:25 UTC (rev 12546)
@@ -30,7 +30,7 @@
 
 # -------------------------------------------------------------
 # TSHIFT
-TSHIFT_BASE                     = 12.0
+TSHIFT_BASE                     = 10.0
 
 # -------------------------------------------------------------
 # limit on CC for window acceptance

Modified: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00.f90	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00.f90	2008-08-06 15:05:25 UTC (rev 12546)
@@ -41,18 +41,18 @@
   ! see Liu et al. (2004), p. 1755, but note that the PARENTHESES
   ! that are listed in the publication should not be there
   ! THESE ARE PROBABLY NOT ACCURATE ENOUGH FOR LONGER PATHS.
+
+  Sw_start  = -15.0 + dist_km/3.5
+  Sw_end    =  35.0 + dist_km/3.1
+
   if (BODY_WAVE_ONLY) then
      !Pnl_start =  P_pick - 5.0
      !S_end     =  S_pick + 5.0
      Pnl_start =  P_pick - 2.5*WIN_MIN_PERIOD
      S_end     =  S_pick + 2.5*WIN_MIN_PERIOD
-     Sw_start  = -15.0 + dist_km/3.5
-     Sw_end    =  35.0 + dist_km/3.1
 
   else
      Pnl_start =  -5.0 + dist_km/7.8
-     Sw_start  = -15.0 + dist_km/3.5
-     Sw_end    =  35.0 + dist_km/3.1
      S_end     =  Sw_start
   endif
 
@@ -77,26 +77,28 @@
 
      ! raises STA/LTA water level after surface wave arrives
      if (BODY_WAVE_ONLY) then
-        if(time.gt.S_end) then
+
+        !if(time.gt.S_end) then
+        if(time.gt.Sw_end) then
            STALTA_W_LEVEL(i) = 10.*STALTA_BASE
         endif
-
+     
      else
-        ! set time- and distance-specific Tshift and DlnA to mimic Qinya's criteria
-        ! (see Liu et al., 2004, p. 1755; note comment above)
-        if(time.ge.Pnl_start .and. time.lt.Sw_start) then
-           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
-           TSHIFT_LIMIT(i) = 3.0 + dist_km/80.0
-        endif
-        if(time.ge.Sw_start .and. time.le.Sw_end) then
-           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
-           TSHIFT_LIMIT(i) = 3.0 + dist_km/50.0
-        endif
+!!$        ! set time- and distance-specific Tshift and DlnA to mimic Qinya's criteria
+!!$        ! (see Liu et al., 2004, p. 1755; note comment above)
+!!$        if(time.ge.Pnl_start .and. time.lt.Sw_start) then
+!!$           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
+!!$           TSHIFT_LIMIT(i) = 3.0 + dist_km/80.0
+!!$        endif
+!!$        if(time.ge.Sw_start .and. time.le.Sw_end) then
+!!$           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
+!!$           TSHIFT_LIMIT(i) = 3.0 + dist_km/50.0
+!!$        endif
 
         ! double the STA/LTA water level after the surface waves
-        if(time.gt.Sw_end) then
-           STALTA_W_LEVEL(i) = 2.0*STALTA_BASE
-        endif
+        !if(time.gt.Sw_end) then
+        !   STALTA_W_LEVEL(i) = 2.0*STALTA_BASE
+        !endif
 
      endif
 

Added: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00_orig.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00_orig.f90	                        (rev 0)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m00_orig.f90	2008-08-06 15:05:25 UTC (rev 12546)
@@ -0,0 +1,135 @@
+! -------------------------------------------------------------
+! Edit here to change the time dependent properties of the selection criteria
+! Note, this function is called AFTER the seismogram has been read.
+! -------------------------------------------------------------
+subroutine set_up_criteria_arrays
+  use seismo_variables 
+
+  integer :: i
+  double precision :: time
+
+  ! for qinya's scsn picking
+  double precision :: Pnl_start, S_end, Sw_start, Sw_end
+ 
+!===========================
+
+! -----------------------------------------------------------------
+! This is the basic version of the subroutine - no variation with time
+! -----------------------------------------------------------------
+   do i = 1, npts
+     time = b+(i-1)*dt
+     DLNA_LIMIT(i) = DLNA_BASE
+     CC_LIMIT(i) = CC_BASE
+     TSHIFT_LIMIT(i) = TSHIFT_BASE       ! WIN_MIN_PERIOD/2.0
+     STALTA_W_LEVEL(i) = STALTA_BASE
+     S2N_LIMIT(i) = WINDOW_AMP_BASE
+   enddo
+
+!!$  if (.not. BODY_WAVE_ONLY) then
+!!$     Pnl_start =  -5.0 + dist_km/7.8
+!!$     Sw_start  = -15.0 + dist_km/3.5
+!!$     Sw_end    =  35.0 + dist_km/3.1
+!!$  else
+!!$     Pnl_start =  P_pick - 5.0
+!!$     S_end     =  S_pick + 5.0
+!!$     Sw_start  = -15.0 + dist_km/3.5
+!!$     Sw_end    =  35.0 + dist_km/3.1
+!!$  endif
+
+  ! regional (Qinya's formulation):
+  ! -------------------------------------------------------------
+  ! see Liu et al. (2004), p. 1755, but note that the PARENTHESES
+  ! that are listed in the publication should not be there
+  ! THESE ARE PROBABLY NOT ACCURATE ENOUGH FOR LONGER PATHS.
+  if (BODY_WAVE_ONLY) then
+     !Pnl_start =  P_pick - 5.0
+     !S_end     =  S_pick + 5.0
+     Pnl_start =  P_pick - 2.5*WIN_MIN_PERIOD
+     S_end     =  S_pick + 2.5*WIN_MIN_PERIOD
+     Sw_start  = -15.0 + dist_km/3.5
+     Sw_end    =  35.0 + dist_km/3.1
+
+  else
+     Pnl_start =  -5.0 + dist_km/7.8
+     Sw_start  = -15.0 + dist_km/3.5
+     Sw_end    =  35.0 + dist_km/3.1
+     S_end     =  Sw_start
+  endif
+
+  ! variables for signal to noise ratio criteria.
+  signal_end = Sw_end
+  noise_end  = Pnl_start
+  if(DEBUG) then
+     write(*,*) 'DEBUG : P_pick = ', sngl(P_pick)
+     write(*,*) 'DEBUG : signal_end = ', sngl(sigmal_end)
+     write(*,*) 'DEBUG : noise_end = ', sngl(noise_end)
+  endif
+
+ ! --------------------------------
+ ! modulate criteria in time
+  do i = 1, npts
+     time = b+(i-1)*dt     ! time
+
+     ! raises STA/LTA water level before P wave arrival.
+     if(time.lt.Pnl_start) then
+        STALTA_W_LEVEL(i) = 10.*STALTA_BASE
+     endif
+
+     ! raises STA/LTA water level after surface wave arrives
+     if (BODY_WAVE_ONLY) then
+        if(time.gt.S_end) then
+           STALTA_W_LEVEL(i) = 10.*STALTA_BASE
+        endif
+
+     else
+        ! set time- and distance-specific Tshift and DlnA to mimic Qinya's criteria
+        ! (see Liu et al., 2004, p. 1755; note comment above)
+        if(time.ge.Pnl_start .and. time.lt.Sw_start) then
+           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
+           TSHIFT_LIMIT(i) = 3.0 + dist_km/80.0
+        endif
+        if(time.ge.Sw_start .and. time.le.Sw_end) then
+           !DLNA_LIMIT(i) = 1.5  ! ratio is 2.5, and dlna is ratio-1
+           TSHIFT_LIMIT(i) = 3.0 + dist_km/50.0
+        endif
+
+        ! double the STA/LTA water level after the surface waves
+        if(time.gt.Sw_end) then
+           STALTA_W_LEVEL(i) = 2.0*STALTA_BASE
+        endif
+
+     endif
+
+  enddo
+
+! The following is for check_window quality_s2n
+
+! -----------------------------------------------------------------
+! Start of user-dependent portion
+
+! This is where you modulate the time dependence of the selection
+! criteria.  You have access to the following parameters from the 
+! seismogram itself:
+!
+! dt, b, kstnm, knetwk, kcmpnm
+! evla, evlo, stla, stlo, evdp, azimuth, backazimuth, dist_deg, dist_km
+! num_phases, ph_names, ph_times
+!
+! Example of modulation:
+!-----------------------
+! To increase s2n limit after arrival of R1 try
+!
+! R_vel=3.2
+! R_time=dist_km/R_vel
+! do i = 1, npts
+!   time=b+(i-1)*dt
+!   if (time.gt.R_time) then
+!     S2N_LIMIT(i)=2*WINDOW_AMP_BASE
+!   endif
+! enddo
+!
+! End of user-dependent portion
+! -----------------------------------------------------------------
+
+end subroutine set_up_criteria_arrays
+! -------------------------------------------------------------

Modified: seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m07.f90
===================================================================
--- seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m07.f90	2008-08-06 14:41:41 UTC (rev 12545)
+++ seismo/3D/ADJOINT_TOMO/flexwin/user_files/socal_3D/user_functions_m07.f90	2008-08-06 15:05:25 UTC (rev 12546)
@@ -41,18 +41,18 @@
   ! see Liu et al. (2004), p. 1755, but note that the PARENTHESES
   ! that are listed in the publication should not be there
   ! THESE ARE PROBABLY NOT ACCURATE ENOUGH FOR LONGER PATHS.
+
+  Sw_start  = -15.0 + dist_km/3.5
+  Sw_end    =  35.0 + dist_km/3.1
+
   if (BODY_WAVE_ONLY) then
      !Pnl_start =  P_pick - 5.0
      !S_end     =  S_pick + 5.0
      Pnl_start =  P_pick - 2.5*WIN_MIN_PERIOD
      S_end     =  S_pick + 2.5*WIN_MIN_PERIOD
-     Sw_start  = -15.0 + dist_km/3.5
-     Sw_end    =  35.0 + dist_km/3.1
 
   else
      Pnl_start =  -5.0 + dist_km/7.8
-     Sw_start  = -15.0 + dist_km/3.5
-     Sw_end    =  35.0 + dist_km/3.1
      S_end     =  Sw_start
   endif
 
@@ -76,12 +76,14 @@
      endif
 
      ! raises STA/LTA water level after surface wave arrives
-     !if (BODY_WAVE_ONLY) then
-     !   if(time.gt.S_end) then
-     !      STALTA_W_LEVEL(i) = 10.*STALTA_BASE
-     !   endif
-     !
-     !else
+     if (BODY_WAVE_ONLY) then
+
+        !if(time.gt.S_end) then
+        if(time.gt.Sw_end) then
+           STALTA_W_LEVEL(i) = 10.*STALTA_BASE
+        endif
+     
+     else
 !!$        ! set time- and distance-specific Tshift and DlnA to mimic Qinya's criteria
 !!$        ! (see Liu et al., 2004, p. 1755; note comment above)
 !!$        if(time.ge.Pnl_start .and. time.lt.Sw_start) then
@@ -98,7 +100,7 @@
         !   STALTA_W_LEVEL(i) = 2.0*STALTA_BASE
         !endif
 
-     !endif
+     endif
 
   enddo
 



More information about the cig-commits mailing list