[cig-commits] r12415 - seismo/3D/ADJOINT_TOMO/iterate_adj/matlab

carltape at geodynamics.org carltape at geodynamics.org
Mon Jul 14 12:28:54 PDT 2008


Author: carltape
Date: 2008-07-14 12:28:54 -0700 (Mon, 14 Jul 2008)
New Revision: 12415

Modified:
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/display_meas.m
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/make_dirs.pl
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/subspace_specfem.m
Log:
Updated matlab scripts for subspace method.


Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m	2008-07-14 19:20:12 UTC (rev 12414)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m	2008-07-14 19:28:54 UTC (rev 12415)
@@ -38,7 +38,7 @@
 %-------------------------
 % USER INPUT
 
-imod = input(' Enter model number (0, 1, ...): ');
+imod = input(' Enter the current model number (0, 1, ...): ');
 stmod = sprintf('m%2.2i',imod);
 
 idatacov = input(' Enter idatacov (1--by event, 2--by window, 3--none) : ');
@@ -57,8 +57,8 @@
 iwrite = input(' Enter 1 to write files (0 otherwise) : ');
 
 % files: event IDs, CMTSOLUTIONS, ststions
-eid_file = ['/net/sierra/raid1/carltape/results/KERNELS/kernel_' stmod '/kernels_' stmod'];
-cmt_file_all = '/net/sierra/raid1/carltape/results/SOURCES/socal_6/SOCAL_FINAL_CMT_v6';
+eid_file = ['/net/sierra/raid1/carltape/results/KERNELS/kernel_' stmod '/kernels_' stmod];
+cmt_file_all = '/net/sierra/raid1/carltape/results/SOURCES/socal_7/SOCAL_FINAL_CMT_v7';
 stations_file = '/home/carltape/gmt/stations/seismic/Matlab_output/STATIONS_CALIFORNIA_TOMO_INNER_specfem';
 
 %-------------------------
@@ -430,13 +430,14 @@
 
 %-------------------------------
 
-% % find records that meet particular criteria
-% DT_MIN = 5;
-% DT_SIGMA_MIN = 1;
-% icheck = find( and( meas_array(:,9) >= DT_MIN, meas_array(:,10) <= DT_SIGMA_MIN) )
-% [junk, isort] = sortrows( meas_array(icheck,:), -9 )
-% meas_disp = meas_array(icheck(isort),:);
-% display_meas(meas_disp,Tvec,eids,strec,comps);
+% find records that meet particular criteria
+DT_MIN = 5;
+%DT_SIGMA_MIN = 1;
+%icheck = find( and( meas_array(:,9) >= DT_MIN, meas_array(:,10) <= DT_SIGMA_MIN) )
+icheck = find( abs(meas_array(:,9)) >= DT_MIN )
+[junk, isort] = sortrows( meas_array(icheck,:), -9 );
+meas_disp = meas_array(icheck(isort),:);
+display_meas(meas_disp,Tvec,eids,strec,comps);
 
 % find records that meet particular criteria
 CHI_MIN = 100;

Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/display_meas.m
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/display_meas.m	2008-07-14 19:20:12 UTC (rev 12414)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/display_meas.m	2008-07-14 19:28:54 UTC (rev 12415)
@@ -13,36 +13,39 @@
 
 X = meas_array;
 [m,n] = size(X);
-if n ~= 13, error(' should be 13 columns in the input matrix'); end
+if n ~= 15, error(' should be 15 columns in the input matrix'); end
 
-% meas_array -->
-% kinds
-% tt*ones(nwin,1)
-% ii*ones(nwin,1)
-% index_rec
-% index_comp
-% iwin
-% iker
-% chi1
-% measCC_dT
-% sigmaCC_dT
-% measMT_dT
-% sigmaMT_dT
-% tr_chi
+%  1  kinds
+%  2  index_T
+%  3  index_event
+%  4  index_network
+%  5  index_rec
+%  6  index_comp
+%  7  iwin
+%  8  iker
+%  9  measCC_dT
+% 10  sigmaCC_dT
+% 11  measMT_dT
+% 12  sigmaMT_dT
+% 13  win_chi
+% 14  rec_chi                
+% 15  tr_chi
 
 index_win    = X(:,1);
 index_per    = X(:,2);
 index_event  = X(:,3);
-index_rec    = X(:,4);
-index_comp   = X(:,5);
-isub_win     = X(:,6);
-iker         = X(:,7);
-chi_waveform = X(:,8);
+index_net    = X(:,4);
+index_rec    = X(:,5);
+index_comp   = X(:,6);
+isub_win     = X(:,7);
+iker         = X(:,8);
 measCC_dT    = X(:,9);
 sigmaCC_dT   = X(:,10);
 measMT_dT    = X(:,11);
 sigmaMT_dT   = X(:,12);
-tr_chi       = X(:,13);
+win_chi      = X(:,13);
+rec_chi      = X(:,14);
+tr_chi       = X(:,15);
 
 disp('----------------');
 disp('INDEX (window, period, event, receiver, component)');

Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/make_dirs.pl
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/make_dirs.pl	2008-07-14 19:20:12 UTC (rev 12414)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/make_dirs.pl	2008-07-14 19:28:54 UTC (rev 12415)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 #-----------------------------------
-# Carl Tape, 22-April-2008
+# Carl Tape, 11-July-2008
 # make_dirs.pl
 #
 # This script empties the files within the mu directories.
@@ -9,7 +9,7 @@
 #
 # This should be run prior to running subspace_specfem.m.
 #
-# EXAMPLE: make_dirs.pl 2
+# EXAMPLE: make_dirs.pl 10
 #
 #-----------------------------------
 

Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/subspace_specfem.m
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/subspace_specfem.m	2008-07-14 19:20:12 UTC (rev 12414)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/subspace_specfem.m	2008-07-14 19:28:54 UTC (rev 12415)
@@ -25,7 +25,7 @@
 ylab1 = 'log10( singular value )';
 ylab2 = 'log10( misfit : dot[ d - G*dm(p), d - G*dm(p) ] )';
 
-imod = input(' Enter model number (0, 1, ...): ');
+imod = input(' Enter the current model number (0, 1, ...): ');
 iwrite = input(' Enter 1 to write files (0 otherwise) : ');
 
 stmod = sprintf('m%2.2i',imod);
@@ -34,7 +34,7 @@
 sthess = ['/net/sierra/raid1/carltape/results/HESSIANS/'];
 
 % load the data and event weights (compute_misfit.m)
-idatacov = input(' Enter idatacov (1, 2, 3) : ');
+idatacov = input(' Enter idatacov (1--by event, 2--by window, 3--none) : ');
 stdcovs = {'event','window','none'};
 stdcov = stdcovs{idatacov};
 ftag = [stmod '_' stdcov];
@@ -245,13 +245,14 @@
             lamvec = 10.^lampwr * sum(dH);                  % based on trace of H
             %lamvec = 10.^lampwr * sqrt(sum(diag(H'*H)));    % based on trace of H'*H
         else
-            minlampwr = -2; maxlampwr = 5;
+            %minlampwr = -2; maxlampwr = 5;                 % m03
+            minlampwr = -3; maxlampwr = 3;                 % m04
             lampwr = linspace(minlampwr,maxlampwr,numlam);
             lamvec = 10.^lampwr;
         end
 
         [f_h, rss, mss, Gvec, Fvec, dof, kap, iL, iGCV, iOCV] = ridge_carl(dnorm,H,lamvec);
-        title({stkerlab,sprintf('iL = %i,  iOCV = %i,  iGCV = %i',iL,iOCV,iGCV)});
+        title({['model ' stmod],stkerlab,sprintf('iL = %i,  iOCV = %i,  iGCV = %i',iL,iOCV,iGCV)});
         
         mu_all = zeros(nsrc,numlam);
         mu_norm = zeros(numlam,1);



More information about the cig-commits mailing list