Skip to content

Commit

Permalink
Changes and fixes pointed out by Laura
Browse files Browse the repository at this point in the history
corrected overlap to be pct instead of factor... step calculation was n/overlap, now it is max(round(n*overlap/100), 1)
fixed error when loading a grid (error stated Units was not a field)
tweaked label regarding days after mainshock
  • Loading branch information
CelsoReyes committed Apr 5, 2019
1 parent 60e7717 commit 3cfa188
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/CumTimePlot.m
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function add_cumtimeplot_zmenu(obj, parent)

%The following instruction calls a program for the computation of the parameters in Omori formula, for the catalog of which the cumulative number graph" is
%displayed (the catalog mycat).
uimenu(op5,'Label','Completeness in days after mainshock', msfield,@(~,~)mcwtidays(obj.catalog))
uimenu(op5,'Label','Completeness in days relative to mainshock', msfield,@(~,~)mcwtidays(obj.catalog))
uimenu(op5,'Label','Define mainshock',...
'Enable','off', msfield, @cb_016);
uimenu(op5,'Label','Estimate p',msfield,@cb_pestimate);
Expand Down
6 changes: 3 additions & 3 deletions src/bwithti.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function bwithti(mycat)
me = [];

sdlg.prompt='Number of events in each window';sdlg.value=150
sdlg(2).prompt='Overlap factor';sdlg(2).value=5;
sdlg(2).prompt='Overlap [%]';sdlg(2).value=5;

[~,~, ni, ofac] = smart_inputdlg('b with depth input parameters',sdlg)

Expand All @@ -27,8 +27,8 @@ function bwithti(mycat)
'Automatic','Fixed Mc=Mmin','Money');



for i = 1:ni/ofac:mycat.Count-ni
stride = max(round(ni .* ofac ./ 100) , 1);
for i = 1:stride : mycat.Count-ni

b = mycat.subset(i:i+ni);

Expand Down
Binary file modified src/cgr_utils/grids/grid_chooser.mlapp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/jochen/plot/plot_McBwtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function plot_McBwtime(catalog, sPar)
zdlg.AddMcMethodDropdown('methodChoice', default_method);
zdlg.AddEdit('nSampleSize' , 'Sample window size' , nSampleSize , 'number of events in each window');
zdlg.AddEdit('minEventCount' , 'Min. # of events' , minEventCount , 'minimum number of events in order to calc. window');
zdlg.AddEdit('nOverlap' , 'Window overlap' , nOverlap , 'Samplesize/nOverlap determines overlap of moving windows');
zdlg.AddEdit('nOverlap' , 'Window overlap (%)' , nOverlap , 'Samplesize/nOverlap determines overlap of moving windows');
zdlg.AddEdit('nBstSample' , 'Bootstraps' , nBstSample , 'Number of samples in bootstrap(?)');
zdlg.AddEdit('fMcCorr' , 'Mc correction' , fMcCorr , 'correction for the magnitude of completeness');
zdlg.AddEdit('fBinning' , 'Magnitude Binning' , fBinning , 'size of magnitude bins');
Expand Down
4 changes: 2 additions & 2 deletions src/jochen/seisvar/calc/calc_McBwtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
% fMinMag = min(catalog.Magnitude);
fMaxMag = max(catalog.Magnitude);

stride = nSampleSize / p.Results.nOverlap;
windowStarts = 1 : stride : catalog.Count-nSampleSize ;
stride = max(round(nSampleSize .* p.Results.nOverlap ./ 100), 1);
windowStarts = 1 : stride : catalog.Count - nSampleSize ;
windowEnds = windowStarts + nSampleSize - 1;
nWindows = numel(windowStarts);

Expand Down
2 changes: 1 addition & 1 deletion src/mcwtidays.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function mcwtidays(catalog)
ax.YLabel.String = 'Mc';
%set(gca,'Xlim',[t0b teb]);

xlabel('Time in days after mainshock')
xlabel('Days relative to mainshock')
tist = [ catalog.Name ' - b(t), ni = ' num2str(ni) ];
title(tist,'interpreter','none')

Expand Down

0 comments on commit 3cfa188

Please sign in to comment.