w-geo 1.1.20 → 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.
@@ -0,0 +1,29 @@
1
+ import assert from 'assert'
2
+ import _ from 'lodash-es'
3
+ import w from 'wsemi'
4
+ import intrpPsdBySize from '../src/intrpPsdBySize.mjs'
5
+
6
+
7
+ describe(`intrpPsdBySize`, function() {
8
+
9
+ 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]
10
+ 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]
11
+ let pfss = _.map(psd, (_v, k) => {
12
+ let s = _.get(psd, k)
13
+ let f = _.get(psf, k)
14
+ return {
15
+ size: s,
16
+ fraction: f,
17
+ }
18
+ })
19
+ let psizes = 0.063
20
+ // let r = intrpPsdBySize(pfss, psizes)
21
+
22
+ let out1 = 98.4880247416152
23
+ it(`should return ${out1} when intrpPsdBySize(pfss, ${psizes})`, function() {
24
+ let r = intrpPsdBySize(pfss, psizes)
25
+ let rr = out1
26
+ assert.strict.deepStrictEqual(r, rr)
27
+ })
28
+
29
+ })