Skip to content

Commit c3ff492

Browse files
committedJan 13, 2025
Update submodule.
1 parent 4adc497 commit c3ff492

File tree

7 files changed

+67
-51
lines changed

7 files changed

+67
-51
lines changed
 

‎GEMS-MagTIP-insider

‎docs/doc_library/index.html

+30-22
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ <h2 class="anchored" data-anchor-id="main-functions">Main Functions</h2>
305305
</div>
306306
<div id="callout-2" class="callout-2-contents callout-collapse collapse show">
307307
<div class="callout-body-container callout-body">
308-
<div id="4ba51c7d" class="cell" data-execution_count="1">
308+
<div id="1905ca18" class="cell" data-execution_count="1">
309309
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="2">
310310
<section id="statind" class="level3">
311311
<h3 class="anchored" data-anchor-id="statind"><code>statind</code></h3>
@@ -490,6 +490,12 @@ <h3 class="anchored" data-anchor-id="molscore3"><code>molscore3</code></h3>
490490
<li>Define the total number of random combinations among the best models of each station for joint-station TIP calculation.</li>
491491
<li>Default is 500, which means for every station a random permutation of ranking numbers (based on the fitting degree) of the best models is performed with each sequence of ranking number having 500 elements, and the ith joint-station model parameter combination is thus from the best models of each station indexed by the ith element of each permutation.</li>
492492
</ul></li>
493+
<li><p>‘WithExtra’</p>
494+
<ul>
495+
<li>If ‘WithExtra’ is <code>true</code>, the returned <code>InfoTable</code> will include a variable for <code>Other</code> data.</li>
496+
<li>Please refer the output arguments of <code>jointstation</code>.</li>
497+
<li>Default is <code>false</code>.</li>
498+
</ul></li>
493499
</ul>
494500
<p><strong>Input and output:</strong></p>
495501
<ul>
@@ -536,7 +542,7 @@ <h2 class="anchored" data-anchor-id="load-raw-data-and-convert-it-into-a-standar
536542
</div>
537543
<div id="callout-4" class="callout-4-contents callout-collapse collapse show">
538544
<div class="callout-body-container callout-body">
539-
<div id="f4d0909e" class="cell" data-execution_count="2">
545+
<div id="266a3ba9" class="cell" data-execution_count="2">
540546
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="3">
541547
<section id="conv_gemsdata" class="level3">
542548
<h3 class="anchored" data-anchor-id="conv_gemsdata"><code>conv_gemsdata</code></h3>
@@ -720,7 +726,7 @@ <h4 class="anchored">Examples</h4>
720726
</div>
721727
<div id="callout-5" class="callout-5-contents callout-collapse collapse show">
722728
<div class="callout-body-container callout-body">
723-
<div id="e46111a6" class="cell" data-execution_count="3">
729+
<div id="82ce17c3" class="cell" data-execution_count="3">
724730
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="4">
725731
<section id="bp_35" class="level3">
726732
<h3 class="anchored" data-anchor-id="bp_35"><code>BP_35</code></h3>
@@ -778,7 +784,7 @@ <h2 class="anchored" data-anchor-id="filtering-functions">Filtering Functions</h
778784
</div>
779785
<div id="callout-7" class="callout-7-contents callout-collapse collapse show">
780786
<div class="callout-body-container callout-body">
781-
<div id="0a6e0fa4" class="cell" data-execution_count="4">
787+
<div id="e77ea3e7" class="cell" data-execution_count="4">
782788
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="5">
783789
<section id="autobandpassfilter" class="level3">
784790
<h3 class="anchored" data-anchor-id="autobandpassfilter"><code>autobandpassfilter</code></h3>
@@ -850,11 +856,13 @@ <h2 class="anchored" data-anchor-id="internal-api-for-tip-calculation">Internal
850856
</div>
851857
<div id="callout-8" class="callout-8-contents callout-collapse collapse show">
852858
<div class="callout-body-container callout-body">
853-
<div id="f4b5fb0d" class="cell" data-execution_count="5">
859+
<div id="531e0629" class="cell" data-execution_count="5">
854860
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="6">
855861
<section id="tiparea" class="level3">
856862
<h3 class="anchored" data-anchor-id="tiparea"><code>TIPArea</code></h3>
857-
<p><code>isinS</code> indicates the points of xLon, yLat that are in the range of <code>Rc</code> centered at <code>Lon</code>, <code>Lat</code>. <strong>Unit:</strong></p>
863+
<p>Given the Longitude <code>Lon</code>, Latitude <code>Lat</code> and the radius <code>Rc</code>, <code>[isinS,insideRatio] = TIPArea(Lon,Lat,Rc,xLon,yLat)</code> returns a logical vector indicating whether each grid point specified by <code>xLon</code> and <code>yLat</code> is inside <code>Rc</code> centered at (<code>Lon</code>, <code>Lat</code>).</p>
864+
<p><code>TIPArea</code> used <code>isInpolygon</code> of <code>okatsn/toolbox</code> which simply splits circles by <code>NaN</code> before applying matlab’s <code>inpolygon</code>. In the official documentation of <code>inpolygon</code> in the section “Points Inside Multiply Connected Polygon”, if the polygon in the inner loop are defined in a counterclockwise direction while the outer one in a clockwise direction, <code>inpolygon</code> identifies the points inside the outer polygon but not inside the inner polygon. What the official documentation didn’t explicitly say is, if two (or more) polygons are all defined in the same direction, which is our case that all circles are defined in the counterclockwise direction, <code>inpolygon</code> identifies points in either polygon, which the expected behavior in our application. That is, when the TIP area of one station overlapped with the TIP area of another one station, <code>isinS</code> is <code>true</code> if a grid point is inside of either and <code>(xLon(isinS), yLat(isinS))</code> are essentially the union of the TIP area of all stations.</p>
865+
<p><strong>Unit:</strong></p>
858866
<ul>
859867
<li><code>xLon</code> (<code>yLat</code>): degree of longitude (latitude).</li>
860868
<li><code>Rc</code>: kilometer. Noted that <code>Rc</code> is convert to the unit of degree and be the mean of those based on the latitude and longitude of the center respectively. (Hint: when converting km to deg, it depends on latitude and the longitude. For example, at lower latitude, the distance of 1 deg interval in longitude is much larger than that of 1 deg interval at high latitude.)</li>
@@ -867,15 +875,15 @@ <h3 class="anchored" data-anchor-id="tiparea"><code>TIPArea</code></h3>
867875
</ul>
868876
<p><strong>Output:</strong></p>
869877
<ul>
870-
<li><code>isinS</code>: <code>xLon(isinS),yLat(isinS)</code> specify all the points (clearly non-repeated) that are within the ranges of radii <code>Rc</code> inside the centers specified by <code>Lon</code>, <code>Lat</code>.</li>
878+
<li><code>isinS</code>: a N by 1 array, where <code>xLon(isinS),yLat(isinS)</code> specify all the points (clearly non-repeated) that are within the ranges of radii <code>Rc</code> inside the centers specified by <code>Lon</code>, <code>Lat</code>.</li>
871879
</ul>
872880
</section>
873881
<section id="tipspatialtemporal" class="level3">
874882
<h3 class="anchored" data-anchor-id="tipspatialtemporal"><code>TIPspatialtemporal</code></h3>
875-
<p><strong>Output:</strong></p>
876-
<ul>
877-
<li><code>isinTS</code>: a S by T logical array specifying spatial-temporal points that are within the ranges of radii <code>Rc</code> inside the centers specified by <code>Lon</code>, <code>Lat</code>, where <code>[Rc, Lon, Lat] = LatLonRc_TIPtrue</code> is a M by 3 array where <span class="math inline">\(M \geq T\)</span> must be satisfied.</li>
878-
</ul>
883+
<p>Given the dates to calculate TIP area <code>dates_TIPtrue</code>, the range (<code>Rc</code>) around the center point (<code>LatLon</code>) in <code>LatLonRc_TIPtrue</code>, and the grid points of the entire map (<code>xLon</code>, <code>yLat</code>), <code>[dt_TIP_true_uniq,TIP_true_area,isinTS] = TIPspatialtemporal(dates_TIPtrue,LatLonRc_TIPtrue, xLon, yLat)</code> returns the unique and sorted vector of dates (<code>dt_TIP_true_uniq</code>) and the vector of spatial TIP area <code>TIP_true_area</code> for each date in <code>dt_TIP_true_uniq</code>.</p>
884+
<p>The value of <code>TIP_true_area</code> is the ratio of spatial TIP area to total area. When in the context of calculating the total amount of alarmed area, <code>sum(TIP_true_area)</code> is the alarmed area ratio to the entire 2D space specified by <code>xLon</code> and <code>yLat</code> (i.e., which are all grid points in the region of <code>[TwLat0, TwLat1],[TwLon0, TwLon1]</code>). See <code>TIPArea</code> for more information.</p>
885+
<p><code>isinTS</code> is a S by T logical array specifying spatial-temporal points that are within the ranges of radii <code>Rc</code> inside the centers specified by <code>Lon</code>, <code>Lat</code>, where <code>[Rc, Lon, Lat] = LatLonRc_TIPtrue</code> is a M by 3 array where <span class="math inline">\(M \geq T\)</span> must be satisfied.</p>
886+
<p>Noted that <code>dt_TIP_true_uniq</code> are successive (e.g., 1, 2, 4) dates but not necessarily consecutive (e.g., 1, 2, 3).</p>
879887
</section>
880888
<section id="bestmodel" class="level3">
881889
<h3 class="anchored" data-anchor-id="bestmodel"><code>bestmodel</code></h3>
@@ -1049,7 +1057,7 @@ <h3 class="anchored" data-anchor-id="jointstation"><code>jointstation</code></h3
10491057
<span id="cb20-4"><a href="#cb20-4" aria-hidden="true" tabindex="-1"></a> <span class="va">sum_tsAINs</span><span class="op">,</span><span class="va">sum_validateInds</span><span class="op">,</span><span class="va">DateTime_dti</span><span class="op">,...</span></span>
10501058
<span id="cb20-5"><a href="#cb20-5" aria-hidden="true" tabindex="-1"></a> <span class="va">CWBcatalog</span><span class="op">,</span><span class="ss">'CalculateHitRate'</span><span class="op">,</span><span class="va">true</span><span class="op">,...</span></span>
10511059
<span id="cb20-6"><a href="#cb20-6" aria-hidden="true" tabindex="-1"></a> <span class="ss">'CalculateAlarmedRate'</span><span class="op">,</span><span class="va">true</span><span class="op">,</span><span class="ss">'CalculateProbability'</span><span class="op">,</span><span class="va">HitRates_trn</span><span class="op">,...</span></span>
1052-
<span id="cb20-7"><a href="#cb20-7" aria-hidden="true" tabindex="-1"></a> <span class="ss">'StationLocation'</span><span class="op">,</span><span class="va">StationLocation</span><span class="op">,</span> <span class="ss">'Verbose'</span><span class="op">,</span> <span class="va">true</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
1060+
<span id="cb20-7"><a href="#cb20-7" aria-hidden="true" tabindex="-1"></a> <span class="ss">'StationLocation'</span><span class="op">,</span><span class="va">StationLocation</span><span class="op">,</span> <span class="ss">'WithExtra'</span><span class="op">,</span> <span class="va">true</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
10531061
<p><strong>Keyword Arguments:</strong></p>
10541062
<ul>
10551063
<li><p>‘CalculateHitRate’: Whether to calculate the hit rates. Default is <code>false</code>.</p></li>
@@ -1074,11 +1082,11 @@ <h3 class="anchored" data-anchor-id="jointstation"><code>jointstation</code></h3
10741082
<li><code>sum_validateInds</code>: A J-by-1 cell array with each cell corresponding to <code>BestmodelNames</code>. See <code>loadAIN()</code>.</li>
10751083
<li><code>DateTime_dti</code>: A T by 1 datetime array for the time series in <code>sum_tsAINs</code> and the <code>sum_validateInds</code>.</li>
10761084
<li><code>CWBcatalog</code>: A table of earthquake catalog. You may load <code>CWBcatalog</code> using <code>only1field([dir_catalog filesep 'catalog.mat'])</code>.</li>
1077-
<li><code>Verbose</code>: Output an additional <code>struct</code> of <code>Other</code> variables.</li>
1085+
<li><code>WithExtra</code>: Output an additional <code>struct</code> of supplementary data as the <code>Other</code> variable.</li>
10781086
</ul>
10791087
<p><strong>Output arguments:</strong></p>
10801088
<ul>
1081-
<li><p><code>HitRates</code>, <code>AlarmedRates</code>: M by 1 array, being the hit rates (alarmed rates) of each combination of best models. M is the amounts of total combinations (the <code>totalM</code> in <code>bestmodel()</code>). They are <code>AlarmedRateForecasting</code> and <code>HitRatesForecasting</code> of <code>molscore3</code>’s output.</p></li>
1089+
<li><p><code>HitRates</code>, <code>AlarmedRates</code>: M by 1 array, being the hit rates (alarmed rates) of each combination of best models. M is the amounts of total combinations (the <code>totalM</code> in <code>bestmodel()</code>). They are <code>AlarmedRateForecasting</code> and <code>HitRatesForecasting</code> of <code>molscore3</code>’s output. <code>AlarmedRates(i)</code> can be a number or <code>NaN</code> (when <code>0/0</code>).</p></li>
10821090
<li><p><code>SpatialProbability</code>: A S by T array of the temporal-spatial forecasting probabilities. It is the output variable <code>Probability</code> of <code>molscore3()</code>.</p></li>
10831091
<li><p><code>xLon</code> (<code>yLat</code>): The longitudes (latitudes) of all spatial points as a S by 1 array. It is the output variable <code>ProbabilityLon</code> (<code>ProbabilityLat</code>) of <code>molscore3()</code>.</p></li>
10841092
<li><p><code>validStationTime</code>: A T by J table of the ratio of valid models each day each station. This is for <code>plotProbability()</code>, that the ratio will be demonstrated as gradient color in the marker of each station. If the ratio is zero, the marker on map will be hollow. It is the output variable <code>validStationTime</code> of <code>molscore3()</code>.</p></li>
@@ -1091,13 +1099,13 @@ <h3 class="anchored" data-anchor-id="jointstation"><code>jointstation</code></h3
10911099
<li><code>InStation</code>: Indicates the target earthquake is of which station.</li>
10921100
<li><code>EqkDist</code>: The distance between the station (as specified by <code>InStation</code>) and hypocenter of the target earthquake. Also see <code>simpleStationEQKdist3D</code>.</li>
10931101
</ul></li>
1094-
<li><p><code>Other</code>: The additional output when ‘Verbose’ is <code>true</code>.</p>
1102+
<li><p><code>Other</code>: The additional output when ‘WithExtra’ is <code>true</code>.</p>
10951103
<ul>
10961104
<li><code>Other.nEQK</code>: The number of target earthquakes for each model in forecasting phase.</li>
1097-
<li><code>Other.areaTIP</code>: The total area (spatial + temporal) of TIP for each model in forecasting phase. See <code>TIPspatialtemporal</code> and <code>TIPArea</code>.</li>
1098-
<li><code>Other.nEQK .* HitRates</code> is the number of hitted earthquakes in this forecasting phase.</li>
1099-
<li><code>Other.areaTIP .* AlarmedRates</code> is the total amount of alarmed TIP area in this forecasting phase.</li>
1100-
<li>Noted that it is nonsesnse to set ‘Verbose’ to be <code>true</code> when ‘calculateHitRate’ and ‘calculateAlarmedRate’ are <code>false</code>.</li>
1105+
<li><code>Other.areaTIP</code>: The total area (spatial + temporal, i.e., <code>sum(TIP_valid_area)</code>) of TIP for each model in forecasting phase. See <code>TIPspatialtemporal</code> and <code>TIPArea</code>.</li>
1106+
<li><code>Other.nEQK .* HitRates</code> is the number of hitted earthquakes for each model in this forecasting phase.</li>
1107+
<li><code>Other.areaTIP .* AlarmedRates</code> is the total amount of alarmed TIP area (i.e., <code>sum(TIP_true_area)</code>) for each model in this forecasting phase.</li>
1108+
<li>Noted that it is nonsesnse to set ‘WithExtra’ to be <code>true</code> when ‘calculateHitRate’ and ‘calculateAlarmedRate’ are <code>false</code>.</li>
11011109
</ul></li>
11021110
</ul>
11031111
</section>
@@ -1220,7 +1228,7 @@ <h2 class="anchored" data-anchor-id="format">Format</h2>
12201228
</div>
12211229
<div id="callout-9" class="callout-9-contents callout-collapse collapse show">
12221230
<div class="callout-body-container callout-body">
1223-
<div id="0546a36e" class="cell" data-execution_count="6">
1231+
<div id="ae4eeb73" class="cell" data-execution_count="6">
12241232
<section id="fmt" class="level3 cell-output cell-output-display cell-output-markdown" data-execution_count="7">
12251233
<h3 class="anchored" data-anchor-id="fmt"><code>fmt</code></h3>
12261234
<p><code>fmt</code> is a class that</p>
@@ -1274,7 +1282,7 @@ <h2 class="anchored" data-anchor-id="plotting-functions">Plotting functions</h2>
12741282
</div>
12751283
</div>
12761284
<div class="callout-body-container callout-body">
1277-
<div id="80588bd4" class="cell" data-execution_count="7">
1285+
<div id="569cefe4" class="cell" data-execution_count="7">
12781286
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="8">
12791287
<section id="plotcb" class="level3">
12801288
<h3 class="anchored" data-anchor-id="plotcb"><code>plotCB</code></h3>
@@ -1376,7 +1384,7 @@ <h2 class="anchored" data-anchor-id="others">Others</h2>
13761384
</div>
13771385
<div id="callout-11" class="callout-11-contents callout-collapse collapse show">
13781386
<div class="callout-body-container callout-body">
1379-
<div id="535df88b" class="cell" data-execution_count="8">
1387+
<div id="afd85962" class="cell" data-execution_count="8">
13801388
<div class="cell-output cell-output-display cell-output-markdown" data-execution_count="9">
13811389
<section id="molchan_cb" class="level3">
13821390
<h3 class="anchored" data-anchor-id="molchan_cb"><code>Molchan_CB</code></h3>

‎docs/doc_tutorial/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ <h6 class="anchored" data-anchor-id="free-form">Free form</h6>
445445
</tbody>
446446
</table>
447447
<p>here is a partial view on an exemplary <code>station_location.csv</code>:</p>
448-
<div id="1dd1621d" class="cell" data-execution_count="1">
448+
<div id="e6510a06" class="cell" data-execution_count="1">
449449
<div class="cell-output cell-output-display">
450450
<table class="caption-top table table-sm table-striped small" data-quarto-postprocess="true">
451451
<thead>

0 commit comments

Comments
 (0)