netbymatt / nexrad-level-2-data

Retrieve data from Nexrad archive files for plotting
MIT License
11 stars 4 forks source link
decoding javscript nexrad nexrad-data node parser radar-data radar-site reflectivity-data velocity-data

nexrad-level-2-data

A javascript implementation for decoding Nexrad Level II radar archive files.

Demo

A live demo showing the output of this library (via nexrad-level-2-plot) for select radar sites is available at https://nexrad-demo.netbymatt.com/

Contents

  1. Changes in v2.0.0
  2. Install
  3. Usage
  4. API
  5. Testing
  6. Error Recovery and handling
  7. Supported Messages
  8. Source Data Documentation
  9. Acknowledgements

Changes in v2.0.0

v2.0.0 is a major overhaul of the parsing engine and has several breaking changes. See UPGRADE.md for detailed breaking changes.

Install

$ npm i nexrad-level-2-data

Usage

const { Level2Radar } = require('nexrad-level-2-data')
const fs = require('fs');
const file_to_load = "./data/KTLX20130420_205120_V06" // The radar archive file to load

const rawData = fs.readFileSync(file_to_load);

new Level2Radar(rawData).then(radar => {
    console.log(radar.getHighresReflectivity())
})

API

Complete API documentation

Testing

A formal testing suite is not provided. Several test-*.js are provided with matching data in the ./data folder. These can be run individually as shown below.

node test.js
node test-chunks.js
node test-error.js

The output of each test script is sent to the console.

Error recovery and handling

This library will throw on many errors including:

Supported Messages

Nexrad data is stored as message types. This package currently processes the following messages. Message Title Description
1 Digital Radar Data Reflectivity and velocity data. Replaced by message 31 in 2008 which supports a higher resolution.
2 RDA Status
5 Volume Coverage Pattern Overview of the scanning paramaters
7 Volume Coverage Pattern Overview of the scanning paramaters
31 Digital Radar Data Generic Format Reflectivity and velocity data

Source Data Documentation

You can find more information on how radar data is encoded at NOAA mainly in the document ICD FOR RDA/RPG - Build RDA 20.0/RPG 20.0 (PDF)

Acknowledgements

This work is based on the project of Unidata and nexrad-radar-data