w-geo 1.1.19 → 1.1.21

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.
@@ -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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 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 01 2024 22:27:08 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 Wed May 08 2024 22:17:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
9662
9662
  </footer>
9663
9663
 
9664
9664
  <script>prettyPrint();</script>
@@ -5155,5 +5155,16 @@ fs.writeFileSync(`./calcLayersByCompress-rowsIn.json`, JSON.stringify(_rowsIn),
5155
5155
  fs.writeFileSync(`./calcLayersByCompress-rowsOut.json`, JSON.stringify(rowsOut), 'utf8')
5156
5156
  w.downloadExcelFileFromData(`./calcLayersByCompress-mat(${numMaxLayers}).xlsx`, 'data', rowsOut)
5157
5157
 
5158
+ //待加入可調整厚度陣列或起訖上下限設定
5159
+
5160
+ // 已確認要加入「最小分層厚度」之分層機制,只要小於該厚度就判斷為「薄層」,整個風場採用相同「最小分層厚度」,完成各孔分層厚,
5161
+
5162
+ // 最大層數若超過45層(暫定,強限制條件),就增加「最小分層厚度」後重跑全孔;
5163
+
5164
+ // 反之,若最大層數小於30層(暫定,弱限制條件,因為風場土層可能較為均質,雖然台灣海峽海域不太可能發生),則減小「最小分層厚度」後重跑,
5165
+
5166
+ // 另外「最小分層厚度」不宜太薄,可能須>=1.0 m(暫定,後續分析建模土層不宜過薄,強限制條件)。
5167
+
5168
+
5158
5169
 
5159
5170
  //node --experimental-modules g_6-1-calcLayersByCompress.mjs
@@ -0,0 +1,52 @@
1
+ import fs from 'fs'
2
+ import _ from 'lodash-es'
3
+ import w from 'wsemi'
4
+ import intrpPsdBySize from './src/intrpPsdBySize.mjs'
5
+
6
+
7
+ let psd = [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]
8
+ let psf = [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]
9
+ let pfss = _.map(psd, (_v, k) => {
10
+ let s = _.get(psd, k)
11
+ let f = _.get(psf, k)
12
+ return {
13
+ size: s,
14
+ fraction: f,
15
+ }
16
+ })
17
+ console.log('pfss', pfss)
18
+ // => pfss [
19
+ // { size: 101.6, fraction: 100 },
20
+ // { size: 76.2, fraction: 100 },
21
+ // { size: 50.8, fraction: 100 },
22
+ // { size: 25.4, fraction: 100 },
23
+ // { size: 19, fraction: 100 },
24
+ // { size: 9.5, fraction: 100 },
25
+ // { size: 4.75, fraction: 100 },
26
+ // { size: 2, fraction: 100 },
27
+ // { size: 0.85, fraction: 100 },
28
+ // { size: 0.425, fraction: 100 },
29
+ // { size: 0.25, fraction: 100 },
30
+ // { size: 0.15, fraction: -1 },
31
+ // { size: 0.106, fraction: 100 },
32
+ // { size: 0.075, fraction: 99 },
33
+ // { size: 0.027, fraction: 96 },
34
+ // { size: 0.018, fraction: 86 },
35
+ // { size: 0.011, fraction: 74 },
36
+ // { size: 0.008, fraction: 61 },
37
+ // { size: 0.006, fraction: 51 },
38
+ // { size: 0.003, fraction: 32 },
39
+ // { size: 0.001, fraction: 16 },
40
+ // { size: 0, fraction: 0 },
41
+ // { size: 0, fraction: 0 },
42
+ // { size: 0, fraction: 0 }
43
+ // ]
44
+
45
+ let psizes = 0.063
46
+
47
+ let r = intrpPsdBySize(pfss, psizes)
48
+ console.log(r)
49
+ // => 98.4880247416152
50
+
51
+
52
+ //node --experimental-modules g_7_1-intrpPsdBySize.mjs
@@ -105,4 +105,4 @@ await w.pmSeries(ms, async (m, i) => {
105
105
 
106
106
  })
107
107
 
108
- //node --experimental-modules g_7_9-calcPropInterfaceFrictionAngle.mjs
108
+ //node --experimental-modules g_7_a1-calcPropInterfaceFrictionAngle.mjs
@@ -0,0 +1,50 @@
1
+ import fs from 'fs'
2
+ import _ from 'lodash-es'
3
+ import w from 'wsemi'
4
+ import dtIntrpPsdBySize from './src/dtIntrpPsdBySize.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 fss = dtIntrpPsdBySize(dt, psizes)
33
+ console.log('fss', fss)
34
+ // => [
35
+ // { size: 630, fraction: 100 },
36
+ // { size: 200, fraction: 100 },
37
+ // { size: 63, fraction: 99.99999999999999 },
38
+ // { size: 20, fraction: 99.99999999999999 },
39
+ // { size: 6.3, fraction: 100.00000000000001 },
40
+ // { size: 2, fraction: 100 },
41
+ // { size: 0.63, fraction: 100.00000000000001 },
42
+ // { size: 0.2, fraction: 100 },
43
+ // { size: 0.063, fraction: 98.4880247416152 },
44
+ // { size: 0.02, fraction: 88.59851004564663 },
45
+ // { size: 0.0063, fraction: 52.69597513510718 },
46
+ // { size: 0.002, fraction: 26.094876057143324 }
47
+ // ]
48
+
49
+
50
+ //node --experimental-modules g_8_1-dtIntrpPsdBySize.mjs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-geo",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "main": "dist/w-geo.umd.js",
5
5
  "dependencies": {
6
6
  "decimal.js": "^10.4.3",
package/src/WGeo.mjs CHANGED
@@ -25,10 +25,12 @@ export { default as checkDepth } from './checkDepth.mjs'
25
25
  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
+ export { default as dtIntrpPsdBySize } from './dtIntrpPsdBySize.mjs'
28
29
  export { default as getCptDepthHcOpt } from './getCptDepthHcOpt.mjs'
29
30
  export { default as getDepthMaxMin } from './getDepthMaxMin.mjs'
30
31
  export { default as groupByDepthStartEnd } from './groupByDepthStartEnd.mjs'
31
32
  export { default as intrpDefParam } from './intrpDefParam.mjs'
33
+ export { default as intrpPsdBySize } from './intrpPsdBySize.mjs'
32
34
  export { default as judge } from './judge.mjs'
33
35
  export { default as mergeByDepthStartEnd } from './mergeByDepthStartEnd.mjs'
34
36
  export { default as relaPlasticityParams } from './relaPlasticityParams.mjs'
@@ -10,6 +10,7 @@ import isnum from 'wsemi/src/isnum.mjs'
10
10
  import iseobj from 'wsemi/src/iseobj.mjs'
11
11
  import isbol from 'wsemi/src/isbol.mjs'
12
12
  import ispint from 'wsemi/src/ispint.mjs'
13
+ import isearr from 'wsemi/src/isearr.mjs'
13
14
  import cdbl from 'wsemi/src/cdbl.mjs'
14
15
  import cstr from 'wsemi/src/cstr.mjs'
15
16
  import arrSort from 'wsemi/src/arrSort.mjs'
@@ -66,6 +67,53 @@ function calcLayersByCompress(ltdt, opt = {}) {
66
67
  //keyMgValueIcn
67
68
  let keyMgValueIcn = get(opt, 'keyMgValueIcn', 'Icn')
68
69
 
70
+ //levelsForThicknessMax
71
+ let levelsForThicknessMax = get(opt, 'levelsForThicknessMax', [])
72
+ if (!isearr(levelsForThicknessMax)) {
73
+ levelsForThicknessMax = [
74
+ 0.0201,
75
+ 0.0401,
76
+ 0.0601,
77
+ 0.0801,
78
+ 0.1001,
79
+ 0.1251,
80
+ 0.1501,
81
+ 0.1751,
82
+ 0.2001,
83
+ 0.2501,
84
+ 0.3001,
85
+ 0.3501,
86
+ 0.4001,
87
+ 0.4501,
88
+ 0.5001,
89
+ 0.7501,
90
+ 1.0001,
91
+ 1.5001,
92
+ 2.0001,
93
+ 3.0001,
94
+ 4.0001,
95
+ 5.0001,
96
+ // 6.0001,
97
+ // 7.0001,
98
+ // 8.0001,
99
+ // 9.0001,
100
+ // 10.0001,
101
+ ]
102
+ }
103
+
104
+ //levelsForMgValueIcnDiffMax
105
+ let levelsForMgValueIcnDiffMax = get(opt, 'levelsForMgValueIcnDiffMax', [])
106
+ if (!isearr(levelsForMgValueIcnDiffMax)) {
107
+ levelsForMgValueIcnDiffMax = [
108
+ 0.20,
109
+ 0.25,
110
+ 0.30,
111
+ // 0.35,
112
+ // 0.40,
113
+ // 0.50,
114
+ ]
115
+ }
116
+
69
117
  //saveFromInds
70
118
  let saveFromInds = get(opt, 'saveFromInds')
71
119
  if (!isbol(saveFromInds)) {
@@ -537,45 +585,10 @@ function calcLayersByCompress(ltdt, opt = {}) {
537
585
  if (true) {
538
586
 
539
587
  //_thicknessMax
540
- let _thicknessMax = [
541
- 0.0201,
542
- 0.0401,
543
- 0.0601,
544
- 0.0801,
545
- 0.1001,
546
- 0.1251,
547
- 0.1501,
548
- 0.1751,
549
- 0.2001,
550
- 0.2501,
551
- 0.3001,
552
- 0.3501,
553
- 0.4001,
554
- 0.4501,
555
- 0.5001,
556
- 0.7501,
557
- 1.0001,
558
- 1.5001,
559
- 2.0001,
560
- 3.0001,
561
- 4.0001,
562
- 5.0001,
563
- // 6.0001,
564
- // 7.0001,
565
- // 8.0001,
566
- // 9.0001,
567
- // 10.0001,
568
- ]
588
+ let _thicknessMax = levelsForThicknessMax
569
589
 
570
590
  //_mgValueIcnDiffMax
571
- let _mgValueIcnDiffMax = [
572
- 0.20,
573
- 0.25,
574
- 0.30,
575
- // 0.35,
576
- // 0.40,
577
- // 0.50,
578
- ]
591
+ let _mgValueIcnDiffMax = levelsForMgValueIcnDiffMax
579
592
 
580
593
  //ss
581
594
  let ss = []
@@ -0,0 +1,137 @@
1
+ import each from 'lodash-es/each.js'
2
+ import map from 'lodash-es/map.js'
3
+ import get from 'lodash-es/get.js'
4
+ import j2o from 'wsemi/src/j2o.mjs'
5
+ import isearr from 'wsemi/src/isearr.mjs'
6
+ import isestr from 'wsemi/src/isestr.mjs'
7
+ import isnum from 'wsemi/src/isnum.mjs'
8
+ import cdbl from 'wsemi/src/cdbl.mjs'
9
+ import intrpPsdBySize from './intrpPsdBySize.mjs'
10
+
11
+
12
+ //parseStrArray
13
+ let parseStrArray = (c) => {
14
+ let r = j2o(c)
15
+ if (!isearr(r)) {
16
+ console.log('c', c)
17
+ throw new Error('無法解析JSON字串型陣列')
18
+ }
19
+ return r
20
+ }
21
+
22
+
23
+ function dtIntrpPsdBySize(dt, psizes, opt = {}) {
24
+
25
+ //keySize
26
+ let keySize = get(opt, 'keySize', '')
27
+ if (!isestr(keySize)) {
28
+ keySize = 'size'
29
+ }
30
+
31
+ //keyFraction
32
+ let keyFraction = get(opt, 'keyFraction', '')
33
+ if (!isestr(keyFraction)) {
34
+ keyFraction = 'fraction'
35
+ }
36
+
37
+ //GSD
38
+ let GSD = get(dt, 'GSD', '')
39
+ if (!isestr(GSD) && !isearr(GSD)) {
40
+ throw new Error('invalid GSD')
41
+ }
42
+ if (isestr(GSD)) {
43
+ GSD = parseStrArray(GSD)
44
+ }
45
+ // console.log('GSD', GSD)
46
+
47
+ //GSP
48
+ let GSP = get(dt, 'GSP', '')
49
+ if (!isestr(GSP) && !isearr(GSP)) {
50
+ throw new Error('invalid GSP')
51
+ }
52
+ if (isestr(GSP)) {
53
+ GSP = parseStrArray(GSP)
54
+ }
55
+ // console.log('GSP', GSP)
56
+
57
+ //psizes
58
+ if (!isearr(psizes)) {
59
+ //ASTM
60
+ psizes = [
61
+ 101.6,
62
+ 76.2,
63
+ 50.8,
64
+ 25.4,
65
+ 19.0,
66
+ 9.5,
67
+ 4.75,
68
+ 2.0,
69
+ 0.85,
70
+ 0.425,
71
+ 0.25,
72
+ 0.15,
73
+ 0.106,
74
+ 0.075,
75
+ 0.034,
76
+ 0.022,
77
+ 0.013,
78
+ 0.009,
79
+ 0.007,
80
+ 0.003,
81
+ 0.001,
82
+ ]
83
+ // //ISO
84
+ // psizes = [
85
+ // 630,
86
+ // 200,
87
+ // 63,
88
+ // 20,
89
+ // 6.3,
90
+ // 2,
91
+ // 0.63,
92
+ // 0.2,
93
+ // 0.063,
94
+ // 0.02,
95
+ // 0.0063,
96
+ // 0.002,
97
+ // ]
98
+ }
99
+
100
+ //fss
101
+ let fss = []
102
+ each(GSD, (_v, k) => {
103
+ let size = get(GSD, k, '')
104
+ if (!isnum(size)) {
105
+ console.log(k, 'size', size)
106
+ throw new Error(`size[${size}] is not an effective number`)
107
+ }
108
+ size = cdbl(size)
109
+ let fraction = get(GSP, k, '')
110
+ if (!isnum(fraction)) {
111
+ console.log(k, 'fraction', fraction)
112
+ throw new Error(`fraction[${fraction}] is not an effective number`)
113
+ }
114
+ fraction = cdbl(fraction)
115
+ fss.push({
116
+ [keySize]: size,
117
+ [keyFraction]: fraction,
118
+ })
119
+ })
120
+ // console.log('fss', fss)
121
+
122
+ //重算各size處之通過百分比
123
+ let rs = intrpPsdBySize(fss, psizes, { keySize, keyFraction })
124
+ rs = map(rs, (fraction, k) => {
125
+ let size = get(psizes, k)
126
+ return {
127
+ [keySize]: size,
128
+ [keyFraction]: fraction,
129
+ }
130
+ })
131
+ // console.log('rs', rs)
132
+
133
+ return rs
134
+ }
135
+
136
+
137
+ export default dtIntrpPsdBySize