generate all elevations for test

This commit is contained in:
Matt Walsh committed 2021-08-11 11:11:33 -05:00
1 parent 7652e9fb81
commit bf53273aa3
1 file changed
+14 -14
+14 -14
View File
@@ -1,4 +1,5 @@
const { Level2Radar } = require('nexrad-level-2-data');
// eslint-disable-next-line import/no-extraneous-dependencies
const glob = require('glob');
const fs = require('fs');
@@ -30,20 +31,19 @@ const plots = [];
// plot for each elevation and size
(async () => {
await Promise.allSettled([3600, 1800, 900, 800, 600, 450, 100].map(async (size) => {
// await Promise.allSettled(radarData.listElevations().map(async (elevation) => {\
const elevation = radarData.listElevations()[0];
plots[elevation] = plot(radarData, ['REF', 'VEL'], {
elevation,
size,
palettize: true,
cropTo: size / 2,
});
await Promise.allSettled(radarData.listElevations().map(async (elevation) => {
plots[elevation] = plot(radarData, ['REF', 'VEL'], {
elevation,
size,
palettize: true,
cropTo: size / 2,
});
// write files to disk
await Promise.allSettled([
writePngToFile(`./output/REF-${elevation}-${size}.png`, plots[elevation].REF),
writePngToFile(`./output/VEL-${elevation}-${size}.png`, plots[elevation].VEL),
]);
// }));
// write files to disk
await Promise.allSettled([
writePngToFile(`./output/REF-${elevation}-${size}.png`, plots[elevation].REF),
writePngToFile(`./output/VEL-${elevation}-${size}.png`, plots[elevation].VEL),
]);
}));
}));
})();