[cig-commits] r21219 - in seismo/3D/ADJOINT_TOMO/iterate_adj/matlab: . matlab_scripts

carltape at geodynamics.org carltape at geodynamics.org
Thu Jan 10 13:14:26 PST 2013


Author: carltape
Date: 2013-01-10 13:14:26 -0800 (Thu, 10 Jan 2013)
New Revision: 21219

Modified:
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compare_misfit.m
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m
   seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/matlab_scripts/read_window_chi_all.m
Log:
minor changes in iterate_adj matlab scripts


Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compare_misfit.m
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compare_misfit.m	2013-01-09 13:58:29 UTC (rev 21218)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compare_misfit.m	2013-01-10 21:14:26 UTC (rev 21219)
@@ -1,10 +1,9 @@
 %
 % compare_misfit.m
-% CARL TAPE, 30-July-2009
-% printed xxx
+% Carl Tape, 30-July-2009
 %
-% This program reads in two sets of window_chi files with identical
-% windows, computes the misfit for both, and then compute the variance
+% This program reads in two sets of window_chi files with IDENTICAL
+% WINDOWS, computes the misfit for both, and then compute the variance
 % reduction within each window.
 %
 % calls read_window_chi.m, plot_histo.m, readCMT.m, read_station_SPECFEM.m

Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m	2013-01-09 13:58:29 UTC (rev 21218)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/compute_misfit.m	2013-01-10 21:14:26 UTC (rev 21219)
@@ -1,7 +1,6 @@
 %
 % compute_misfit.m
-% CARL TAPE, 14-Oct-2009
-% printed xxx
+% Carl Tape, 14-Oct-2009
 %
 % This script reads in a set of window_chi output measurement files from
 % mt_measure_adj.f90, and it tabulates and plots misfit function values.
@@ -14,7 +13,6 @@
 % See also compare_misfit.m for comparing misfit values for multiple models.
 %
 % calls read_window_chi.m, plot_histo.m, readCMT.m, read_station_SPECFEM.m
-% called by xxx
 %
 
 %-------------------------
@@ -24,9 +22,10 @@
 format compact
 
 dir0 = '/home/carltape/RUNS/';
+mdir = pwd;
 
 % add path to additional matlab scripts
-path(path,[pwd '/matlab_scripts']);
+path(path,[mdir '/matlab_scripts']);
 
 % min and max periods for the different bandpassed datasets
 %Trange = [ 2 30 ; 3 30 ; 6 30 ];
@@ -70,7 +69,12 @@
 stdcov = stdcovs{idatacov};
 
 ftag = [stmod '_' stdcov];
-odir = ['OUTPUT_SUBSPACE/' stmod '/' stdcov '/'];
+odir = [mdir '/OUTPUT_SUBSPACE/' stmod '/' stdcov '/'];
+if ~exist(odir,'dir')
+    disp(['odir does not exist: ' odir]);
+    disp('try running setup_subspace_dir.pl to make directories');
+    error('exit compute_misfit.m');
+end
 
 iwrite = input(' Enter 1 to write files (0 otherwise) : ');
 
@@ -86,7 +90,10 @@
 %eid_file = ['/home/carltape/results/EID_LISTS/kernels_run_' stmod];
 %eid_file = ['/home/carltape/results/EID_LISTS/kernels_use_' stmod];
 
-etag = 'extra';     % simulation, tomo, extra
+%etag = 'extra';     % tomo, extra, simulation
+etags = {'tomo','extra','simulation'};
+ietag = input(' Enter suffix for EID list (1=tomo, 2=extra, 3=simulation): ');
+etag = etags{ietag};
 eid_file = ['/home/carltape/results/EID_LISTS/eids_' etag];
 
 %-------------------------
@@ -601,9 +608,12 @@
     iuse = find( sum(nwin_all_event,2) > 0);
     inds = ievent_full(iuse);
     writeCMT_psmeca([odir 'socal_tomo_' stmod],date(inds),slat(inds),slon(inds),...
-        dep(inds),M(inds,:),seid_cmt(inds));
+        dep(inds),M(:,inds),seid_cmt(inds));
 end
 
+%==========================================================================
+% ADDITIONAL FUNCTIONS
+
 break
 
 % list the events that use at least 15 stations
@@ -678,4 +688,4 @@
 meas_disp = meas_array(icheck(isort),:);
 display_meas(meas_disp,Tminvec,eids,strec,comps);
 
-%=======================================================================
+%==========================================================================

Modified: seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/matlab_scripts/read_window_chi_all.m
===================================================================
--- seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/matlab_scripts/read_window_chi_all.m	2013-01-09 13:58:29 UTC (rev 21218)
+++ seismo/3D/ADJOINT_TOMO/iterate_adj/matlab/matlab_scripts/read_window_chi_all.m	2013-01-10 21:14:26 UTC (rev 21219)
@@ -1,9 +1,9 @@
 %
 % read_window_chi_all.m
-% CARL TAPE, 14-March-2008
-% printed xxx
+% Carl Tape, 14-March-2008
 %
-% 
+% This reads in a set of measurement files that are produced by the
+% measure_adj softward package for making measurements and adjoint sources.
 %
 % calls read_window_chi.m
 % called by compute_misfit.m, compare_misfit.m
@@ -85,7 +85,8 @@
             k2 = k1+nwin-1;
             kinds = [k1:k2]';
 
-            % NOTE: remove the factors of 0.5 that is used in the wdiff definition
+            % NOTE: remove the factors of 0.5 that is used in the wdiff
+            %       definition in measure_adj.f90
             meas_array(kinds,:) = [kinds tt*ones(nwin,1) ii*ones(nwin,1) index_net index_rec index_comp iwin iker ...
                 seisdur windur T_pmax_dat T_pmax_syn ...
                 2*seisd2  2*wind2 2*seiss2  2*wins2 2*seisdiff2 2*windiff2 ...
@@ -128,4 +129,4 @@
     end
 end
 
-%======================================================
+%==========================================================================



More information about the CIG-COMMITS mailing list