mirror of
https://github.com/netbymatt/nexrad-level-2-plot.git
synced 2026-11-29 10:48:04 -08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86c2f9e8ee | ||
|
|
f881493aa4 | ||
|
|
5767f2a10e | ||
|
|
a718f5c3e3 | ||
|
|
20c4552d0a |
No files matched your search
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
> A javascript implementation for plotting Nexrad Level II data parsed via [nexrad-level-2-data](https://github.com/netbymatt/nexrad-level-2-data/).
|
> A javascript implementation for plotting Nexrad Level II data parsed via [nexrad-level-2-data](https://github.com/netbymatt/nexrad-level-2-data/).
|
||||||
|
|
||||||
|
# Demo
|
||||||
|
A live demo showing the output of this library (via [nexrad-level-2-data](https://www.github.com/netbymatt/nexrad-level-2-data)) for select radar sites is available at https://nexrad-demo.netbymatt.com/
|
||||||
|
|
||||||
# Use
|
# Use
|
||||||
## Install
|
## Install
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
-3
@@ -10,9 +10,9 @@ const { plot, writePngToFile } = require('../src');
|
|||||||
// const files = glob.sync('./data/KLOT/381/*');
|
// const files = glob.sync('./data/KLOT/381/*');
|
||||||
// const files = glob.sync('./data/KLOT/548/*');
|
// const files = glob.sync('./data/KLOT/548/*');
|
||||||
// const files = glob.sync('./data/KLOT/940/*');
|
// const files = glob.sync('./data/KLOT/940/*');
|
||||||
// const files = glob.sync('./data/KSRX/804/*');
|
const files = glob.sync('./data/KSRX/804/*');
|
||||||
// const files = glob.sync('./data/TORD/767/*');
|
// 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/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 store each file's data
|
||||||
|
|||||||
Generated
+1898
-2119
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nexrad-level-2-plot",
|
"name": "nexrad-level-2-plot",
|
||||||
"version": "2.6.2",
|
"version": "2.6.4",
|
||||||
"description": "Plotting library for nexrad-level-2-data",
|
"description": "Plotting library for nexrad-level-2-data",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -24,14 +24,14 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/netbymatt/nexrad-level-2-plot#readme",
|
"homepage": "https://github.com/netbymatt/nexrad-level-2-plot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"canvas": "^2.9.1",
|
"canvas": "^2.11.2",
|
||||||
"nexrad-level-2-data": "^2.3.5"
|
"nexrad-level-2-data": "^2.3.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.0.0",
|
"eslint": "^8.0.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.23.4",
|
"eslint-plugin-import": "^2.23.4",
|
||||||
"glob": "^7.1.7"
|
"glob": "^10.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=13.0.0"
|
"node": ">=13.0.0"
|
||||||
|
|||||||
+2
-3
@@ -76,11 +76,10 @@ const draw = (data, _options) => {
|
|||||||
if (options.size < 1) throw new Error('Provide options.size > 0');
|
if (options.size < 1) throw new Error('Provide options.size > 0');
|
||||||
const scale = DEFAULT_OPTIONS.size / options.size;
|
const scale = DEFAULT_OPTIONS.size / options.size;
|
||||||
|
|
||||||
// wsr88d uses a gate size of 0.25km, tdwr uses a gate size of 0.15km, although it is reported as 0.3km for processing reasons
|
// wsr88d uses a gate size of 0.25km, tdwr uses a gate size of 0.15km or 0.30km
|
||||||
// this calculation scales the plot accordingly to the nominal 0.25km so all generated plots are at the same scale
|
// this calculation scales the plot accordingly to the nominal 0.25km so all generated plots are at the same scale
|
||||||
const rawGateSize = data?.data?.[options.elevation]?.[0]?.record?.reflect?.gate_size ?? 0.25;
|
const rawGateSize = data?.data?.[options.elevation]?.[0]?.record?.reflect?.gate_size ?? 0.25;
|
||||||
const realGateSize = rawGateSize !== 0.3 ? rawGateSize : rawGateSize / 2;
|
const gateSizeScaling = rawGateSize / 0.25;
|
||||||
const gateSizeScaling = 0.25 / realGateSize;
|
|
||||||
|
|
||||||
// calculate crop, adjust if necessary
|
// calculate crop, adjust if necessary
|
||||||
const cropTo = Math.min(options.size, options.cropTo);
|
const cropTo = Math.min(options.size, options.cropTo);
|
||||||
|
|||||||
Reference in new issue
Block a user