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 | |
|---|---|---|---|
|
|
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/).
|
||||
|
||||
# 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
|
||||
## Install
|
||||
```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/548/*');
|
||||
// const files = glob.sync('./data/KLOT/940/*');
|
||||
// const files = glob.sync('./data/KSRX/804/*');
|
||||
// const files = glob.sync('./data/TORD/767/*');
|
||||
const files = glob.sync('./data/KLOT/KLOT20210812_171451_V*'); // ref palette tuning
|
||||
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 store each file's data
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "nexrad-level-2-plot",
|
||||
"version": "2.6.2",
|
||||
"version": "2.6.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nexrad-level-2-plot",
|
||||
"version": "2.6.2",
|
||||
"version": "2.6.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"canvas": "^2.9.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nexrad-level-2-plot",
|
||||
"version": "2.6.2",
|
||||
"version": "2.6.3",
|
||||
"description": "Plotting library for nexrad-level-2-data",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
||||
+2
-3
@@ -76,11 +76,10 @@ const draw = (data, _options) => {
|
||||
if (options.size < 1) throw new Error('Provide options.size > 0');
|
||||
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
|
||||
const rawGateSize = data?.data?.[options.elevation]?.[0]?.record?.reflect?.gate_size ?? 0.25;
|
||||
const realGateSize = rawGateSize !== 0.3 ? rawGateSize : rawGateSize / 2;
|
||||
const gateSizeScaling = 0.25 / realGateSize;
|
||||
const gateSizeScaling = rawGateSize / 0.25;
|
||||
|
||||
// calculate crop, adjust if necessary
|
||||
const cropTo = Math.min(options.size, options.cropTo);
|
||||
|
||||
Reference in new issue
Block a user