w-kriging
Version:
A tool for kriging.
686 lines (216 loc) • 13 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Global - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav >
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WKriging">WKriging</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="WKriging"><span class="type-signature type-signature-async">(async) </span>WKriging<span class="signature">(psSrc, psTar, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise}</span></h4>
<dl class="details">
<dt class="tag-description">Description:</dt>
<dd class="tag-description"><ul class="dummy"><li><p>Kriging內外插值,支援2D與3D</p></li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="WKriging.mjs.html">WKriging.mjs</a>, <a href="WKriging.mjs.html#line145">line 145</a>
</li></ul></dd>
</dl>
<h5 class="h5-examples">Example</h5>
<pre class="prettyprint"><code>async function test2d1() {
let psSrc = [
{
x: -0.1, y: -0.1, z: 0
},
{
x: 1, y: 0, z: 0
},
{
x: 1, y: 1, z: 10
},
{
x: 0, y: 1, z: 0
},
]
let psTar = [
{ x: 0.1, y: 0.95 },
]
let opt = {
variogram_model: 'gaussian',
nlags: 9,
}
let r = await WKriging(psSrc, psTar, opt)
console.log('test2d1', r)
// => test2d [ { x: 0.1, y: 0.95, z: 1.8997805977145759 } ]
}
test2d1()
.catch((err) => {
console.log('catch', err)
})
async function test2d2() {
let psSrc = [{ x: 243, y: 206, z: 95 }, { x: 233, y: 225, z: 146 }, { x: 21, y: 325, z: 22 }, { x: 953, y: 28, z: 223 }, { x: 1092, y: 290, z: 39 }, { x: 744, y: 200, z: 191 }, { x: 174, y: 3, z: 22 }, { x: 537, y: 368, z: 249 }, { x: 1151, y: 371, z: 86 }, { x: 814, y: 252, z: 125 }]
let psTar = [{
x: 243,
y: 205,
}]
let opt = {
variogram_model: 'exponential',
nlags: 9,
}
let r = await WKriging(psSrc, psTar, opt)
console.log('test2d2', r)
// => test2d [ { x: 243, y: 205, z: 94.89492366904084 } ]
}
test2d2()
.catch((err) => {
console.log('catch', err)
})
async function test3d1() {
let psSrc = [
{
x: -0.1, y: -0.1, z: -0.1, v: 0
},
{
x: 1, y: 0, z: 0, v: 0
},
{
x: 1, y: 1, z: 0, v: 0
},
{
x: 0, y: 0, z: 1, v: 0
},
{
x: 1, y: 0, z: 1, v: 0
},
{
x: 1, y: 1, z: 1, v: 10
},
]
let psTar = [
{
x: 0.1, y: 0.1, z: 0.95
},
]
let opt = {
variogram_model: 'gaussian',
nlags: 9,
}
let r = await WKriging(psSrc, psTar, opt)
console.log('test3d1', r)
// => test3d [ { x: 0.1, y: 0.1, z: 0.95, v: 1.666666666666666 } ]
}
test3d1()
.catch((err) => {
console.log('catch', err)
})</code></pre>
<h5 class="h5-parameters">Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>psSrc</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>輸入二維座標加觀測數據點陣列,為[{x:x1,y:y1,z:z1},{x:x2,y:y2,z:z2},...]點物件之陣列,或可為[[x1,y1,z1],[x2,y2,z2],...]點陣列之陣列,亦可支援三維座標加觀測數據點陣列,為[{x:x1,y:y1,z:z1,v:v1},{x:x2,y:y2,z:z2,v:v2},...]點物件之陣列,或可為[[x1,y1,z1,v1],[x2,y2,z2,v2],...]點陣列之陣列</p></td>
</tr>
<tr>
<td class="name"><code>psTar</code></td>
<td class="type">
<span class="param-type">Array</span>
|
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"><p>輸入二維座標點陣列或點物件,為[{x:x1,y:y1},{x:x2,y:y2},...]點物件之陣列,或{x:x1,y:y1}點物件,亦可支援三維座標點陣列或點物件,為[{x:x1,y:y1,z:z1},{x:x2,y:y2,z:z2},...]點物件之陣列,或{x:x1,y:y1,z:z1}點物件</p></td>
</tr>
<tr>
<td class="name"><code>opt</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>{}</code>
</td>
<td class="description last"><p>輸入設定物件,預設{}</p>
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>keyX</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>'x'</code>
</td>
<td class="description last"><p>輸入點物件之x欄位字串,為座標,預設'x'</p></td>
</tr>
<tr>
<td class="name"><code>keyY</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>'y'</code>
</td>
<td class="description last"><p>輸入點物件之y欄位字串,為座標,預設'y'</p></td>
</tr>
<tr>
<td class="name"><code>keyZ</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>'z'</code>
</td>
<td class="description last"><p>輸入點物件之z欄位字串,若為二維則為觀測值,若為三維則為座標,預設'z'</p></td>
</tr>
<tr>
<td class="name"><code>keyV</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>'v'</code>
</td>
<td class="description last"><p>輸入點物件之v欄位字串,為觀測值,預設'v'</p></td>
</tr>
<tr>
<td class="name"><code>variogram_model</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>'exponential'</code>
</td>
<td class="description last"><p>輸入變異圖模式字串,可選'linear'、'power'、'gaussian'、'spherical'、'exponential'、'hole-effect',其定義詳見pykrige,預設'exponential'</p></td>
</tr>
<tr>
<td class="name"><code>nlags</code></td>
<td class="type">
<span class="param-type">Integer</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
<code>9</code>
</td>
<td class="description last"><p>輸入變異圖統計直條圖數量整數,其定義詳見pykrige,預設9</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5 class="h5-returns">Returns:</h5>
<div class="param-desc">
<p>回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Jul 07 2025 10:35:06 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>
</body>
</html>