nexrad-level-2-data
A javascript implementation for decoding Nexrad Level II radar archive files. It currently does not support decoding bzip compressed radar data, or non-highres radar data.
You can find more information on how radar data is encoded at NOAA mainly in the document ICD FOR RDA/RPG - Build RDA 19.0/RPG 19.0 (PDF)
Contents
Install
$ npm i nexrad-level-2-data
Usage
const { Level2Radar } = require('nexrad-level-2-data')
const file_to_load = "./data/KTLX20130420_205120_V06" // The radar archive file to load
new Level2Radar(file_to_load).then(radar => {
console.log(radar.getHighresReflectivity())
})
API
setElevation(Number elevation)
Sets the elevation you want to grab the data from
setScan(Number scan)
Sets the current scan you want to grab the data from
setSweep(Number sweep)
Alias for setScan
getHighresReflectivity()
Returns an Object of radar reflectivity data for the current elevation and scan in the following format
{
gate_count: Number,
first_gate: Number,
gate_size: Number,
rf_threshold: Number,
snr_threshold: Number,
scale: Number,
offset: Number,
data_offset: Number,
moment_data: Array
}
getHighresVelocity()
Returns an Object of radar velocity data for the current elevation and scan in the following format
{
gate_count: Number,
first_gate: Number,
gate_size: Number,
rf_threshold: Number,
snr_threshold: Number,
scale: Number,
offset: Number,
data_offset: Number,
moment_data: Array
}
getHighresSpectrum()
Returns an Object of radar spectrum data for the current elevation and scan in the following format
{
gate_count: Number,
first_gate: Number,
gate_size: Number,
rf_threshold: Number,
snr_threshold: Number,
scale: Number,
offset: Number,
data_offset: Number,
moment_data: Array
}
getHighresDiffReflectivity()
Returns an Object of radar diff reflectivity data for the current elevation and scan in the following format
{
gate_count: Number,
first_gate: Number,
gate_size: Number,
rf_threshold: Number,
snr_threshold: Number,
scale: Number,
offset: Number,
data_offset: Number,
moment_data: Array
}
getHighresDiffPhase()
Returns an Object of radar diff phase data for the current elevation and scan in the following format
{
gate_count: Number,
first_gate: Number,
gate_size: Number,
rf_threshold: Number,
snr_threshold: Number,
scale: Number,
offset: Number,
data_offset: Number,
moment_data: Array
}
getHighresCorrelationCoefficient()
Returns an Object of radar correlation coefficient data for the current elevation and scan in the following format
{
gate_count: Number,
first_gate: Number,
gate_size: Number,
rf_threshold: Number,
snr_threshold: Number,
scale: Number,
offset: Number,
data_offset: Number,
moment_data: Array
}
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. Replace. by message 31 in 2008 which supports a higher resolution. |
| 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 |
Acknowledgements
This work is based on the project of Unidata and nexrad-radar-data