brighter ref palette

This commit is contained in:
Matt Walsh committed 2026-08-20 22:53:01 -05:00
1 parent cc1515cff3
commit 61550bf47c
4 files changed
+52 -58

No files matched your search

Binary file not shown.
+5 -4
View File
@@ -11,11 +11,11 @@ import { plot, writePngToFile } from '../src/index.mjs';
// const files = glob.sync('./data/KLOT/34/*');
// const files = glob.sync('./data/KLOT/381/*');
// const files = glob.sync('./data/KLOT/548/*');
const files = await glob.sync('./data/KLOT/940/*');
// const files = await glob.sync('./data/KLOT/940/*');
// const files = glob.sync('./data/KSRX/804/*');
// const files = glob.sync('./data/TORD/168/*');
// const files = glob.sync('./data/KLOT/KLOT20210812_171451_V*'); // ref palette tuning
// const files = glob.sync('./data/KLOT/KLOT20210621_041151_V06'); // vel palette tuning
const files = glob.sync('./data/KLOT/KLOT20210621_041151_V06'); // vel palette tuning
// const store each file's data
const chunks = [];
@@ -33,7 +33,7 @@ const radarData = Level2Radar.combineData(chunks);
// default to all plots unless single is specificed
const single = process.argv.includes('single');
let sizes = [1800];
let sizes = [3200];
let elevations = radarData.listElevations();
if (single) {
sizes = sizes.slice(0, 1);
@@ -46,7 +46,7 @@ if (single) {
// plot for each elevation and size
console.time('processing');
await Promise.allSettled(sizes.map(async (size) => {
const plots = plot(radarData, ['REF', 'VEL'], {
const plots = plot(radarData, ['REF', 'VEL', 'RHO'], {
elevations,
size,
palettize: true,
@@ -61,6 +61,7 @@ await Promise.allSettled(sizes.map(async (size) => {
const { elevation } = p;
writePromises.push(writePngToFile(`./output/REF-${elevation}-${size}.png`, p.REF));
writePromises.push(writePngToFile(`./output/VEL-${elevation}-${size}.png`, p.VEL));
writePromises.push(writePngToFile(`./output/RHO-${elevation}-${size}.png`, p.RHO));
});
await Promise.allSettled(writePromises);
}));
+21 -29
View File
@@ -10,7 +10,7 @@
"license": "MIT",
"dependencies": {
"canvas": "^3.0.0",
"nexrad-level-2-data": "^3.0.0"
"nexrad-level-2-data": "^3.0.2"
},
"devDependencies": {
"@eslint/compat": "^2.1.0",
@@ -23,29 +23,6 @@
"node": ">=24.0.0"
}
},
"../nexrad-level-2-data": {
"version": "3.0.0",
"license": "MIT",
"dependencies": {
"@foxglove/wasm-bz2": "^0.3.0"
},
"devDependencies": {
"@eslint/compat": "^2.1.0",
"@eslint/js": "^9.39.5",
"del": "^8.0.0",
"eslint": "^9.39.5",
"eslint-config-airbnb-extended": "^3.1.1",
"eslint-plugin-jsdoc": "^63.3.1",
"glob": "^13.0.6",
"gulp": "^5.0.0",
"gulp-jsdoc3": "^3.0.0",
"jsdoc": "^4.0.3",
"jsdoc-to-markdown": "^9.1.1"
},
"engines": {
"node": ">=24.0.0"
}
},
"node_modules/@babel/code-frame": {
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
@@ -511,6 +488,15 @@
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/@foxglove/wasm-bz2": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/@foxglove/wasm-bz2/-/wasm-bz2-0.3.0.tgz",
"integrity": "sha512-MP18X3TbeoGT3Kfke7KrYin+5zESfcPnsdD2gaVviN1xzteoDDfVTZbVmbdfGrIV/qAAhBhBVbRcrN25rWSNOQ==",
"license": "MIT",
"dependencies": {
"tslib": "^2"
}
},
"node_modules/@humanfs/core": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
@@ -4511,8 +4497,16 @@
"license": "MIT"
},
"node_modules/nexrad-level-2-data": {
"resolved": "../nexrad-level-2-data",
"link": true
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/nexrad-level-2-data/-/nexrad-level-2-data-3.0.2.tgz",
"integrity": "sha512-VEfPl0NsOEFZAb+X6/yojdfq0g+QGNQQrzXBuP9HZIKwUhFY7Ro/POTFqZ/vRVfb7B1Bce/lzQqORbGim+MHMw==",
"license": "MIT",
"dependencies": {
"@foxglove/wasm-bz2": "^0.3.0"
},
"engines": {
"node": ">=24.0.0"
}
},
"node_modules/node-abi": {
"version": "3.94.0",
@@ -5718,9 +5712,7 @@
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"dev": true,
"license": "0BSD",
"optional": true
"license": "0BSD"
},
"node_modules/tunnel-agent": {
"version": "0.6.0",
+26 -25
View File
@@ -1,33 +1,34 @@
const palette = [
// 0: green/outbound
0, 255, 0, 255,
0, 240, 0, 255,
0, 223, 0, 255,
0, 206, 0, 255,
0, 189, 0, 255,
0, 172, 0, 255,
0, 155, 0, 255,
0, 138, 0, 255,
16, 121, 16, 255,
32, 113, 32, 255,
48, 104, 48, 255,
215, 255, 225, 255,
179, 243, 188, 255,
143, 230, 150, 255,
108, 218, 113, 255,
72, 205, 75, 255,
36, 193, 38, 255,
0, 180, 0, 255,
10, 168, 10, 255,
20, 157, 20, 255,
30, 145, 30, 255,
40, 133, 40, 255,
// 11: nearly zero
64, 95, 64, 255,
95, 64, 64, 255,
50, 122, 50, 255,
128, 50, 50, 255,
// 13: red/inbound
104, 32, 32, 255,
113, 16, 16, 255,
121, 0, 0, 255,
138, 0, 0, 255,
155, 0, 0, 255,
172, 0, 0, 255,
189, 0, 0, 255,
206, 0, 0, 255,
223, 0, 0, 255,
240, 0, 0, 255,
255, 0, 0, 255,
147, 40, 40, 255,
165, 30, 30, 255,
183, 20, 20, 255,
202, 10, 10, 255,
220, 0, 0, 255,
226, 36, 38, 255,
232, 72, 75, 255,
238, 108, 113, 255,
243, 143, 150, 255,
249, 179, 188, 255,
255, 215, 225, 255,
// 24: transparent
255, 255, 255, 0,
@@ -42,7 +43,7 @@ const downSample = (cur, prev) => {
};
const limits = [-99, -90, -80, -70, -60, -50, -40, -30, -20, -15, -10, -5, 0, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 99,
];
].map((limit) => limit * (50 / 99));
const downSampleReset = null;