w-geo 1.1.21 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/w-geo.umd.js +3 -3
- package/dist/w-geo.umd.js.map +1 -1
- package/docs/-_class.mjs.html +1 -1
- package/docs/calcDepthByDepthStartEnd.mjs.html +1 -1
- package/docs/calcDepthStartEndByConnect.mjs.html +1 -1
- package/docs/calcDepthStartEndByDepth.mjs.html +1 -1
- package/docs/calcDepthStartEndByGroup.mjs.html +1 -1
- package/docs/calcLiquefaction.mjs.html +1 -1
- package/docs/calcVerticalStress.mjs.html +1 -1
- package/docs/checkDepth.mjs.html +1 -1
- package/docs/checkDepthStartEnd.mjs.html +1 -1
- package/docs/complementDepthData.mjs.html +1 -1
- package/docs/groupByDepthStartEnd.mjs.html +1 -1
- package/docs/index.html +1 -1
- package/docs/mergeByDepthStartEnd.mjs.html +1 -1
- package/docs/relaPlasticityParams.mjs.html +1 -1
- package/docs/relaPorousParams.mjs.html +1 -1
- package/docs/sepDepthStartEndByDepth.mjs.html +1 -1
- package/docs/smoothDepthByKey.mjs.html +1 -1
- package/docs/w-geo.html +1 -1
- package/g_8_1-dtIntrpPsdBySize.mjs +1 -1
- package/g_8_1-dtIntrpPsdContentIso.mjs +46 -0
- package/package.json +1 -1
- package/src/WGeo.mjs +1 -0
- package/src/dtIntrpPsdContentIso.mjs +109 -0
- package/test/dtIntrpPsdContentIso.test.mjs +46 -0
package/docs/-_class.mjs.html
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<br class="clear">
|
|
63
63
|
|
|
64
64
|
<footer>
|
|
65
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
65
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
66
66
|
</footer>
|
|
67
67
|
|
|
68
68
|
<script>prettyPrint();</script>
|
|
@@ -233,7 +233,7 @@ export default calcDepthByDepthStartEnd
|
|
|
233
233
|
<br class="clear">
|
|
234
234
|
|
|
235
235
|
<footer>
|
|
236
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
236
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
237
237
|
</footer>
|
|
238
238
|
|
|
239
239
|
<script>prettyPrint();</script>
|
|
@@ -322,7 +322,7 @@ export default calcDepthStartEndByConnect
|
|
|
322
322
|
<br class="clear">
|
|
323
323
|
|
|
324
324
|
<footer>
|
|
325
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
325
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
326
326
|
</footer>
|
|
327
327
|
|
|
328
328
|
<script>prettyPrint();</script>
|
|
@@ -347,7 +347,7 @@ export default calcDepthStartEndByDepth
|
|
|
347
347
|
<br class="clear">
|
|
348
348
|
|
|
349
349
|
<footer>
|
|
350
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
350
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
351
351
|
</footer>
|
|
352
352
|
|
|
353
353
|
<script>prettyPrint();</script>
|
|
@@ -566,7 +566,7 @@ export default calcDepthStartEndByGroup
|
|
|
566
566
|
<br class="clear">
|
|
567
567
|
|
|
568
568
|
<footer>
|
|
569
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
569
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
570
570
|
</footer>
|
|
571
571
|
|
|
572
572
|
<script>prettyPrint();</script>
|
|
@@ -7801,7 +7801,7 @@ export default calcLiquefaction
|
|
|
7801
7801
|
<br class="clear">
|
|
7802
7802
|
|
|
7803
7803
|
<footer>
|
|
7804
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
7804
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
7805
7805
|
</footer>
|
|
7806
7806
|
|
|
7807
7807
|
<script>prettyPrint();</script>
|
|
@@ -733,7 +733,7 @@ export default { //整合輸出預設得要有default
|
|
|
733
733
|
<br class="clear">
|
|
734
734
|
|
|
735
735
|
<footer>
|
|
736
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
736
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
737
737
|
</footer>
|
|
738
738
|
|
|
739
739
|
<script>prettyPrint();</script>
|
package/docs/checkDepth.mjs.html
CHANGED
|
@@ -214,7 +214,7 @@ export default checkDepth
|
|
|
214
214
|
<br class="clear">
|
|
215
215
|
|
|
216
216
|
<footer>
|
|
217
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
217
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
218
218
|
</footer>
|
|
219
219
|
|
|
220
220
|
<script>prettyPrint();</script>
|
|
@@ -273,7 +273,7 @@ export default checkDepthStartEnd
|
|
|
273
273
|
<br class="clear">
|
|
274
274
|
|
|
275
275
|
<footer>
|
|
276
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
276
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
277
277
|
</footer>
|
|
278
278
|
|
|
279
279
|
<script>prettyPrint();</script>
|
|
@@ -506,7 +506,7 @@ export default complementDepthData
|
|
|
506
506
|
<br class="clear">
|
|
507
507
|
|
|
508
508
|
<footer>
|
|
509
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
509
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
510
510
|
</footer>
|
|
511
511
|
|
|
512
512
|
<script>prettyPrint();</script>
|
|
@@ -492,7 +492,7 @@ export default groupByDepthStartEnd
|
|
|
492
492
|
<br class="clear">
|
|
493
493
|
|
|
494
494
|
<footer>
|
|
495
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
495
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
496
496
|
</footer>
|
|
497
497
|
|
|
498
498
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<br class="clear">
|
|
72
72
|
|
|
73
73
|
<footer>
|
|
74
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
75
75
|
</footer>
|
|
76
76
|
|
|
77
77
|
<script>prettyPrint();</script>
|
|
@@ -907,7 +907,7 @@ export default mergeByDepthStartEnd
|
|
|
907
907
|
<br class="clear">
|
|
908
908
|
|
|
909
909
|
<footer>
|
|
910
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
910
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
911
911
|
</footer>
|
|
912
912
|
|
|
913
913
|
<script>prettyPrint();</script>
|
|
@@ -334,7 +334,7 @@ export default relaPlasticityParams
|
|
|
334
334
|
<br class="clear">
|
|
335
335
|
|
|
336
336
|
<footer>
|
|
337
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
337
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
338
338
|
</footer>
|
|
339
339
|
|
|
340
340
|
<script>prettyPrint();</script>
|
|
@@ -524,7 +524,7 @@ export default relaPorousParams
|
|
|
524
524
|
<br class="clear">
|
|
525
525
|
|
|
526
526
|
<footer>
|
|
527
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
527
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
528
528
|
</footer>
|
|
529
529
|
|
|
530
530
|
<script>prettyPrint();</script>
|
|
@@ -324,7 +324,7 @@ export default sepDepthStartEndByDepth
|
|
|
324
324
|
<br class="clear">
|
|
325
325
|
|
|
326
326
|
<footer>
|
|
327
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
327
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
328
328
|
</footer>
|
|
329
329
|
|
|
330
330
|
<script>prettyPrint();</script>
|
|
@@ -280,7 +280,7 @@ export default smoothDepthByKey
|
|
|
280
280
|
<br class="clear">
|
|
281
281
|
|
|
282
282
|
<footer>
|
|
283
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
283
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
284
284
|
</footer>
|
|
285
285
|
|
|
286
286
|
<script>prettyPrint();</script>
|
package/docs/w-geo.html
CHANGED
|
@@ -9658,7 +9658,7 @@
|
|
|
9658
9658
|
<br class="clear">
|
|
9659
9659
|
|
|
9660
9660
|
<footer>
|
|
9661
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:
|
|
9661
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed May 08 2024 22:43:47 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
9662
9662
|
</footer>
|
|
9663
9663
|
|
|
9664
9664
|
<script>prettyPrint();</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import _ from 'lodash-es'
|
|
3
|
+
import w from 'wsemi'
|
|
4
|
+
import dtIntrpPsdContentIso from './src/dtIntrpPsdContentIso.mjs'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
let dt = {
|
|
8
|
+
GSD: `[101.6, 76.2, 50.8, 25.4, 19.0, 9.5, 4.75, 2.0, 0.85, 0.425, 0.25, 0.15, 0.106, 0.075, 0.027, 0.018, 0.011, 0.008, 0.006, 0.003, 0.001, 0.0, 0.0, 0.0]`,
|
|
9
|
+
GSP: `[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, -1.0, 100.0, 99.0, 96.0, 86.0, 74.0, 61.0, 51.0, 32.0, 16.0, 0.0, 0.0, 0.0]`,
|
|
10
|
+
}
|
|
11
|
+
console.log('dt', dt)
|
|
12
|
+
// => dt {
|
|
13
|
+
// GSD: '[101.6, 76.2, 50.8, 25.4, 19.0, 9.5, 4.75, 2.0, 0.85, 0.425, 0.25, 0.15, 0.106, 0.075, 0.027, 0.018, 0.011, 0.008, 0.006, 0.003, 0.001, 0.0, 0.0, 0.0]',
|
|
14
|
+
// GSP: '[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, -1.0, 100.0, 99.0, 96.0, 86.0, 74.0, 61.0, 51.0, 32.0, 16.0, 0.0, 0.0, 0.0]'
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
let psizes = [
|
|
18
|
+
630,
|
|
19
|
+
200,
|
|
20
|
+
63,
|
|
21
|
+
20,
|
|
22
|
+
6.3,
|
|
23
|
+
2,
|
|
24
|
+
0.63,
|
|
25
|
+
0.2,
|
|
26
|
+
0.063,
|
|
27
|
+
0.02,
|
|
28
|
+
0.0063,
|
|
29
|
+
0.002,
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
let dtn = dtIntrpPsdContentIso(dt, psizes)
|
|
33
|
+
console.log('dtn', dtn)
|
|
34
|
+
// => dtn {
|
|
35
|
+
// GSD: '[101.6, 76.2, 50.8, 25.4, 19.0, 9.5, 4.75, 2.0, 0.85, 0.425, 0.25, 0.15, 0.106, 0.075, 0.027, 0.018, 0.011, 0.008, 0.006, 0.003, 0.001, 0.0, 0.0, 0.0]',
|
|
36
|
+
// GSP: '[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, -1.0, 100.0, 99.0, 96.0, 86.0, 74.0, 61.0, 51.0, 32.0, 16.0, 0.0, 0.0, 0.0]',
|
|
37
|
+
// ctCoarseISO: 2,
|
|
38
|
+
// ctGravelISO: 0,
|
|
39
|
+
// ctSandISO: 2,
|
|
40
|
+
// ctFineISO: 98,
|
|
41
|
+
// ctSiltISO: 72,
|
|
42
|
+
// ctClayISO: 26
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
//node --experimental-modules g_8_1-dtIntrpPsdContentIso.mjs
|
package/package.json
CHANGED
package/src/WGeo.mjs
CHANGED
|
@@ -26,6 +26,7 @@ export { default as checkDepthStartEnd } from './checkDepthStartEnd.mjs'
|
|
|
26
26
|
export { default as cnst } from './cnst.mjs'
|
|
27
27
|
export { default as complementDepthData } from './complementDepthData.mjs'
|
|
28
28
|
export { default as dtIntrpPsdBySize } from './dtIntrpPsdBySize.mjs'
|
|
29
|
+
export { default as dtIntrpPsdContentIso } from './dtIntrpPsdContentIso.mjs'
|
|
29
30
|
export { default as getCptDepthHcOpt } from './getCptDepthHcOpt.mjs'
|
|
30
31
|
export { default as getDepthMaxMin } from './getDepthMaxMin.mjs'
|
|
31
32
|
export { default as groupByDepthStartEnd } from './groupByDepthStartEnd.mjs'
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import get from 'lodash-es/get.js'
|
|
2
|
+
import find from 'lodash-es/find.js'
|
|
3
|
+
import round from 'lodash-es/round.js'
|
|
4
|
+
import size from 'lodash-es/size.js'
|
|
5
|
+
import isnum from 'wsemi/src/isnum.mjs'
|
|
6
|
+
import isestr from 'wsemi/src/isestr.mjs'
|
|
7
|
+
import cdbl from 'wsemi/src/cdbl.mjs'
|
|
8
|
+
import dtIntrpPsdBySize from './dtIntrpPsdBySize.mjs'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
function dtIntrpPsdContentIso(dt, opt = {}) {
|
|
12
|
+
|
|
13
|
+
//keySize
|
|
14
|
+
let keySize = get(opt, 'keySize', '')
|
|
15
|
+
if (!isestr(keySize)) {
|
|
16
|
+
keySize = 'size'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//keyFraction
|
|
20
|
+
let keyFraction = get(opt, 'keyFraction', '')
|
|
21
|
+
if (!isestr(keyFraction)) {
|
|
22
|
+
keyFraction = 'fraction'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//dtIntrpPsdBySize
|
|
26
|
+
let psizes = [
|
|
27
|
+
630,
|
|
28
|
+
200,
|
|
29
|
+
63,
|
|
30
|
+
20,
|
|
31
|
+
6.3,
|
|
32
|
+
2,
|
|
33
|
+
0.63,
|
|
34
|
+
0.2,
|
|
35
|
+
0.063,
|
|
36
|
+
0.02,
|
|
37
|
+
0.0063,
|
|
38
|
+
0.002,
|
|
39
|
+
]
|
|
40
|
+
let psds = dtIntrpPsdBySize(dt, psizes, { keySize, keyFraction })
|
|
41
|
+
// console.log('psds', psds)
|
|
42
|
+
|
|
43
|
+
//check
|
|
44
|
+
if (size(psds) === 0) {
|
|
45
|
+
console.log('dt', dt)
|
|
46
|
+
console.log('psizes', psizes)
|
|
47
|
+
console.log('keySize', keySize)
|
|
48
|
+
console.log('keyFraction', keyFraction)
|
|
49
|
+
throw new Error('invalid PSD')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//1e20->2: 礫石
|
|
53
|
+
//2->0.063: 砂
|
|
54
|
+
//0.063->0.02: 粉土
|
|
55
|
+
//0.02->0: 黏土
|
|
56
|
+
let p2 = find(psds, { size: 2 })
|
|
57
|
+
let p0063 = find(psds, { size: 0.063 })
|
|
58
|
+
// let p0005 = find(psds, { size: 0.005 })
|
|
59
|
+
let p0002 = find(psds, { size: 0.002 })
|
|
60
|
+
let f2 = get(p2, 'fraction')
|
|
61
|
+
let f0063 = get(p0063, 'fraction')
|
|
62
|
+
// let f0005 = get(p0005, 'fraction')
|
|
63
|
+
let f0002 = get(p0002, 'fraction')
|
|
64
|
+
// console.log('p2', p2, 'p0063', p0063, 'p0002', p0002)
|
|
65
|
+
// console.log('f2', f2, 'f0063', f0063, 'f0002', f0002)
|
|
66
|
+
|
|
67
|
+
//check
|
|
68
|
+
if (!isnum(f2)) {
|
|
69
|
+
throw new Error('invalid PSD in 2mm')
|
|
70
|
+
}
|
|
71
|
+
if (!isnum(f0063)) {
|
|
72
|
+
throw new Error('invalid PSD in 0.063mm')
|
|
73
|
+
}
|
|
74
|
+
if (!isnum(f0002)) {
|
|
75
|
+
throw new Error('invalid PSD in 0.002mm')
|
|
76
|
+
}
|
|
77
|
+
f2 = cdbl(f2)
|
|
78
|
+
f0063 = cdbl(f0063)
|
|
79
|
+
f0002 = cdbl(f0002)
|
|
80
|
+
// console.log('f2', f2, 'f0063', f0063, 'f0002', f0002)
|
|
81
|
+
|
|
82
|
+
//ctGravelISO, ctSandISO, ctFineISO, ctClayISO, 四捨五入可能會導致4項總和非100%
|
|
83
|
+
let ctGravelISO = 100 - f2
|
|
84
|
+
ctGravelISO = round(ctGravelISO)
|
|
85
|
+
let ctSandISO = f2 - f0063
|
|
86
|
+
ctSandISO = round(ctSandISO)
|
|
87
|
+
let ctSiltISO = f0063 - f0002
|
|
88
|
+
ctSiltISO = round(ctSiltISO)
|
|
89
|
+
let ctClayISO = f0002
|
|
90
|
+
ctClayISO = round(ctClayISO)
|
|
91
|
+
// console.log('ctGravelISO', ctGravelISO, 'ctSandISO', ctSandISO, 'ctSiltISO', ctSiltISO, 'ctClayISO', ctClayISO)
|
|
92
|
+
|
|
93
|
+
//add prop.
|
|
94
|
+
dt.ctCoarseISO = ctGravelISO + ctSandISO
|
|
95
|
+
dt.ctGravelISO = ctGravelISO
|
|
96
|
+
dt.ctSandISO = ctSandISO
|
|
97
|
+
dt.ctFineISO = ctSiltISO + ctClayISO
|
|
98
|
+
dt.ctSiltISO = ctSiltISO
|
|
99
|
+
dt.ctClayISO = ctClayISO
|
|
100
|
+
// console.log('ctGravel Ori', dt.ctGravel, 'New', ctGravelISO)
|
|
101
|
+
// console.log('ctSand Ori', dt.ctSand, 'New', ctSandISO)
|
|
102
|
+
// console.log('ctFine Ori', (cdbl(dt.ctSilt) + cdbl(dt.ctClay)), 'New', ctFineISO)
|
|
103
|
+
// console.log('ctClay Ori', dt.ctClay, 'New', ctClayISO)
|
|
104
|
+
|
|
105
|
+
return dt
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export default dtIntrpPsdContentIso
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import assert from 'assert'
|
|
2
|
+
import _ from 'lodash-es'
|
|
3
|
+
import w from 'wsemi'
|
|
4
|
+
import dtIntrpPsdContentIso from '../src/dtIntrpPsdContentIso.mjs'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
describe(`dtIntrpPsdContentIso`, function() {
|
|
8
|
+
|
|
9
|
+
let dt = {
|
|
10
|
+
GSD: `[101.6, 76.2, 50.8, 25.4, 19.0, 9.5, 4.75, 2.0, 0.85, 0.425, 0.25, 0.15, 0.106, 0.075, 0.027, 0.018, 0.011, 0.008, 0.006, 0.003, 0.001, 0.0, 0.0, 0.0]`,
|
|
11
|
+
GSP: `[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, -1.0, 100.0, 99.0, 96.0, 86.0, 74.0, 61.0, 51.0, 32.0, 16.0, 0.0, 0.0, 0.0]`,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let psizes = [
|
|
15
|
+
630,
|
|
16
|
+
200,
|
|
17
|
+
63,
|
|
18
|
+
20,
|
|
19
|
+
6.3,
|
|
20
|
+
2,
|
|
21
|
+
0.63,
|
|
22
|
+
0.2,
|
|
23
|
+
0.063,
|
|
24
|
+
0.02,
|
|
25
|
+
0.0063,
|
|
26
|
+
0.002,
|
|
27
|
+
]
|
|
28
|
+
// let fss = dtIntrpPsdContentIso(dt, psizes)
|
|
29
|
+
|
|
30
|
+
let out1 = {
|
|
31
|
+
GSD: '[101.6, 76.2, 50.8, 25.4, 19.0, 9.5, 4.75, 2.0, 0.85, 0.425, 0.25, 0.15, 0.106, 0.075, 0.027, 0.018, 0.011, 0.008, 0.006, 0.003, 0.001, 0.0, 0.0, 0.0]',
|
|
32
|
+
GSP: '[100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, -1.0, 100.0, 99.0, 96.0, 86.0, 74.0, 61.0, 51.0, 32.0, 16.0, 0.0, 0.0, 0.0]',
|
|
33
|
+
ctCoarseISO: 2,
|
|
34
|
+
ctGravelISO: 0,
|
|
35
|
+
ctSandISO: 2,
|
|
36
|
+
ctFineISO: 98,
|
|
37
|
+
ctSiltISO: 72,
|
|
38
|
+
ctClayISO: 26
|
|
39
|
+
}
|
|
40
|
+
it(`should return ${out1} when dtIntrpPsdContentIso(dt, ${psizes})`, function() {
|
|
41
|
+
let r = dtIntrpPsdContentIso(dt, psizes)
|
|
42
|
+
let rr = out1
|
|
43
|
+
assert.strict.deepStrictEqual(r, rr)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
})
|