forked from bartholomew91/nexrad-radar-data
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest-error.js
More file actions
23 lines (20 loc) · 699 Bytes
/
test-error.js
File metadata and controls
23 lines (20 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* eslint-disable no-console */
const fs = require('fs');
const { Level2Radar } = require('./src/index');
// these files should contain the same error
const fileToLoadError = './data/messagesizeerror';
// const fileToLoadError = 'data/KLOT20210625_075708_V06';
(async () => {
// load file
const dataError = await new Promise((resolve) => {
fs.readFile(fileToLoadError, (err, fileData) => {
resolve(fileData);
});
});
const radarError = new Level2Radar(dataError);
console.log(radarError);
// error is in elevation 10
radarError.setElevation(10);
const reflectivityCompressed = radarError.getHighresReflectivity();
console.log(reflectivityCompressed);
})();