w-geo 1.1.21 → 1.1.23

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.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/dist/w-geo.umd.js +3 -3
  3. package/dist/w-geo.umd.js.map +1 -1
  4. package/docs/-_class.mjs.html +1 -1
  5. package/docs/calcDepthByDepthStartEnd.mjs.html +1 -1
  6. package/docs/calcDepthStartEndByConnect.mjs.html +1 -1
  7. package/docs/calcDepthStartEndByDepth.mjs.html +1 -1
  8. package/docs/calcDepthStartEndByGroup.mjs.html +1 -1
  9. package/docs/calcLiquefaction.mjs.html +1 -1
  10. package/docs/calcVerticalStress.mjs.html +1 -1
  11. package/docs/checkDepth.mjs.html +1 -1
  12. package/docs/checkDepthStartEnd.mjs.html +1 -1
  13. package/docs/complementDepthData.mjs.html +1 -1
  14. package/docs/groupByDepthStartEnd.mjs.html +1 -1
  15. package/docs/index.html +1 -1
  16. package/docs/mergeByDepthStartEnd.mjs.html +1 -1
  17. package/docs/relaPlasticityParams.mjs.html +1 -1
  18. package/docs/relaPorousParams.mjs.html +1 -1
  19. package/docs/sepDepthStartEndByDepth.mjs.html +1 -1
  20. package/docs/smoothDepthByKey.mjs.html +1 -1
  21. package/docs/w-geo.html +1 -1
  22. package/{g_5_4-getDepthMaxMin.mjs → g_4_5-calcDepthMaxMin.mjs} +7 -7
  23. package/g_5_4-buildInterpFun.mjs +46 -0
  24. package/g_8_1-dtIntrpPsdBySize.mjs +1 -1
  25. package/g_8_1-dtIntrpPsdContentIso.mjs +31 -0
  26. package/package.json +1 -1
  27. package/src/WGeo.mjs +3 -1
  28. package/src/buildInterpFun.mjs +104 -0
  29. package/src/{getDepthMaxMin.mjs → calcDepthMaxMin.mjs} +28 -28
  30. package/src/dtIntrpPsdContentIso.mjs +109 -0
  31. package/test/buildInterpFun.test.mjs +65 -0
  32. package/test/calcDepthMaxMin.test.mjs +29 -0
  33. package/test/dtIntrpPsdContentIso.test.mjs +30 -0
  34. package/test/getDepthMaxMin.test.mjs +0 -29
  35. /package/test/{getDepthMaxMin-rowsIn1.json → calcDepthMaxMin-rowsIn1.json} +0 -0
@@ -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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
65
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
236
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
325
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
350
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
569
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
7804
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
736
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
737
737
  </footer>
738
738
 
739
739
  <script>prettyPrint();</script>
@@ -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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
217
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
276
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
509
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
495
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
910
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
337
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
527
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
327
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
283
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 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:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
9661
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 09 2024 23:02:03 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
9662
9662
  </footer>
9663
9663
 
9664
9664
  <script>prettyPrint();</script>
@@ -1,6 +1,6 @@
1
1
  import fs from 'fs'
2
2
  import w from 'wsemi'
3
- import { getDepthMaxMin } from './src/getDepthMaxMin.mjs'
3
+ import { calcDepthMaxMin } from './src/calcDepthMaxMin.mjs'
4
4
 
5
5
 
6
6
  let rowsIn = [
@@ -5006,17 +5006,17 @@ let rowsIn = [
5006
5006
  { 'depth': '99.98', 'qc': '19.64615385', 'fs': '0.117846154', 'u2': '-0.602846154', 'sv': '2.126171996', 'svp': '1.145368196' }
5007
5007
  ]
5008
5008
 
5009
- //getDepthMaxMin
5010
- let mm1 = getDepthMaxMin(rowsIn, { approximate: false })
5009
+ //calcDepthMaxMin
5010
+ let mm1 = calcDepthMaxMin(rowsIn, { approximate: false })
5011
5011
  console.log(mm1)
5012
5012
  // => { depthMax: 99.98, depthMin: 0 }
5013
5013
 
5014
- //getDepthMaxMin
5015
- let mm2 = getDepthMaxMin(rowsIn, { approximate: true })
5014
+ //calcDepthMaxMin
5015
+ let mm2 = calcDepthMaxMin(rowsIn, { approximate: true })
5016
5016
  console.log(mm2)
5017
5017
  // => { depthMax: 100, depthMin: 0 }
5018
5018
 
5019
5019
  let k = 1
5020
- fs.writeFileSync(`./getDepthMaxMin-rowsIn${k}.json`, JSON.stringify(rowsIn), 'utf8')
5020
+ fs.writeFileSync(`./calcDepthMaxMin-rowsIn${k}.json`, JSON.stringify(rowsIn), 'utf8')
5021
5021
 
5022
- //node --experimental-modules g_5_4-getDepthMaxMin.mjs
5022
+ //node --experimental-modules g_4_5-calcDepthMaxMin.mjs
@@ -0,0 +1,46 @@
1
+ import fs from 'fs'
2
+ import _ from 'lodash-es'
3
+ import w from 'wsemi'
4
+ import buildInterpFun from './src/buildInterpFun.mjs'
5
+
6
+
7
+ let rows = [
8
+ {
9
+ depth: 0,
10
+ value: 1,
11
+ },
12
+ {
13
+ depth: 1,
14
+ value: 2,
15
+ },
16
+ {
17
+ depth: 3,
18
+ value: 3,
19
+ },
20
+ {
21
+ depth: 10,
22
+ value: 4,
23
+ },
24
+ ]
25
+
26
+
27
+ let fun1 = buildInterpFun(rows, 'depth', 'value')
28
+
29
+ let x1 = 0.5
30
+ let y1 = fun1(x1)
31
+ console.log(y1)
32
+ // => 1
33
+
34
+ let xs1 = [0.5, 1, 1.9, 2, 2.1]
35
+ let ys1 = fun1(xs1)
36
+ console.log(ys1)
37
+ // => [ 1, 2, 2, 2, 3 ]
38
+
39
+ let fun2 = buildInterpFun(rows, 'depth', 'value', { mode: 'linear' })
40
+
41
+ let xs2 = [0.5, 1, 1.9, 2, 2.1]
42
+ let ys2 = fun2(xs2)
43
+ console.log(ys2)
44
+ // => [ 1.5, 2, 2.45, 2.5, 2.55 ]
45
+
46
+ //node --experimental-modules g_5_4-buildInterpFun.mjs
@@ -31,7 +31,7 @@ let psizes = [
31
31
 
32
32
  let fss = dtIntrpPsdBySize(dt, psizes)
33
33
  console.log('fss', fss)
34
- // => [
34
+ // => fss [
35
35
  // { size: 630, fraction: 100 },
36
36
  // { size: 200, fraction: 100 },
37
37
  // { size: 63, fraction: 99.99999999999999 },
@@ -0,0 +1,31 @@
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 dtn = dtIntrpPsdContentIso(dt)
18
+ console.log('dtn', dtn)
19
+ // => dtn {
20
+ // 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]',
21
+ // 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]',
22
+ // ctCoarseISO: 2,
23
+ // ctGravelISO: 0,
24
+ // ctSandISO: 2,
25
+ // ctFineISO: 98,
26
+ // ctSiltISO: 72,
27
+ // ctClayISO: 26
28
+ // }
29
+
30
+
31
+ //node --experimental-modules g_8_1-dtIntrpPsdContentIso.mjs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-geo",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "main": "dist/w-geo.umd.js",
5
5
  "dependencies": {
6
6
  "decimal.js": "^10.4.3",
package/src/WGeo.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as buildInterpFun } from './buildInterpFun.mjs'
1
2
  export { default as calcClassifyUscs } from './calcClassifyUscs.mjs'
2
3
  export { default as calcCpt } from './calcCpt.mjs'
3
4
  export { default as calcCptClassify } from './calcCptClassify.mjs'
@@ -5,6 +6,7 @@ export { default as calcCptLayer } from './calcCptLayer.mjs'
5
6
  export { default as calcCptUnitWeight } from './calcCptUnitWeight.mjs'
6
7
  export { default as calcCptVelocityShear } from './calcCptVelocityShear.mjs'
7
8
  export { default as calcDepthByDepthStartEnd } from './calcDepthByDepthStartEnd.mjs'
9
+ export { default as calcDepthMaxMin } from './calcDepthMaxMin.mjs'
8
10
  export { default as calcDepthStartEndByConnect } from './calcDepthStartEndByConnect.mjs'
9
11
  export { default as calcDepthStartEndByDepth } from './calcDepthStartEndByDepth.mjs'
10
12
  export { default as calcDepthStartEndByGroup } from './calcDepthStartEndByGroup.mjs'
@@ -26,8 +28,8 @@ export { default as checkDepthStartEnd } from './checkDepthStartEnd.mjs'
26
28
  export { default as cnst } from './cnst.mjs'
27
29
  export { default as complementDepthData } from './complementDepthData.mjs'
28
30
  export { default as dtIntrpPsdBySize } from './dtIntrpPsdBySize.mjs'
31
+ export { default as dtIntrpPsdContentIso } from './dtIntrpPsdContentIso.mjs'
29
32
  export { default as getCptDepthHcOpt } from './getCptDepthHcOpt.mjs'
30
- export { default as getDepthMaxMin } from './getDepthMaxMin.mjs'
31
33
  export { default as groupByDepthStartEnd } from './groupByDepthStartEnd.mjs'
32
34
  export { default as intrpDefParam } from './intrpDefParam.mjs'
33
35
  export { default as intrpPsdBySize } from './intrpPsdBySize.mjs'
@@ -0,0 +1,104 @@
1
+ import get from 'lodash-es/get.js'
2
+ import each from 'lodash-es/each.js'
3
+ import map from 'lodash-es/map.js'
4
+ import sortBy from 'lodash-es/sortBy.js'
5
+ import isestr from 'wsemi/src/isestr.mjs'
6
+ import isnum from 'wsemi/src/isnum.mjs'
7
+ import cdbl from 'wsemi/src/cdbl.mjs'
8
+ import interp1 from 'wsemi/src/interp1.mjs'
9
+ import { calcDepthMax } from './calcDepthMaxMin.mjs'
10
+
11
+
12
+ function buildInterpFun(ltdt, keyDepth, keyTarget, opt = {}) {
13
+
14
+ //check keyDepth
15
+ if (!isestr(keyDepth)) {
16
+ throw new Error('invalid keyDepth')
17
+ }
18
+
19
+ //check keyTarget
20
+ if (!isestr(keyTarget)) {
21
+ throw new Error('invalid keyTarget')
22
+ }
23
+
24
+ //keyDepthStart
25
+ let keyDepthStart = get(opt, 'keyDepthStart')
26
+ if (!isestr(keyDepthStart)) {
27
+ keyDepthStart = 'depthStart'
28
+ }
29
+
30
+ //keyDepthEnd
31
+ let keyDepthEnd = get(opt, 'keyDepthEnd')
32
+ if (!isestr(keyDepthEnd)) {
33
+ keyDepthEnd = 'depthEnd'
34
+ }
35
+
36
+ //mode
37
+ let mode = get(opt, 'mode')
38
+ if (!isestr(mode)) {
39
+ mode = 'stairs' //每點為bar中心點向上下擴散
40
+ }
41
+
42
+ //ps, 提取數據
43
+ let ps = []
44
+ each(ltdt, (v) => {
45
+
46
+ //depth
47
+ let depth = get(v, keyDepth, null)
48
+
49
+ //tar
50
+ let tar = get(v, keyTarget, null)
51
+
52
+ //push
53
+ if (isnum(depth) && isnum(tar)) {
54
+ depth = cdbl(depth)
55
+ tar = cdbl(tar)
56
+ ps.push({
57
+ x: depth,
58
+ y: tar,
59
+ })
60
+ }
61
+
62
+ })
63
+
64
+ //sortBy
65
+ ps = sortBy(ps, 'x') //深度已變更為x
66
+ // console.log('ps', ps)
67
+
68
+ //calcDepthMax
69
+ let depthMax = calcDepthMax(ltdt, {
70
+ keyDepth,
71
+ keyDepthStart,
72
+ keyDepthEnd,
73
+ useCeil: true,
74
+ })
75
+
76
+ //optInp
77
+ let optInp = {
78
+ mode,
79
+ xMin: 0,
80
+ xMax: depthMax,
81
+ }
82
+
83
+ //interpFun, 建立階梯內插函數
84
+ let interpFun = (x) => {
85
+ let one = false
86
+ if (isnum(x)) {
87
+ one = true
88
+ x = cdbl(x)
89
+ x = [x]
90
+ }
91
+ let r = map(x, (v) => {
92
+ return interp1(ps, v, optInp)
93
+ })
94
+ if (one) {
95
+ r = r[0]
96
+ }
97
+ return r
98
+ }
99
+
100
+ return interpFun
101
+ }
102
+
103
+
104
+ export default buildInterpFun
@@ -1,13 +1,13 @@
1
- import get from 'lodash-es/get.js'
2
- import each from 'lodash-es/each.js'
3
- import isNumber from 'lodash-es/isNumber.js'
1
+ import get from 'lodash-es/get.js'
2
+ import each from 'lodash-es/each.js'
3
+ import isNumber from 'lodash-es/isNumber.js'
4
4
  import isnum from 'wsemi/src/isnum.mjs'
5
5
  import isbol from 'wsemi/src/isbol.mjs'
6
6
  import isestr from 'wsemi/src/isestr.mjs'
7
7
  import cdbl from 'wsemi/src/cdbl.mjs'
8
8
 
9
9
 
10
- function getDepthMaxCeil(depth, interval) {
10
+ function calcDepthMaxCeil(depth, interval) {
11
11
 
12
12
  //interval
13
13
  if (!isNumber(interval)) {
@@ -21,7 +21,7 @@ function getDepthMaxCeil(depth, interval) {
21
21
  }
22
22
 
23
23
 
24
- function getDepthMinFloor(depth, interval) {
24
+ function calcDepthMinFloor(depth, interval) {
25
25
 
26
26
  //interval
27
27
  if (!isNumber(interval)) {
@@ -35,7 +35,7 @@ function getDepthMinFloor(depth, interval) {
35
35
  }
36
36
 
37
37
 
38
- function getDepthMax(ltdt, opt = {}) {
38
+ function calcDepthMax(ltdt, opt = {}) {
39
39
  //取數據列最大深度
40
40
 
41
41
  //keyDepth
@@ -72,15 +72,15 @@ function getDepthMax(ltdt, opt = {}) {
72
72
  r = Math.max(r, cdbl(v[keyDepthEnd]))
73
73
  }
74
74
  if (isnum(v[keyDepth])) {
75
- r = Math.max(r, cdbl(v[keyDepth])) //cpt只有depth
75
+ r = Math.max(r, cdbl(v[keyDepth]))
76
76
  }
77
77
  })
78
78
 
79
79
  //approximate
80
80
  if (approximate) {
81
81
 
82
- //getDepthMaxCeil
83
- r = getDepthMaxCeil(r)
82
+ //calcDepthMaxCeil
83
+ r = calcDepthMaxCeil(r)
84
84
 
85
85
  }
86
86
 
@@ -88,7 +88,7 @@ function getDepthMax(ltdt, opt = {}) {
88
88
  }
89
89
 
90
90
 
91
- function getDepthMin(ltdt, opt = {}) {
91
+ function calcDepthMin(ltdt, opt = {}) {
92
92
  //取數據列最小深度
93
93
 
94
94
  //keyDepth
@@ -125,15 +125,15 @@ function getDepthMin(ltdt, opt = {}) {
125
125
  r = Math.min(r, cdbl(v[keyDepthEnd]))
126
126
  }
127
127
  if (isnum(v[keyDepth])) {
128
- r = Math.min(r, cdbl(v[keyDepth])) //cpt只有depth
128
+ r = Math.min(r, cdbl(v[keyDepth]))
129
129
  }
130
130
  })
131
131
 
132
132
  //approximate
133
133
  if (approximate) {
134
134
 
135
- //getDepthMinFloor
136
- r = getDepthMinFloor(r)
135
+ //calcDepthMinFloor
136
+ r = calcDepthMinFloor(r)
137
137
 
138
138
  }
139
139
 
@@ -141,7 +141,7 @@ function getDepthMin(ltdt, opt = {}) {
141
141
  }
142
142
 
143
143
 
144
- function getDepthMaxMin(ltdt, opt = {}) {
144
+ function calcDepthMaxMin(ltdt, opt = {}) {
145
145
 
146
146
  //keyDepth
147
147
  let keyDepth = get(opt, 'keyDepth')
@@ -167,11 +167,11 @@ function getDepthMaxMin(ltdt, opt = {}) {
167
167
  approximate = false
168
168
  }
169
169
 
170
- //getDepthMax
171
- let depthMax = getDepthMax(ltdt, opt)
170
+ //calcDepthMax
171
+ let depthMax = calcDepthMax(ltdt, opt)
172
172
 
173
- //getDepthMin
174
- let depthMin = getDepthMin(ltdt, opt)
173
+ //calcDepthMin
174
+ let depthMin = calcDepthMin(ltdt, opt)
175
175
 
176
176
  return {
177
177
  depthMax,
@@ -181,16 +181,16 @@ function getDepthMaxMin(ltdt, opt = {}) {
181
181
 
182
182
 
183
183
  export {
184
- getDepthMaxCeil,
185
- getDepthMinFloor,
186
- getDepthMax,
187
- getDepthMin,
188
- getDepthMaxMin
184
+ calcDepthMaxCeil,
185
+ calcDepthMinFloor,
186
+ calcDepthMax,
187
+ calcDepthMin,
188
+ calcDepthMaxMin
189
189
  }
190
190
  export default { //整合輸出預設得要有default
191
- getDepthMaxCeil,
192
- getDepthMinFloor,
193
- getDepthMax,
194
- getDepthMin,
195
- getDepthMaxMin
191
+ calcDepthMaxCeil,
192
+ calcDepthMinFloor,
193
+ calcDepthMax,
194
+ calcDepthMin,
195
+ calcDepthMaxMin
196
196
  }