metdig

智能网格预报可视化诊断分析及权重推荐系统


集合预报诊断分析计算ensemble

<p>[TOC]</p> <h1>集合敏感性分析</h1> <pre><code class="language-python">ensemble_sensitive(var_x,var_y,mean_area,sig_lev)</code></pre> <p>&lt;font size=&quot;4&quot;&gt;&lt;b&gt;参数说明&lt;/b&gt;&lt;/font&gt;</p> <table> <thead> <tr> <th style="text-align: left;">参数</th> <th style="text-align: left;">必选</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">var_x</td> <td style="text-align: left;">&lt;font color=&quot;red&quot;&gt;是&lt;/font&gt;</td> <td style="text-align: left;">stda</td> <td style="text-align: left;">敏感度自变量</td> </tr> <tr> <td style="text-align: left;">var_y</td> <td style="text-align: left;">&lt;font color=&quot;red&quot;&gt;是&lt;/font&gt;</td> <td style="text-align: left;">stda</td> <td style="text-align: left;">敏感度因变量</td> </tr> <tr> <td style="text-align: left;">mean_area</td> <td style="text-align: left;">&lt;font color=&quot;red&quot;&gt;是&lt;/font&gt;</td> <td style="text-align: left;">list</td> <td style="text-align: left;">敏感度平均区域,如:[105,125,25,35]</td> </tr> <tr> <td style="text-align: left;">sig_lev</td> <td style="text-align: left;">&lt;font color=&quot;red&quot;&gt;是&lt;/font&gt;</td> <td style="text-align: left;">float</td> <td style="text-align: left;">显著性水平,如:0.95</td> </tr> </tbody> </table> <table> <thead> <tr> <th style="text-align: left;">返回值</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">dict</td> <td style="text-align: left;">敏感性相关矩阵和对应sig_lev显著性水平的临界相关系数</td> </tr> </tbody> </table> <p>&lt;font size=&quot;4&quot;&gt;&lt;b&gt;调用示例&lt;/b&gt;&lt;/font&gt;</p> <pre><code class="language-python"># 模式 data_name = &amp;#039;ecmwf_ens&amp;#039; # 起报时间 init_time = datetime(2024,6,26,8) # 预报时效 fhour = 24 # 敏感度平均区域 mean_area = [105,125,25,35] hgt=metdig_io.cmadaas.get_model_grids(init_time=init_time,var_name=&amp;#039;hgt&amp;#039;,level=500,data_name=&amp;#039;ecmwf_ens&amp;#039;,fhours=[fhour], extent = [70,140,10,60]) rain=metdig_io.cmadaas.get_model_grids(init_time=init_time,var_name=&amp;#039;rain&amp;#039;,data_name=&amp;#039;ecmwf_ens&amp;#039;,fhours=[fhour], extent = [70,140,10,60]) sensitive,sig_r = metdig.cal.ensemble_sensitive(hgt,rain,mean_area=mean_area,sig_lev=0.95) print(sensitive) print(sig_r)</code></pre> <p>&lt;font size=&quot;4&quot;&gt;&lt;b&gt;输出信息&lt;/b&gt;&lt;/font&gt;</p> <pre><code class="language-python">&amp;lt;xarray.DataArray (member: 1, lat: 51, lon: 71)&amp;gt; array([[[-0.05641029, -0.03652296, -0.02386137, ..., -0.24727232, -0.25757285, -0.23066381], [-0.09596617, -0.07768409, -0.07728238, ..., -0.20457158, -0.24136463, -0.23663574], [-0.14247215, -0.12694309, -0.13900364, ..., -0.16469826, -0.21014542, -0.24335117], ..., [-0.32508798, -0.32933686, -0.32987893, ..., 0.12586257, 0.12834175, 0.13134546], [-0.29120784, -0.29516904, -0.29522658, ..., 0.10670732, 0.1092673 , 0.11188734], [-0.26347924, -0.26703695, -0.26827418, ..., 0.09174522, 0.09332512, 0.09553428]]]) Coordinates: * member (member) object &amp;#039;ecmwf_ens&amp;#039; dtime int32 24 time datetime64[ns] 2024-06-26T08:00:00 * lat (lat) float64 10.0 11.0 12.0 13.0 14.0 ... 56.0 57.0 58.0 59.0 60.0 * lon (lon) float64 70.0 71.0 72.0 73.0 74.0 ... 137.0 138.0 139.0 140.0 0.2756838051439881</code></pre> <h1>tubing聚类分析</h1> <p>part1: Central Cluster The ensemble mean (EM) is defined as the average of the ensemble forecasts (fl) . The n distances dm(i) from each ensemble forecast to the EM are computed (Euclidean Distance). The ensemble forecast that is closest to the EM, min[dm(i)], becomes the first member of the central cluster. This is iterated until the central cluster limits are reached. Spread-dependent configuration: the limitation depends on the actual ensemble spread. For example, the central cluster variance is limited to 50% of the total ensemble variance. The distance from the last ensemble forecast classified in the central cluster to the EM becomes the radius r of the classification.</p> <p>part2: Tubes The matrix d of ensemble forecasts interdistances is computed. The ensemble forecast that is farthest from the ensemble mean, max[dm(i)], becomes the extreme of the first tube. For each ensemble forecasts member(i) that has not been classified in the central cluster, that is, not a tube extreme, and whose distance dm(i) to the ensemble mean is maximum, if the two following operations are achieved for each existing tube extreme, member(i) is a member of the tube j 1、the projection of dm(i) on the of the axis of the exist tube j  defined as dd(i, j)&gt;0 2、the distance of member(i) to the axis of tube j defined as  dx(i, j) &lt; r </p> <pre><code class="language-python">tubing(stda, extent_tube_based=None, threshold_tube=0.5)</code></pre> <p>&lt;font size=&quot;4&quot;&gt;&lt;b&gt;参数说明&lt;/b&gt;&lt;/font&gt;</p> <table> <thead> <tr> <th style="text-align: left;">参数</th> <th style="text-align: left;">必选</th> <th style="text-align: left;">类型</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">stda</td> <td style="text-align: left;">&lt;font color=&quot;red&quot;&gt;是&lt;/font&gt;</td> <td style="text-align: left;">stda</td> <td style="text-align: left;">被分析的要素</td> </tr> <tr> <td style="text-align: left;">extent_tube_based</td> <td style="text-align: left;">否</td> <td style="text-align: left;">list, optional</td> <td style="text-align: left;">tube区域, 例如 [70., 136., 10., 55.]</td> </tr> <tr> <td style="text-align: left;">threshold_tube</td> <td style="text-align: left;">否</td> <td style="text-align: left;">float, optional</td> <td style="text-align: left;">tube阈值,默认0.5</td> </tr> </tbody> </table> <table> <thead> <tr> <th style="text-align: left;">返回值</th> <th style="text-align: left;">说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">dict</td> <td style="text-align: left;">以字典形式返回聚类结果</td> </tr> </tbody> </table> <p>&lt;font size=&quot;4&quot;&gt;&lt;b&gt;调用示例&lt;/b&gt;&lt;/font&gt;</p> <pre><code class="language-python">dic = metdig.cal.tubing(hgt) print(dic)</code></pre> <p>&lt;font size=&quot;4&quot;&gt;&lt;b&gt;输出信息&lt;/b&gt;&lt;/font&gt;</p> <pre><code class="language-python">{&amp;#039;tubes_index&amp;#039;: {1: [2, 27, 24], 2: [4], 3: [34], 4: [50], 5: [16]}, &amp;#039;member_central&amp;#039;: array([29, 13, 35, 3, 26, 41, 44, 23, 17, 0, 15, 11, 40, 45, 49, 28, 10, 25, 33, 8, 20, 48, 38, 43, 21, 30, 1, 9, 42, 46, 18, 5, 19, 12, 32, 39, 47, 7, 37, 31, 22, 6, 36, 14]), &amp;#039;vari_total&amp;#039;: &amp;lt;xarray.DataArray &amp;#039;hgt&amp;#039; ()&amp;gt; array(1946.0272, dtype=float32) Coordinates: dtime int32 24 time datetime64[ns] 2024-06-26T08:00:00 level int32 500, &amp;#039;r&amp;#039;: array(252.34698, dtype=float32)} </code></pre>

页面列表

ITEM_HTML