mirror of
https://github.com/netbymatt/nexrad-level-2-plot.git
synced 2026-11-28 18:28:05 -08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a1f29cfae | ||
|
|
8b244a41a6 | ||
|
|
97b07611e8 | ||
|
|
d108e96cea | ||
|
|
ba885085d2 | ||
|
|
2b6e0ba3fd | ||
|
|
347c530edd |
No files matched your search
@@ -1 +1,2 @@
|
||||
node_modules
|
||||
*.cpuprofile
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"words": [
|
||||
"nexrad",
|
||||
"KSRX",
|
||||
"TORD",
|
||||
"palettizing",
|
||||
"tdwr"
|
||||
]
|
||||
}
|
||||
Vendored
+2
-1
@@ -11,7 +11,8 @@
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${workspaceFolder}/demos/test.js"
|
||||
"program": "${workspaceFolder}/demos/test.js",
|
||||
"outputCapture": "std",
|
||||
},
|
||||
{
|
||||
"type": "pwa-node",
|
||||
|
||||
+5
-2
@@ -22,7 +22,7 @@ files.forEach((file) => {
|
||||
const radarData = Level2Radar.combineData(chunks);
|
||||
|
||||
const size = 1800;
|
||||
const iterations = 10;
|
||||
const iterations = 5;
|
||||
|
||||
// plot for each elevation and size
|
||||
(async () => {
|
||||
@@ -32,11 +32,14 @@ const iterations = 10;
|
||||
size,
|
||||
palettize: true,
|
||||
cropTo: size / 2,
|
||||
alpha: false,
|
||||
imageSmoothingEnabled: false,
|
||||
antialias: 'none',
|
||||
});
|
||||
|
||||
// write files to disk
|
||||
const writePromises = [];
|
||||
plots.forEach((p) => {
|
||||
(await plots).forEach((p) => {
|
||||
const { elevation } = p;
|
||||
writePromises.push(writePngToFile(`./output/REF-${elevation}-${size}.png`, p.REF));
|
||||
writePromises.push(writePngToFile(`./output/VEL-${elevation}-${size}.png`, p.VEL));
|
||||
|
||||
+2
-1
@@ -43,10 +43,11 @@ if (single) {
|
||||
// plot for each elevation and size
|
||||
(async () => {
|
||||
await Promise.allSettled(sizes.map(async (size) => {
|
||||
const plots = plot(radarData, ['REF', 'VEL'], {
|
||||
const plots = await plot(radarData, ['REF', 'VEL'], {
|
||||
elevations,
|
||||
size,
|
||||
palettize: true,
|
||||
elevations: 1,
|
||||
cropTo: size / 2,
|
||||
});
|
||||
|
||||
|
||||
Generated
+235
-83
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"name": "nexrad-level-2-plot",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nexrad-level-2-plot",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"canvas": "^2.9.1",
|
||||
"nexrad-level-2-data": "^2.3.5"
|
||||
"canvas": "^2.9.3",
|
||||
"nexrad-level-2-data": "../nexrad-level-2-data",
|
||||
"piscina": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.0.0",
|
||||
@@ -22,6 +23,33 @@
|
||||
"node": ">=13.0.0"
|
||||
}
|
||||
},
|
||||
"../nexrad-level-2-data": {
|
||||
"version": "2.4.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"seek-bzip": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jsdoc": "^39.1.0",
|
||||
"glob": "^8.0.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-jsdoc3": "^3.0.0",
|
||||
"jsdoc": "^3.6.10",
|
||||
"jsdoc-to-markdown": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=13.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@assemblyscript/loader": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
|
||||
"integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg=="
|
||||
},
|
||||
"node_modules/@eslint/eslintrc": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz",
|
||||
@@ -242,6 +270,25 @@
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -274,9 +321,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/canvas": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/canvas/-/canvas-2.9.1.tgz",
|
||||
"integrity": "sha512-vSQti1uG/2gjv3x6QLOZw7TctfufaerTWbVe+NSduHxxLGB+qf3kFgQ6n66DSnuoINtVUjrLLIK2R+lxrBG07A==",
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/canvas/-/canvas-2.9.3.tgz",
|
||||
"integrity": "sha512-WOUM7ghii5TV2rbhaZkh1youv/vW1/Canev6Yx6BG2W+1S07w8jKZqKkPnbiPpQEDsnJdN8ouDd7OvQEGXDcUw==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.0",
|
||||
@@ -337,14 +384,6 @@
|
||||
"color-support": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
|
||||
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
@@ -359,7 +398,7 @@
|
||||
"node_modules/console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
@@ -427,7 +466,7 @@
|
||||
"node_modules/delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.0.1",
|
||||
@@ -800,6 +839,11 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter-asyncresource": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz",
|
||||
"integrity": "sha512-39F7TBIV0G7gTelxwbEqnwhp90eqCPON1k0NwNfwhgKn4Co4ybUbj2pECcXT0B3ztRKZ7Pw1JujUUgmQJHcVAQ=="
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -1083,7 +1127,22 @@
|
||||
"node_modules/has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="
|
||||
},
|
||||
"node_modules/hdr-histogram-js": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-2.0.3.tgz",
|
||||
"integrity": "sha512-Hkn78wwzWHNCp2uarhzQ2SGFLU3JY8SBDDd3TAABK4fc30wm+MuPOrg5QVFVfkKOQd6Bfz3ukJEI+q9sXEkK1g==",
|
||||
"dependencies": {
|
||||
"@assemblyscript/loader": "^0.10.1",
|
||||
"base64-js": "^1.2.0",
|
||||
"pako": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/hdr-histogram-percentiles-obj": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz",
|
||||
"integrity": "sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw=="
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
@@ -1480,9 +1539,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/minipass": {
|
||||
"version": "3.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz",
|
||||
"integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz",
|
||||
"integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
@@ -1519,9 +1578,9 @@
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"node_modules/nan": {
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
|
||||
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
|
||||
"version": "2.16.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz",
|
||||
"integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA=="
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
@@ -1530,16 +1589,29 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/nexrad-level-2-data": {
|
||||
"version": "2.3.5",
|
||||
"resolved": "https://registry.npmjs.org/nexrad-level-2-data/-/nexrad-level-2-data-2.3.5.tgz",
|
||||
"integrity": "sha512-WpTQ7KiDBLi2etWpNhl4g989pqX9IMyCi9sZ31g40SFyj5TSPTdqVK2VuaiopSEi/OqmlYn+suBha9I/cvqbsw==",
|
||||
"resolved": "../nexrad-level-2-data",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/nice-napi": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
|
||||
"integrity": "sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==",
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"!win32"
|
||||
],
|
||||
"dependencies": {
|
||||
"seek-bzip": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=13.0.0"
|
||||
"node-addon-api": "^3.0.0",
|
||||
"node-gyp-build": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/node-addon-api": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
@@ -1559,6 +1631,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp-build": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz",
|
||||
"integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==",
|
||||
"optional": true,
|
||||
"bin": {
|
||||
"node-gyp-build": "bin.js",
|
||||
"node-gyp-build-optional": "optional.js",
|
||||
"node-gyp-build-test": "build-test.js"
|
||||
}
|
||||
},
|
||||
"node_modules/nopt": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
|
||||
@@ -1587,7 +1670,7 @@
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@@ -1717,6 +1800,11 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"node_modules/parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
@@ -1761,6 +1849,19 @@
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/piscina": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/piscina/-/piscina-3.2.0.tgz",
|
||||
"integrity": "sha512-yn/jMdHRw+q2ZJhFhyqsmANcbF6V2QwmD84c6xRau+QpQOmtrBCoRGdvTfeuFDYXB5W2m6MfLkjkvQa9lUSmIA==",
|
||||
"dependencies": {
|
||||
"eventemitter-asyncresource": "^1.0.0",
|
||||
"hdr-histogram-js": "^2.0.1",
|
||||
"hdr-histogram-percentiles-obj": "^3.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"nice-napi": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
@@ -1880,18 +1981,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/seek-bzip": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-2.0.0.tgz",
|
||||
"integrity": "sha512-SMguiTnYrhpLdk3PwfzHeotrcwi8bNV4iemL9tx9poR/yeaMYwB9VzR1w7b57DuWpuqR8n6oZboi0hj3AxZxQg==",
|
||||
"dependencies": {
|
||||
"commander": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"seek-bunzip": "bin/seek-bunzip",
|
||||
"seek-table": "bin/seek-bzip-table"
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
@@ -1903,7 +1992,7 @@
|
||||
"node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
|
||||
},
|
||||
"node_modules/shebang-command": {
|
||||
"version": "2.0.0",
|
||||
@@ -2104,7 +2193,7 @@
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"node_modules/tsconfig-paths": {
|
||||
"version": "3.14.1",
|
||||
@@ -2169,7 +2258,7 @@
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"node_modules/v8-compile-cache": {
|
||||
"version": "2.3.0",
|
||||
@@ -2180,12 +2269,12 @@
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
@@ -2251,6 +2340,11 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@assemblyscript/loader": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
|
||||
"integrity": "sha512-H71nDOOL8Y7kWRLqf6Sums+01Q5msqBW2KhDUTemh1tvY04eSkSXrK0uj/4mmY0Xr16/3zyZmsrxN7CKuRbNRg=="
|
||||
},
|
||||
"@eslint/eslintrc": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz",
|
||||
@@ -2419,6 +2513,11 @@
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
@@ -2445,9 +2544,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"canvas": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/canvas/-/canvas-2.9.1.tgz",
|
||||
"integrity": "sha512-vSQti1uG/2gjv3x6QLOZw7TctfufaerTWbVe+NSduHxxLGB+qf3kFgQ6n66DSnuoINtVUjrLLIK2R+lxrBG07A==",
|
||||
"version": "2.9.3",
|
||||
"resolved": "https://registry.npmjs.org/canvas/-/canvas-2.9.3.tgz",
|
||||
"integrity": "sha512-WOUM7ghii5TV2rbhaZkh1youv/vW1/Canev6Yx6BG2W+1S07w8jKZqKkPnbiPpQEDsnJdN8ouDd7OvQEGXDcUw==",
|
||||
"requires": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.0",
|
||||
"nan": "^2.15.0",
|
||||
@@ -2489,11 +2588,6 @@
|
||||
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
|
||||
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="
|
||||
},
|
||||
"commander": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
|
||||
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA=="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
@@ -2508,7 +2602,7 @@
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
@@ -2556,7 +2650,7 @@
|
||||
"delegates": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
|
||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "2.0.1",
|
||||
@@ -2852,6 +2946,11 @@
|
||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true
|
||||
},
|
||||
"eventemitter-asyncresource": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz",
|
||||
"integrity": "sha512-39F7TBIV0G7gTelxwbEqnwhp90eqCPON1k0NwNfwhgKn4Co4ybUbj2pECcXT0B3ztRKZ7Pw1JujUUgmQJHcVAQ=="
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -3063,7 +3162,22 @@
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="
|
||||
},
|
||||
"hdr-histogram-js": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/hdr-histogram-js/-/hdr-histogram-js-2.0.3.tgz",
|
||||
"integrity": "sha512-Hkn78wwzWHNCp2uarhzQ2SGFLU3JY8SBDDd3TAABK4fc30wm+MuPOrg5QVFVfkKOQd6Bfz3ukJEI+q9sXEkK1g==",
|
||||
"requires": {
|
||||
"@assemblyscript/loader": "^0.10.1",
|
||||
"base64-js": "^1.2.0",
|
||||
"pako": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"hdr-histogram-percentiles-obj": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz",
|
||||
"integrity": "sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw=="
|
||||
},
|
||||
"https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
@@ -3343,9 +3457,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "3.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz",
|
||||
"integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==",
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz",
|
||||
"integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==",
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
@@ -3370,9 +3484,9 @@
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
|
||||
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
|
||||
"version": "2.16.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz",
|
||||
"integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA=="
|
||||
},
|
||||
"natural-compare": {
|
||||
"version": "1.4.0",
|
||||
@@ -3381,13 +3495,37 @@
|
||||
"dev": true
|
||||
},
|
||||
"nexrad-level-2-data": {
|
||||
"version": "2.3.5",
|
||||
"resolved": "https://registry.npmjs.org/nexrad-level-2-data/-/nexrad-level-2-data-2.3.5.tgz",
|
||||
"integrity": "sha512-WpTQ7KiDBLi2etWpNhl4g989pqX9IMyCi9sZ31g40SFyj5TSPTdqVK2VuaiopSEi/OqmlYn+suBha9I/cvqbsw==",
|
||||
"version": "file:../nexrad-level-2-data",
|
||||
"requires": {
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jsdoc": "^39.1.0",
|
||||
"glob": "^8.0.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-jsdoc3": "^3.0.0",
|
||||
"jsdoc": "^3.6.10",
|
||||
"jsdoc-to-markdown": "^7.1.1",
|
||||
"seek-bzip": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"nice-napi": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
|
||||
"integrity": "sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"node-addon-api": "^3.0.0",
|
||||
"node-gyp-build": "^4.2.2"
|
||||
}
|
||||
},
|
||||
"node-addon-api": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
|
||||
"optional": true
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
@@ -3396,6 +3534,12 @@
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node-gyp-build": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz",
|
||||
"integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==",
|
||||
"optional": true
|
||||
},
|
||||
"nopt": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
|
||||
@@ -3418,7 +3562,7 @@
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
|
||||
},
|
||||
"object-inspect": {
|
||||
"version": "1.12.0",
|
||||
@@ -3512,6 +3656,11 @@
|
||||
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
|
||||
"dev": true
|
||||
},
|
||||
"pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
@@ -3544,6 +3693,17 @@
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"piscina": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/piscina/-/piscina-3.2.0.tgz",
|
||||
"integrity": "sha512-yn/jMdHRw+q2ZJhFhyqsmANcbF6V2QwmD84c6xRau+QpQOmtrBCoRGdvTfeuFDYXB5W2m6MfLkjkvQa9lUSmIA==",
|
||||
"requires": {
|
||||
"eventemitter-asyncresource": "^1.0.0",
|
||||
"hdr-histogram-js": "^2.0.1",
|
||||
"hdr-histogram-percentiles-obj": "^3.0.0",
|
||||
"nice-napi": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
@@ -3613,14 +3773,6 @@
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||
},
|
||||
"seek-bzip": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-2.0.0.tgz",
|
||||
"integrity": "sha512-SMguiTnYrhpLdk3PwfzHeotrcwi8bNV4iemL9tx9poR/yeaMYwB9VzR1w7b57DuWpuqR8n6oZboi0hj3AxZxQg==",
|
||||
"requires": {
|
||||
"commander": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
@@ -3629,7 +3781,7 @@
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "2.0.0",
|
||||
@@ -3774,7 +3926,7 @@
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"tsconfig-paths": {
|
||||
"version": "3.14.1",
|
||||
@@ -3827,7 +3979,7 @@
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"v8-compile-cache": {
|
||||
"version": "2.3.0",
|
||||
@@ -3838,12 +3990,12 @@
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nexrad-level-2-plot",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.2",
|
||||
"description": "Plotting library for nexrad-level-2-data",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
@@ -24,8 +24,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/netbymatt/nexrad-level-2-plot#readme",
|
||||
"dependencies": {
|
||||
"canvas": "^2.9.1",
|
||||
"nexrad-level-2-data": "^2.3.5"
|
||||
"canvas": "^2.9.3",
|
||||
"nexrad-level-2-data": "../nexrad-level-2-data",
|
||||
"piscina": "^3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.0.0",
|
||||
|
||||
+14
-14
@@ -146,20 +146,20 @@ const draw = (data, _options) => {
|
||||
|
||||
// plot each bin
|
||||
radial.moment_data.forEach((bin, idx) => {
|
||||
if (bin !== null) {
|
||||
ctx.beginPath();
|
||||
// different methods for rrle encoded or not
|
||||
if (bin.count) {
|
||||
// rrle encoded
|
||||
ctx.strokeStyle = palette.lookupRgba[bin.value];
|
||||
ctx.arc(0, 0, (idx + deadZone) * gateSizeScaling, startAngle, endAngle + resolution * (bin.count - 1));
|
||||
} else {
|
||||
// plain data
|
||||
ctx.strokeStyle = palette.lookupRgba[bin];
|
||||
ctx.arc(0, 0, (idx + deadZone) * gateSizeScaling, startAngle, endAngle);
|
||||
}
|
||||
ctx.stroke();
|
||||
if (bin === null) return;
|
||||
|
||||
ctx.beginPath();
|
||||
// different methods for rrle encoded or not
|
||||
if (bin.count) {
|
||||
// rrle encoded
|
||||
ctx.strokeStyle = palette.lookupRgba[bin.value];
|
||||
ctx.arc(0, 0, (idx + deadZone) * gateSizeScaling, startAngle, endAngle + resolution * (bin.count - 1));
|
||||
} else {
|
||||
// plain data
|
||||
ctx.strokeStyle = palette.lookupRgba[bin];
|
||||
ctx.arc(0, 0, (idx + deadZone) * gateSizeScaling, startAngle, endAngle);
|
||||
}
|
||||
ctx.stroke();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -171,7 +171,7 @@ const draw = (data, _options) => {
|
||||
}
|
||||
|
||||
// palettize image
|
||||
const palettized = palettizeImage(canvas.getContext('2d'), palette);
|
||||
const palettized = palettizeImage(ctx, palette);
|
||||
|
||||
// return palettized image
|
||||
return {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];
|
||||
@@ -4,6 +4,8 @@
|
||||
// this ensures that the colors are not blended because the index should be returned in the a position
|
||||
// after the entire image is drawn the index information must be shifted from g to a
|
||||
|
||||
const hexLookup = require('./hexlookup');
|
||||
|
||||
const rgbaLookupSize = 200;
|
||||
|
||||
class Palette {
|
||||
@@ -59,7 +61,8 @@ class Palette {
|
||||
// short circuit for transparent (black)
|
||||
if (match[0] <= 2 && match[1] <= 2 && match[2] <= 2) return this.transparentIndex;
|
||||
// short circuit previously calculated matches
|
||||
const asHex = match[0].toString(16).padStart(2, '0') + match[1].toString(16).padStart(2, '0') + match[2].toString(16).padStart(2, '0');
|
||||
const asHex = hexLookup[match[0]] + hexLookup[match[1]] + hexLookup[match[2]];
|
||||
// const asHex = match[0].toString(16).padStart(2, '0') + match[1].toString(16).padStart(2, '0') + match[2].toString(16).padStart(2, '0');
|
||||
if (this.closest[asHex]) return this.closest[asHex];
|
||||
// initial conditions
|
||||
let closestIndex = 0;
|
||||
@@ -80,6 +83,7 @@ class Palette {
|
||||
}
|
||||
|
||||
// geometric distance
|
||||
// square root is intentionally not taken for performance reasons
|
||||
static geometricDistance(a, b) {
|
||||
return a.reduce((acc, val, idx) => acc + (val - b[idx]) ** 2, 0);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
const findTotalMatches = (radials, startI, binIdx, resolutionThreshold) => {
|
||||
// get the target value
|
||||
const target = radials[startI].moment_data[binIdx];
|
||||
// check for null
|
||||
if (target === null) return false;
|
||||
|
||||
// start a counter for matches
|
||||
let count = 1;
|
||||
@@ -23,7 +21,7 @@ const findTotalMatches = (radials, startI, binIdx, resolutionThreshold) => {
|
||||
// end condition is the number of radials available
|
||||
// a radial not within the resolution threshold
|
||||
// or the binIdx under test not present in one of the next radials
|
||||
while (nextI < radials.length && checkNext) {
|
||||
while (checkNext && nextI < radials.length) {
|
||||
// reset flag
|
||||
checkNext = false;
|
||||
const nextAzimuth = radials[nextI].azimuth;
|
||||
@@ -60,13 +58,14 @@ const rrle = (radials, resolutionRad) => {
|
||||
|
||||
// look at each bin on the radial
|
||||
radial.moment_data.forEach((bin, binIdx) => {
|
||||
if (radials[i].moment_data[binIdx] === null) return;
|
||||
const totalMatches = findTotalMatches(radials, i, binIdx, resolutionThreshold);
|
||||
// if a total match was found update the bin data and null out the remaining bins in the run
|
||||
if (totalMatches) {
|
||||
radial.moment_data[binIdx] = { value: bin, count: totalMatches };
|
||||
for (let clearI = i + 1; clearI <= i + totalMatches - 1; clearI += 1) {
|
||||
sorted[clearI].moment_data[binIdx] = null;
|
||||
}
|
||||
if (!totalMatches) return;
|
||||
radial.moment_data[binIdx] = { value: bin, count: totalMatches };
|
||||
const loopEnd = i + totalMatches - 1;
|
||||
for (let clearI = i + 1; clearI <= loopEnd; clearI += 1) {
|
||||
sorted[clearI].moment_data[binIdx] = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
const { Level2Radar } = require('nexrad-level-2-data');
|
||||
const { workerData } = require('piscina');
|
||||
const { draw } = require('./index');
|
||||
|
||||
module.exports = (options) => {
|
||||
const level2Radar = Level2Radar(workerData);
|
||||
const plot = draw(level2Radar, options);
|
||||
return plot;
|
||||
};
|
||||
+17
-12
@@ -1,5 +1,8 @@
|
||||
const { draw, canvas } = require('./draw');
|
||||
const { Piscina } = require('piscina');
|
||||
const path = require('path');
|
||||
const { canvas } = require('./draw');
|
||||
const { writePngToFile } = require('./utils/file');
|
||||
|
||||
/**
|
||||
* Plot level 2 data
|
||||
* @param {Level2Data} data output from the nexrad-level-2-data library
|
||||
@@ -17,10 +20,7 @@ const { writePngToFile } = require('./utils/file');
|
||||
* @param {string} [options.antialias = 'default'] Control antialias. Passed directly to ctx.antialias (part of node-canvas)
|
||||
* @returns Canvas
|
||||
*/
|
||||
const plot = (data, _products, options) => {
|
||||
// store result
|
||||
const result = [];
|
||||
|
||||
const plot = async (data, _products, options) => {
|
||||
let products;
|
||||
// make product list into an array
|
||||
if (_products && Array.isArray(_products)) {
|
||||
@@ -41,19 +41,24 @@ const plot = (data, _products, options) => {
|
||||
if (!elevations) elevations = availableElevations;
|
||||
if (typeof elevations === 'number') elevations = [elevations];
|
||||
|
||||
elevations.forEach((elevation) => {
|
||||
const staticPool = new Piscina({
|
||||
filename: path.resolve(__dirname, './draw/thread.js'),
|
||||
workerData: data.toObject(),
|
||||
});
|
||||
|
||||
const result = await Promise.all(elevations.map(async (elevation) => {
|
||||
const elevationResult = { elevation };
|
||||
products.forEach((product) => {
|
||||
await Promise.all(products.map(async (product) => {
|
||||
// parse and store result
|
||||
elevationResult[product] = draw(data, {
|
||||
elevationResult[product] = await staticPool.run({
|
||||
...options,
|
||||
elevation,
|
||||
product,
|
||||
});
|
||||
});
|
||||
result.push(elevationResult);
|
||||
});
|
||||
|
||||
}));
|
||||
return elevationResult;
|
||||
}));
|
||||
staticPool.destroy();
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user