diff --git a/MuRAT3.mlx b/MuRAT3.mlx index 54e4259..678843b 100644 Binary files a/MuRAT3.mlx and b/MuRAT3.mlx differ diff --git a/Murat_inputMSH.mlx b/Murat_inputMSH.mlx index ce796a6..8e596b0 100644 Binary files a/Murat_inputMSH.mlx and b/Murat_inputMSH.mlx differ diff --git a/Murat_inputRomania.mlx b/Murat_inputRomania.mlx index c86a582..2a6ecbf 100644 Binary files a/Murat_inputRomania.mlx and b/Murat_inputRomania.mlx differ diff --git a/Murat_inputToba.mlx b/Murat_inputToba.mlx index 3c34bc0..5a207ff 100644 Binary files a/Murat_inputToba.mlx and b/Murat_inputToba.mlx differ diff --git a/bin/Murat_body.m b/bin/Murat_body.m index 5734f3a..d3f4751 100644 --- a/bin/Murat_body.m +++ b/bin/Murat_body.m @@ -20,18 +20,22 @@ % energyRatioBodyCoda_i: energy ratio between body and coda waves % energyRatioCodaNoise_i: energy ratio between coda waves and noise +% Redefine windows with sampling for noise and direct waves int = bodyWindow*srate_i; lc = length(cursorCodaStart_i:cursorCodaEnd_i); cursor0 = floor(startNoise*srate_i); cursor0_1 = floor(cursor0 + int); cursor2 = floor(cursorPick_i + int-1); +% Direct wave normalised by window length spamp =... trapz(sp_i(cursorPick_i:cursor2,:))/int; +% Noise pre-pick normalised by window length spampn =... trapz(sp_i(cursor0:cursor0_1,:))/int; +% Coda normalised by window length spampc =... trapz(sp_i(cursorCodaStart_i:cursorCodaEnd_i,:))/lc; diff --git a/bin/Murat_checks.m b/bin/Murat_checks.m index 1a13e47..124f004 100644 --- a/bin/Murat_checks.m +++ b/bin/Murat_checks.m @@ -1,9 +1,7 @@ % ADDITIONAL input variables that are not set by the user. function Murat = Murat_checks(Murat) -% INPUTS -%dataDirectory = ['./' Murat.input.dataDirectory]; -dataDirectory = [Murat.input.dataDirectory]; %if data is outside of current folder +dataDirectory = [Murat.input.dataDirectory]; FPath = './'; FLabel = Murat.input.label; PTime = ['SAChdr.times.' Murat.input.PTime]; diff --git a/bin/Murat_codaCheck.m b/bin/Murat_codaCheck.m index 5a0df08..bc3778b 100644 --- a/bin/Murat_codaCheck.m +++ b/bin/Murat_codaCheck.m @@ -25,18 +25,22 @@ % cursorCodaStart_i: coda starting time after check on trace % cursorCodaEnd_i: coda end time after check on trace +%Define envelope duration t00 = tempis(1); lengthTempis = length(tempis); +% Method peak is generally valid for active seismics if isequal(peakDelayMethod,'Peak') tCoda_i =... (pktime_i-originTime_i)+peakDelay_i; - + +% Method constant is the most used in small local tomography elseif isequal(peakDelayMethod,'Constant') tCoda_i = tCm; - + +% Method travel is the standard at the regional scale elseif isequal(peakDelayMethod,'Travel') tCoda_i =... @@ -44,12 +48,14 @@ end +% Define the indexes along the seismogram cursorCodaStart_i =... floor((originTime_i - t00 + tCoda_i) * srate_i - 1); cursorCodaEnd_i =... floor(cursorCodaStart_i + tWm * srate_i - 1); +% Some seismograms are not long enough so you consider a shorter window if cursorCodaEnd_i > lengthTempis cursorCodaEnd_i = lengthTempis; end diff --git a/bin/Murat_cornering.m b/bin/Murat_cornering.m index b858f5f..a39be9d 100644 --- a/bin/Murat_cornering.m +++ b/bin/Murat_cornering.m @@ -14,8 +14,8 @@ % Output parameters: % ip: index of minimum x grid coord - West; % jp: index of minimum y grid coord - South; -% kp: i ndex of maximum z grid coord - shallowest. - +% kp: index of maximum z grid coord - shallowest. +% flag: flags if ray outside of grid % Coordinates of the propagation grid are unwrapped xGrid = gridD.x; diff --git a/bin/Murat_data.m b/bin/Murat_data.m index e9edc2b..38ad67b 100644 --- a/bin/Murat_data.m +++ b/bin/Murat_data.m @@ -21,6 +21,7 @@ cf = Murat.input.centralFrequency; lcf = length(cf); +workers = Murat.input.workers; origin = Murat.input.origin; originTime = Murat.input.originTime; PTime = Murat.input.PTime; @@ -68,7 +69,7 @@ % on peak delays and coda attenuation. count_trash = 0; -for i = 1:lengthData +parfor (i = 1:lengthData,workers) if isequal(mod(i,100),0) @@ -182,21 +183,21 @@ end % Setting up the final data vectors and matrices with checks on values -Murat.data.locationsDeg = locationDeg; -Murat.data.locationsM = locationM; -Murat.data.theoreticalTime = theoreticalTime; -Murat.data.peakDelay = peakDelay; -Murat.data.inversionMatrixPeakDelay = inversionMatrixPeakDelay; -Murat.data.inversionMatrixQ = inversionMatrixQ; -Murat.data.totalLengthRay = totalLengthRay; -Murat.data.raysPlot = raysPlot; -Murat.data.rayCrossing = sum(rayCrossing); -Murat.data.inverseQc = inverseQc; -Murat.data.uncertaintyQc = uncertaintyQc; -Murat.data.inversionMatrixQc = inversionMatrixQc; -Murat.data.energyRatioBodyCoda = energyRatioBodyCoda; -Murat.data.energyRatioCodaNoise = energyRatioCodaNoise; -Murat.data.tCoda = tCoda; +Murat.rays.locationsDeg = locationDeg; +Murat.rays.locationsM = locationM; +Murat.rays.theoreticalTime = theoreticalTime; +Murat.PD.peakDelay = peakDelay; +Murat.PD.inversionMatrixPeakDelay = inversionMatrixPeakDelay; +Murat.Q.inversionMatrixQ = inversionMatrixQ; +Murat.rays.totalLengthRay = totalLengthRay; +Murat.rays.raysPlot = raysPlot; +Murat.rays.rayCrossing = sum(rayCrossing); +Murat.Qc.inverseQc = inverseQc; +Murat.Qc.uncertaintyQc = uncertaintyQc; +Murat.Qc.inversionMatrixQc = inversionMatrixQc; +Murat.Q.energyRatioBodyCoda = energyRatioBodyCoda; +Murat.Q.energyRatioCodaNoise = energyRatioCodaNoise; +Murat.Qc.tCoda = tCoda; Murat = Murat_selection(Murat); diff --git a/bin/Murat_dataWarning.m b/bin/Murat_dataWarning.m index d30a3e0..43cdc89 100644 --- a/bin/Murat_dataWarning.m +++ b/bin/Murat_dataWarning.m @@ -19,6 +19,7 @@ % rapspcn: coda to noise ratio % comp: components % flag: flag to change between one or more components +% QcM: chosen method to measure Qc between Lin e NonLin % % Output parameters: % problempd: stores the data not used because of peak delays diff --git a/bin/Murat_declustering.m b/bin/Murat_declustering.m index b61ca96..05eb771 100644 --- a/bin/Murat_declustering.m +++ b/bin/Murat_declustering.m @@ -1,11 +1,14 @@ function Murat = Murat_declustering(Murat,factor) % function Murat = Murat_declustering(Murat,factor) % -% PLOTS rays before and after declustering +% SAVES declustered variables and PLOTS rays before and after declustering. +% The declustering is based on dividing the original grid into finer node +% spacing and selecting those with the best coda decay. % % Input parameters: % Murat: Murat structure variable -% factor: factor by which original grid is divided into +% factor: input factor used to divide the original grid + components = Murat.input.components; origin = Murat.input.origin; ending = Murat.input.end; @@ -13,9 +16,9 @@ y = Murat.input.y; z = Murat.input.z; -locationsDeg = Murat.data.locationsDeg; -uncertaintyQc = Murat.data.uncertaintyQc; -Murat.data.locDegOriginal = locationsDeg; +locationsDeg = Murat.rays.locationsDeg; +uncertaintyQc = Murat.Qc.uncertaintyQc; +Murat.rays.locDegOriginal = locationsDeg; disp(['used waveforms before declustering: ',... num2str(length(locationsDeg)*components)]) @@ -67,28 +70,26 @@ %% remove deleted data from Murat structure variable ind_to_keep = new_evestaz(:,8); -Murat.data.energyRatioBodyCoda =... - Murat.data.energyRatioBodyCoda(ind_to_keep,:); -Murat.data.energyRatioCodaNoise =... - Murat.data.energyRatioCodaNoise(ind_to_keep,:); -Murat.data.inverseQc = Murat.data.inverseQc(ind_to_keep,:); -Murat.data.inversionMatrixPeakDelay =... - Murat.data.inversionMatrixPeakDelay(ind_to_keep,:); -Murat.data.inversionMatrixQ =... - Murat.data.inversionMatrixQ(ind_to_keep,:); -Murat.data.inversionMatrixQc=... - Murat.data.inversionMatrixQc(ind_to_keep,:); -Murat.data.locationsDeg = Murat.data.locationsDeg(ind_to_keep,:); -Murat.data.peakDelay = Murat.data.peakDelay(ind_to_keep,:); -Murat.data.retainPeakDelay = Murat.data.retainPeakDelay(ind_to_keep,:); -Murat.data.retainQ = Murat.data.retainQ(ind_to_keep,:); -Murat.data.retainQc = Murat.data.retainQc(ind_to_keep,:); -Murat.data.tCoda = Murat.data.tCoda(ind_to_keep,:); -Murat.data.totalLengthRay = Murat.data.totalLengthRay(ind_to_keep,:); -Murat.data.travelTime = Murat.data.travelTime(ind_to_keep,:); -Murat.data.uncertaintyQc = Murat.data.uncertaintyQc(ind_to_keep,:); -Murat.data.variationPeakDelay =... - Murat.data.variationPeakDelay(ind_to_keep,:); +Murat.Q.energyRatioBodyCoda =... + Murat.Q.energyRatioBodyCoda(ind_to_keep,:); +Murat.Q.energyRatioCodaNoise=... + Murat.Q.energyRatioCodaNoise(ind_to_keep,:); +Murat.Qc.inverseQc = Murat.Qc.inverseQc(ind_to_keep,:); +Murat.PD.inversionMatrixPeakDelay... + =... + Murat.PD.inversionMatrixPeakDelay(ind_to_keep,:); +Murat.Q.inversionMatrixQ = Murat.Q.inversionMatrixQ(ind_to_keep,:); +Murat.Qc.inversionMatrixQc = Murat.Qc.inversionMatrixQc(ind_to_keep,:); +Murat.rays.locationsDeg = Murat.rays.locationsDeg(ind_to_keep,:); +Murat.PD.peakDelay = Murat.PD.peakDelay(ind_to_keep,:); +Murat.PD.retainPeakDelay = Murat.PD.retainPeakDelay(ind_to_keep,:); +Murat.Q.retainQ = Murat.Q.retainQ(ind_to_keep,:); +Murat.Qc.retainQc = Murat.Qc.retainQc(ind_to_keep,:); +Murat.Qc.tCoda = Murat.Qc.tCoda(ind_to_keep,:); +Murat.rays.totalLengthRay = Murat.rays.totalLengthRay(ind_to_keep,:); +Murat.rays.travelTime = Murat.rays.travelTime(ind_to_keep,:); +Murat.Qc.uncertaintyQc = Murat.Qc.uncertaintyQc(ind_to_keep,:); +Murat.PD.variationPeakDelay = Murat.PD.variationPeakDelay(ind_to_keep,:); disp(['used waveforms after declustering: ',... num2str(length(ind_to_keep)*components)]) diff --git a/bin/Murat_image3D.m b/bin/Murat_image3D.m index 3c3a0ff..887cf27 100644 --- a/bin/Murat_image3D.m +++ b/bin/Murat_image3D.m @@ -1,7 +1,7 @@ function [image,mVp,xp,yp,zp,Xp,Yp,Zp] = ... Murat_image3D(X,Y,Z,V,color,sections,evestaz,x,y,z,divi,name) % function image = ... -% Murat_image3D(X,Y,Z,V,color,sections,evestaz,x,y,z,name) +% Murat_image3D(X,Y,Z,V,color,sections,evestaz,x,y,z,divi,name) % % PLOTS a 3D image of a field on slices. % @@ -50,13 +50,13 @@ if max_scale < 1 max_scale = round(max_scale,2); if max_scale == 0 - caxis([-1 1]) + clim([-1 1]) else - caxis([-max_scale max_scale]) + clim([-max_scale max_scale]) end elseif max_scale > 5 max_scale = ceil(max_scale); - caxis([-max_scale max_scale]) + clim([-max_scale max_scale]) end colormap(color); diff --git a/bin/Murat_image3D_2panels.m b/bin/Murat_image3D_2panels.m index 6c1992d..23c4026 100644 --- a/bin/Murat_image3D_2panels.m +++ b/bin/Murat_image3D_2panels.m @@ -1,7 +1,7 @@ function image = ... Murat_image3D_2panels(X,Y,Z,V,color,sections,evestaz,x,y,z) % function image = ... -% Murat_image3D(X,Y,Z,V,color,sections,evestaz,x,y,z,name) +% Murat_image3D(X,Y,Z,V,color,sections,evestaz,x,y,z) % % PLOTS a 3D image of a field on slices on two subpanels. % @@ -16,7 +16,6 @@ % x: x vector % y: y vector % z: z vector -% name: name of the title of the figure % % Output parameters: % image: image produced in one panel diff --git a/bin/Murat_image3Dparameters.m b/bin/Murat_image3Dparameters.m index 14a342c..5ece345 100644 --- a/bin/Murat_image3Dparameters.m +++ b/bin/Murat_image3Dparameters.m @@ -46,10 +46,10 @@ max_scale = max(scale_mVp); if max_scale < 1 max_scale = round(max_scale,2); - caxis([-max_scale max_scale]) + clim([-max_scale max_scale]) elseif max_scale > 5 max_scale = ceil(max_scale); - caxis([-max_scale max_scale]) + clim([-max_scale max_scale]) end colormap(color); diff --git a/bin/Murat_imageCheckQc.m b/bin/Murat_imageCheckQc.m index 633d64f..621957d 100644 --- a/bin/Murat_imageCheckQc.m +++ b/bin/Murat_imageCheckQc.m @@ -12,7 +12,7 @@ % Ac: inverse coda attenuation matrix % sizeTitle: size of title font % Qc_title: title of Qc figure -% QcM: Linearized or Non Linear measurement +% QcM: Linearized or Non Linear Qc measurement % % Output parameters: % Qc_analysis: figure for Qc check diff --git a/bin/Murat_imageDeclustering.m b/bin/Murat_imageDeclustering.m index 15309ae..34c94a6 100644 --- a/bin/Murat_imageDeclustering.m +++ b/bin/Murat_imageDeclustering.m @@ -1,7 +1,7 @@ function clustering = Murat_imageDeclustering(locDegOriginal,... locDegrees,origin,ending,name) % function clustering =... -% Murat_imageDeclustering(locDegOriginal,locDegrees,origin,ending) +% Murat_imageDeclustering(locDegOriginal,locDegrees,origin,ending,name) % % PLOTS 2D rays before and after declustering. % diff --git a/bin/Murat_imageParameters.m b/bin/Murat_imageParameters.m index 3f3843b..a29c116 100644 --- a/bin/Murat_imageParameters.m +++ b/bin/Murat_imageParameters.m @@ -10,6 +10,7 @@ % z: z vector % modv_pd_k: results of peak delay imaging % modv_Qc_k: results of Qc imaging +% sizeTitle: size of the title font % % Output parameters: % image: image produced diff --git a/bin/Murat_imageParametersMaps.m b/bin/Murat_imageParametersMaps.m index 3d9d8cd..2bd2ee5 100644 --- a/bin/Murat_imageParametersMaps.m +++ b/bin/Murat_imageParametersMaps.m @@ -5,18 +5,24 @@ % Murat_imageParametersMaps(par,para_map,x,y,z,X,Y,Z,evestaz_Qc,... % sections,sizeTitle,FName_Parameters) % -% PLOTS the parameter models in their space and on a 3D map +% PLOTS the parameter models in a 3D map % % Input parameters: +% par: condition on the parameters to image +% para_map: parameter map % x: x vector % y: y vector % z: z vector -% modv_pd_k: results of peak delay imaging -% modv_Qc_k: results of Qc imaging +% X: X matrix +% y: Y matrix +% z: Z matrix +% evestaz_Qc: events and stations for Qc +% sections: input sections +% sizeTitle: font size for title +% FName_Parameters: title of the image % % Output parameters: -% image: image produced -% para_condition: condition on the parameters to image +% ParaMap: parameter map 3D image % para_map: parameter map for n = 1:length(par(:,1)) diff --git a/bin/Murat_inversion.m b/bin/Murat_inversion.m index db4e34a..4e585ce 100644 --- a/bin/Murat_inversion.m +++ b/bin/Murat_inversion.m @@ -27,23 +27,22 @@ lCurveQ = Murat.input.lCurveQ; muratHeader = Murat.input.header; -Apd_i =... - Murat.data.inversionMatrixPeakDelay; -Ac_i = Murat.data.inversionMatrixQc; -A_i = Murat.data.inversionMatrixQ; -luntot = Murat.data.totalLengthRay; -time0 = Murat.data.travelTime; -Qm = Murat.data.inverseQc; -RZZ = Murat.data.uncertaintyQc; -lpdelta = Murat.data.variationPeakDelay; -rapsp = Murat.data.energyRatioBodyCoda; -retain_pd = Murat.data.retainPeakDelay; -retain_Qc = Murat.data.retainQc; -retain_Q = Murat.data.retainQ; -ray_crosses_pd = Murat.data.raysPeakDelay; -ray_crosses_Qc = Murat.data.raysQc; -ray_crosses_Q = Murat.data.raysQ; -tCoda = Murat.data.tCoda; +Apd_i = Murat.PD.inversionMatrixPeakDelay; +Ac_i = Murat.Qc.inversionMatrixQc; +A_i = Murat.Q.inversionMatrixQ; +luntot = Murat.rays.totalLengthRay; +time0 = Murat.rays.travelTime; +Qm = Murat.Qc.inverseQc; +RZZ = Murat.Qc.uncertaintyQc; +lpdelta = Murat.PD.variationPeakDelay; +rapsp = Murat.Q.energyRatioBodyCoda; +retain_pd = Murat.PD.retainPeakDelay; +retain_Qc = Murat.Qc.retainQc; +retain_Q = Murat.Q.retainQ; +ray_crosses_pd = Murat.PD.raysPeakDelay; +ray_crosses_Qc = Murat.Qc.raysQc; +ray_crosses_Q = Murat.Q.raysQ; +tCoda = Murat.Qc.tCoda; FPath = './'; lMF = size(ray_crosses_pd); @@ -130,7 +129,7 @@ modv_Qc(rcQc_k,4,k) = mQc; saveas(LcQc,fullfile(FPath, FLabel,'Tests/LCurve',FName)); - saveas(LcQc,fullfile(FPath, FLabel,'Tests/LCurve',FName),'tif'); + saveas(LcQc,fullfile(FPath, FLabel,'Tests/LCurve',FName),'png'); close(LcQc) %% @@ -181,7 +180,7 @@ modv_Q(rcQ_k,4,k) = mQ; saveas(LcCN,fullfile(FPath, FLabel,'Tests/LCurve',FName)); - saveas(LcCN,fullfile(FPath, FLabel,'Tests/LCurve',FName),'tif'); + saveas(LcCN,fullfile(FPath, FLabel,'Tests/LCurve',FName),'png'); close(LcCN) %% Checkerboards and spike inputs and checkerboard inversion @@ -250,10 +249,10 @@ %% % Save in Murat -Murat.data.residualQc = residualQc; -Murat.data.const_Qc = const_Qc; -Murat.data.residualQ = residualQ; -Murat.data.modvPeakDelay = modv_pd; -Murat.data.modvQc = modv_Qc; -Murat.data.modvQ = modv_Q; +Murat.Qc.residualQc = residualQc; +Murat.Q.const_Qc = const_Qc; +Murat.Q.residualQ = residualQ; +Murat.PD.modvPeakDelay = modv_pd; +Murat.Qc.modvQc = modv_Qc; +Murat.Q.modvQ = modv_Q; writetable(muratHeader,fullfile(FPath, FLabel, 'TXT', 'DataHeaders.xlsx')); diff --git a/bin/Murat_lsqlinQmean.m b/bin/Murat_lsqlinQmean.m index 434a758..931b9a2 100644 --- a/bin/Murat_lsqlinQmean.m +++ b/bin/Murat_lsqlinQmean.m @@ -3,30 +3,32 @@ % function [d1, const_Qc_k, constQmean_k, equationQ] =... % Murat_lsqlinQmean(tCm,tWm,Q_k,cf_k,sped,luntot_k,time0_k,rapsp_k) % -% INVERTS with weighted tikhonov and creates L-curve and data for Q. +% INVERTS with minimum least squares to obtain average Q % % Input parameters: -% tCm: lapse time -% tWm: coda window -% Q_k: inverse Qc +% tCm: starting coda time +% tWm: coda window length +% Q_k: average coda attenuation % cf_k: central frequency % sped: spectral decay -% luntot_k: total ray length -% time0_k: total travel time -% rapsp_k: energy ratio -% -% Output parameters: -% d1: data for average Q inversion -% const_Qc_k: constant for average Q inversion depending on Qc -% constQmean_k: average geometrical spreading and Q -% equationQ: sum of all three terms of the CN equation +% luntot_k: total length per frequency +% time0_k: travel time per frequency +% rapsp_k: energy ratio per frequency % +% Output parameters: +% d1: data for the inversion - variations from average +% const_Qc_k: constant obtained using the average source-station Qc +% constQmean_k: contains geometrical spreading, Q, uncertainties +% equationQ: equation to be compared with data in test + %% % Data creation for the true inversion, removing the pre-calculated % parameters. + +% Include info on Qc const_Qc_k = (tCm+tWm/2).^-sped... .*exp(-2*pi*Q_k*cf_k.*(tCm+tWm/2)); - +% Data vector for inversion of average Q d0 =... log(rapsp_k)/2/pi/cf_k + log(const_Qc_k)/2/pi/cf_k; @@ -35,13 +37,16 @@ cova = (G'*G)^(-1)*G'*cov(d0)*G*(G'*G)^(-1); +% Storing inverted parameters constQmean_k(:,1) = lsqlin(G,d0(:,1)); constQmean_k(:,2) = sqrt(diag(cova)); +% Calculate data vector for average Q and geometrical spreading d1 = d0 + ... constQmean_k(1,1)*log(luntot_k)/2/pi/cf_k... + time0_k*constQmean_k(2,1); +% Equation for average Q to fit data equationQ = -log(const_Qc_k)... -constQmean_k(1,1)*log(luntot_k)... -2*pi*cf_k*time0_k*constQmean_k(2,1); diff --git a/bin/Murat_modv1D.m b/bin/Murat_modv1D.m index 6a83903..2d76cb5 100644 --- a/bin/Murat_modv1D.m +++ b/bin/Murat_modv1D.m @@ -1,7 +1,7 @@ function [modv,pvel,modvPlot]... =... Murat_modv1D(modvXYZ,modvOriginal,PorS,origin) -% function [modv,pvel] =... +% function [modv,pvel,modvPlot]=... % Murat_modv1D(modvXYZ,modvOriginal,PorS,origin) % CREATES the velocity models when using a 1D input % @@ -14,6 +14,7 @@ % Output parameters: % modv: propagation and inversion velocity model % pvel: propagation velocity model in matrix +% modvPlot: velocity model to be plot modv = modvXYZ; z1D = -modvOriginal(:,1)*1000; @@ -42,4 +43,3 @@ modvPlot = [lon2 lat2 modv(:,3:4)]; end - diff --git a/bin/Murat_modv3D.m b/bin/Murat_modv3D.m index eedcc92..20c102a 100644 --- a/bin/Murat_modv3D.m +++ b/bin/Murat_modv3D.m @@ -13,6 +13,7 @@ % mLon: min/max longitudes of earthquakes % nLat: number nodes latitude % nLon: number nodes longitude +% nzc: number nodes vertical % % Output parameters: % modvP: propagation velocity model in standard format diff --git a/bin/Murat_plot.m b/bin/Murat_plot.m index 5fce938..1164502 100644 --- a/bin/Murat_plot.m +++ b/bin/Murat_plot.m @@ -27,32 +27,31 @@ modvQc(:,2) = modvQc(:,2) + stepgY; modvQc(:,3) = modvQc(:,3) + stepgZ; -Qm = Murat.data.inverseQc; -time0 = Murat.data.travelTime; -retainPeakDelay = Murat.data.retainPeakDelay; -retainQc = Murat.data.retainQc; -retainQ = Murat.data.retainQ; -ray_crosses_pd = Murat.data.raysPeakDelay; -ray_crosses_Qc = Murat.data.raysQc; -ray_crosses_Q = Murat.data.raysQ; -fitrobust = Murat.data.fitrobust; -peakData = Murat.data.peakDelay; -luntot = Murat.data.totalLengthRay; -rma = Murat.data.raysPlot; -modv_pd = Murat.data.modvPeakDelay; -modv_Qc = Murat.data.modvQc; -modv_Q = Murat.data.modvQ; -evestazDegrees = Murat.data.locationsDeg; -energyRatio = Murat.data.energyRatioBodyCoda; -codaNoiseRatio = Murat.data.energyRatioCodaNoise; -Ac_i = Murat.data.inversionMatrixQc; -RZZ = Murat.data.uncertaintyQc; -A_i = Murat.data.inversionMatrixQ; -residualQc = Murat.data.residualQc; -residualQ = Murat.data.residualQ; -locationM = Murat.data.locationsM; -tCoda = Murat.data.tCoda; -rapsp = Murat.data.energyRatioBodyCoda; +Qm = Murat.Qc.inverseQc; +time0 = Murat.rays.travelTime; +retainPeakDelay = Murat.PD.retainPeakDelay; +retainQc = Murat.Qc.retainQc; +retainQ = Murat.Q.retainQ; +ray_crosses_pd = Murat.PD.raysPeakDelay; +ray_crosses_Qc = Murat.Qc.raysQc; +ray_crosses_Q = Murat.Q.raysQ; +fitrobust = Murat.PD.fitrobust; +peakData = Murat.PD.peakDelay; +luntot = Murat.rays.totalLengthRay; +rma = Murat.rays.raysPlot; +modv_pd = Murat.PD.modvPeakDelay; +modv_Qc = Murat.Qc.modvQc; +modv_Q = Murat.Q.modvQ; +evestazDegrees = Murat.rays.locationsDeg; +energyRatio = Murat.Q.energyRatioBodyCoda; +codaNoiseRatio = Murat.Q.energyRatioCodaNoise; +Ac_i = Murat.Qc.inversionMatrixQc; +RZZ = Murat.Qc.uncertaintyQc; +A_i = Murat.Q.inversionMatrixQ; +residualQc = Murat.Qc.residualQc; +residualQ = Murat.Q.residualQ; +locationM = Murat.rays.locationsM; +tCoda = Murat.Qc.tCoda; FPath = './'; sizeTitle = 18; @@ -64,14 +63,14 @@ % Declustering is done before any frequency analysis, here we show the 2D % rays before and after if Murat.input.declustering > 0 - locDegOriginal = Murat.data.locDegOriginal; + locDegOriginal = Murat.rays.locDegOriginal; FName_Cluster = 'Clustering'; clustering = Murat_imageDeclustering(... locDegOriginal,evestazDegrees,origin,ending,FName_Cluster); storeFolder = 'Tests'; pathFolder =... fullfile(FPath,FLabel,storeFolder,FName_Cluster); - saveas(clustering,pathFolder,'tif'); + saveas(clustering,pathFolder,'png'); close(clustering) end @@ -105,7 +104,7 @@ ending,evestaz_pd,x,y,z,FName_peakDelay); pathFolder =... fullfile(FPath,FLabel,storeFolder,FName_peakDelay); - saveas(rays_peakDelay,pathFolder,'tif'); + saveas(rays_peakDelay,pathFolder,'png'); close(rays_peakDelay) %% @@ -117,7 +116,7 @@ Murat_imageRays(rma_Q,origin,ending,evestaz_Q,x,y,z,FName_Q); pathFolder =... fullfile(FPath, FLabel, storeFolder, FName_Q); - saveas(rays_Q,pathFolder,'tif'); + saveas(rays_Q,pathFolder,'png'); close(rays_Q) %% @@ -163,7 +162,7 @@ Qc_analysis = Murat_imageCheckQc(Qm_k,RZZ_k,... residualQc_k,luntot_Qc,Ac,sizeTitle,Qc_title,QcM); saveas(Qc_analysis, fullfile(FPath,FLabel,storeFolder,... - ['Qc_analysis_' fcName '_Hz']),'tif'); + ['Qc_analysis_' fcName '_Hz']),'png'); saveas(Qc_analysis, fullfile(FPath,FLabel,storeFolder,... ['Qc_analysis_' fcName '_Hz'])); close(Qc_analysis) @@ -179,7 +178,7 @@ pd_analysis = Murat_imageCheckPeakDelay(... time0PD,fitrobust_k,peakData_k,sizeTitle,pd_title); saveas(pd_analysis, fullfile(FPath,FLabel,storeFolder,... - ['PD_analysis_' fcName '_Hz']),'tif'); + ['PD_analysis_' fcName '_Hz']),'png'); saveas(pd_analysis, fullfile(FPath,FLabel,storeFolder,... ['PD_analysis_' fcName '_Hz'])); close(pd_analysis) @@ -195,7 +194,7 @@ A_k = A_i(rtQk,rcQk); luntot_k = luntot(rtQk); time0_k = time0(rtQk); - rapsp_k = rapsp(rtQk,k); + rapsp_k = energyRatio(rtQk,k); tCm = tCoda(rtQk,k); Q_k = Qm(rtQk,k); @@ -208,7 +207,7 @@ Murat_imageCheckCN(equationQ,residualQ_k,d1,spreadAverageQ,... luntot_k,time0_k,energyRatio_k,A_k,Edirect_k,CN_title); saveas(CN_analysis, fullfile(FPath,FLabel,storeFolder,... - ['CN_analysis_' fcName '_Hz']),'tif'); + ['CN_analysis_' fcName '_Hz']),'png'); saveas(CN_analysis, fullfile(FPath,FLabel,storeFolder,... ['CN_analysis_' fcName '_Hz'])); close(CN_analysis) @@ -220,7 +219,6 @@ modv_Qc_k = modv_Qc(:,:,k); modv_Q_k = modv_Q(:,:,k); [X,Y,Z1,mPD] = Murat_fold(x,y,z,modv_pd_k(:,4)); - [~,~,~,PD_cts] = Murat_fold(x,y,z,modv_pd_k(:,5)); [~,~,~,mQc] = Murat_fold(x,y,z,modv_Qc_k(:,4)); [~,~,~,mQ] = Murat_fold(x,y,z,modv_Q_k(:,4)); Z = Z1/1000; @@ -442,10 +440,10 @@ %% % Final figure is the Qc vs frequency relation storeFolder = 'Tests'; -Murat.data.averageQcFrequency = averageQcFrequency; +Murat.Qc.averageQcFrequency = averageQcFrequency; Qcf_title = 'Qc vs Frequency'; QcFrequency = Murat_imageQcFrequency(cf,... averageQcFrequency,sizeTitle,Qcf_title); FName = 'Qc_vs_frequency'; -saveas(QcFrequency, fullfile(FPath,FLabel,storeFolder,FName),'tif'); +saveas(QcFrequency, fullfile(FPath,FLabel,storeFolder,FName),'png'); close all diff --git a/bin/Murat_saveFigures.m b/bin/Murat_saveFigures.m index 1821eef..b272906 100644 --- a/bin/Murat_saveFigures.m +++ b/bin/Murat_saveFigures.m @@ -4,7 +4,7 @@ function Murat_saveFigures(figureName,Path) % % Input Parameters: % figureName: Matlab 3D plot -% Path: name of sections (tif) and figure (fig) +% Path: name of sections (png) and figure (fig) % % Output: % Three sections and 1 3D figure @@ -13,11 +13,11 @@ function Murat_saveFigures(figureName,Path) saveas(figureName,Path); view(90,0) ytickangle(45) -saveas(figureName,[Path '_SN'], 'tif'); +saveas(figureName,[Path '_SN'], 'png'); view(0,0) xtickangle(45) -saveas(figureName,[Path '_WE'], 'tif'); +saveas(figureName,[Path '_WE'], 'png'); view(0,90) -saveas(figureName,[Path '_H'], 'tif'); +saveas(figureName,[Path '_H'], 'png'); close(figureName) end \ No newline at end of file diff --git a/bin/Murat_saveFigures_2panels.m b/bin/Murat_saveFigures_2panels.m index 2190927..a03fba1 100644 --- a/bin/Murat_saveFigures_2panels.m +++ b/bin/Murat_saveFigures_2panels.m @@ -4,7 +4,7 @@ function Murat_saveFigures_2panels(figureName,Path) % % Input Parameters: % figureName: Matlab 3D plot -% Path: name of sections (tif) and figure (fig) +% Path: name of sections (png) and figure (fig) % % Output: % Three sections and 1 3D figure with 2 panels @@ -18,7 +18,7 @@ function Murat_saveFigures_2panels(figureName,Path) ax2 = subplot(1,2,2); view(ax2,90,0) ytickangle(45) -saveas(figureName,[Path '_SN'], 'tif'); +saveas(figureName,[Path '_SN'], 'png'); ax1 = subplot(1,2,1); view(ax1,0,0) @@ -26,13 +26,13 @@ function Murat_saveFigures_2panels(figureName,Path) ax2 = subplot(1,2,2); view(ax2,0,0) xtickangle(45) -saveas(figureName,[Path '_WE'], 'tif'); +saveas(figureName,[Path '_WE'], 'png'); ax1 = subplot(1,2,1); view(ax1,0,90) ax2 = subplot(1,2,2); view(ax2,0,90) -saveas(figureName,[Path '_H'], 'tif'); +saveas(figureName,[Path '_H'], 'png'); close(figureName) diff --git a/bin/Murat_selection.m b/bin/Murat_selection.m index 603fb9d..70e5b4a 100644 --- a/bin/Murat_selection.m +++ b/bin/Murat_selection.m @@ -11,20 +11,19 @@ fT = Murat.input.fitTresholdLinear; QcM = Murat.input.QcMeasurement; -Apd_i =... - Murat.data.inversionMatrixPeakDelay; -A_i = Murat.data.inversionMatrixQ; -Ac_i = Murat.data.inversionMatrixQc; -peakd = Murat.data.peakDelay; -luntot = Murat.data.totalLengthRay; -tPS = Murat.data.theoreticalTime; -evestaz = Murat.data.locationsDeg; -Qm = Murat.data.inverseQc; -RZZ = Murat.data.uncertaintyQc; -rapsp = Murat.data.energyRatioBodyCoda; -rapspcn = Murat.data.energyRatioCodaNoise; -raysplot = Murat.data.raysPlot; -tCoda = Murat.data.tCoda; +Apd_i = Murat.PD.inversionMatrixPeakDelay; +A_i = Murat.Q.inversionMatrixQ; +Ac_i = Murat.Qc.inversionMatrixQc; +peakd = Murat.PD.peakDelay; +luntot = Murat.rays.totalLengthRay; +tPS = Murat.rays.theoreticalTime; +evestaz = Murat.rays.locationsDeg; +Qm = Murat.Qc.inverseQc; +RZZ = Murat.Qc.uncertaintyQc; +rapsp = Murat.Q.energyRatioBodyCoda; +rapspcn = Murat.Q.energyRatioCodaNoise; +raysplot = Murat.rays.raysPlot; +tCoda = Murat.Qc.tCoda; dataL = size(peakd,1); dataFreq = size(peakd,2); @@ -118,30 +117,30 @@ end -Murat.data.peakDelay = peakd; -Murat.data.totalLengthRay = luntot; -Murat.data.tCoda = tCoda; -Murat.data.locationsDeg = evestaz; -Murat.data.inverseQc = Qm; -Murat.data.uncertaintyQc = RZZ; -Murat.data.problemPD = problemPD; -Murat.data.problemQc = problemQc; -Murat.data.problemRZZ = problemRZZ; -Murat.data.problemQ = problemQ; -Murat.data.energyRatioBodyCoda = rapsp; -Murat.data.energyRatioCodaNoise = rapspcn; -Murat.data.raysPlot = raysplot; -Murat.data.variationPeakDelay = lpdelta; -Murat.data.travelTime = time0; -Murat.data.fitrobust = fitrobust; -Murat.data.retainPeakDelay = retain_pd; -Murat.data.retainQc = retain_Qm; -Murat.data.retainQ = retain_Q; -Murat.data.raysPeakDelay = ray_crosses_pd; -Murat.data.raysQc = ray_crosses_Qc; -Murat.data.raysQ = ray_crosses_Q; -Murat.data.inversionMatrixPeakDelay = Apd_i; -Murat.data.inversionMatrixQc = Ac_i; -Murat.data.inversionMatrixQ = A_i; +Murat.PD.peakDelay = peakd; +Murat.rays.totalLengthRay = luntot; +Murat.Qc.tCoda = tCoda; +Murat.rays.locationsDeg = evestaz; +Murat.Qc.inverseQc = Qm; +Murat.Qc.uncertaintyQc = RZZ; +Murat.PD.problemPD = problemPD; +Murat.Qc.problemQc = problemQc; +Murat.Qc.problemRZZ = problemRZZ; +Murat.Q.problemQ = problemQ; +Murat.Q.energyRatioBodyCoda = rapsp; +Murat.Q.energyRatioCodaNoise = rapspcn; +Murat.rays.raysPlot = raysplot; +Murat.PD.variationPeakDelay = lpdelta; +Murat.rays.travelTime = time0; +Murat.PD.fitrobust = fitrobust; +Murat.PD.retainPeakDelay = retain_pd; +Murat.Qc.retainQc = retain_Qm; +Murat.Q.retainQ = retain_Q; +Murat.PD.raysPeakDelay = ray_crosses_pd; +Murat.Qc.raysQc = ray_crosses_Qc; +Murat.Q.raysQ = ray_crosses_Q; +Murat.PD.inversionMatrixPeakDelay = Apd_i; +Murat.Qc.inversionMatrixQc = Ac_i; +Murat.Q.inversionMatrixQ = A_i; end