## Classes
objectSee NOAA documentation for detailed meanings of these values.
objectSee NOAA documentation for detailed meanings of these values.
number \| Array.<number>
* [.getHighresReflectivity([scan])](#Level2Radar+getHighresReflectivity) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
* [.getHighresVelocity([scan])](#Level2Radar+getHighresVelocity) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
* [.getHighresSpectrum([scan])](#Level2Radar+getHighresSpectrum) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
* [.getHighresDiffReflectivity([scan])](#Level2Radar+getHighresDiffReflectivity) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
* [.getHighresDiffPhase([scan])](#Level2Radar+getHighresDiffPhase) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
* [.getHighresCorrelationCoefficient([scan])](#Level2Radar+getHighresCorrelationCoefficient) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
* _Metadata_
* [.getScans()](#Level2Radar+getScans) ⇒ number
* [.getHeader([scan])](#Level2Radar+getHeader) ⇒ [MessageHeader](#MessageHeader)
* [.listElevations()](#Level2Radar+listElevations) ⇒ Array.<number>
* _static_
* [.combineData(...data)](#Level2Radar.combineData) ⇒ [Level2Radar](#Level2Radar)
### new Level2Radar(file, [options])
Parses a Nexrad Level 2 Data archive or chunk. Provide `rawData` as a `Buffer`. Returns an object formatted per the [ICD FOR RDA/RPG - Build RDA 20.0/RPG 20.0 (PDF)](https://www.roc.noaa.gov/wsr88d/PublicDocs/ICDs/2620002U.pdf), or as close as can reasonably be represented in a javascript object. Additional data accessors are provided in the returned object to pull out typical data in a format ready for processing.
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| file | Buffer \| [Level2Radar](#Level2Radar) | | Buffer with Nexrad Level 2 data. Alternatively a Level2Radar object, typically used internally when combining data. |
| [options] | object | | Parser options |
| [options.logger] | object \| boolean | console | By default error and information messages will be written to the console. These can be suppressed by passing false, or a custom logger can be provided. A custom logger must provide the log() and error() function. |
### level2Radar.setElevation(elevation)
Sets the elevation in use for get* methods
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Category**: Configuration
| Param | Type | Description |
| --- | --- | --- |
| elevation | number | Selected elevation number |
### level2Radar.getAzimuth([scan]) ⇒ number \| Array.<number>
Returns an single azimuth value or array of azimuth values for the current elevation and scan (or all scans if not provided).
The order of azimuths in the returned array matches the order of the data in other get* functions.
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: number \| Array.<number> - Azimuth angle
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan |
### level2Radar.getHighresReflectivity([scan]) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
Returns an Object of radar reflectivity data for the current elevation and scan (or all scans if not provided)
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData) - Scan's high res reflectivity data, or an array of the data.
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan or null for all scans in elevation |
### level2Radar.getHighresVelocity([scan]) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
Returns an Object of radar velocity data for the current elevation and scan (or all scans if not provided)
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData) - Scan's high res velocity data, or an array of the data.
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan, or null for all scans in this elevation |
### level2Radar.getHighresSpectrum([scan]) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
Returns an Object of radar spectrum data for the current elevation and scan (or all scans if not provided)
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData) - Scan's high res spectrum data, or an array of the data.
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan, or null for all scans in this elevation |
### level2Radar.getHighresDiffReflectivity([scan]) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
Returns an Object of radar differential reflectivity data for the current elevation and scan (or all scans if not provided)
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData) - Scan's high res differential reflectivity data, or an array of the data.
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan or null for all scans in elevation |
### level2Radar.getHighresDiffPhase([scan]) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
Returns an Object of radar differential phase data for the current elevation and scan (or all scans if not provided)
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData) - Scan's high res differential phase data, or an array of the data.
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan or null for all scans in elevation |
### level2Radar.getHighresCorrelationCoefficient([scan]) ⇒ [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData)
Returns an Object of radar correlation coefficient data for the current elevation and scan (or all scans if not provided)
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Returns**: [HighResData](#HighResData) \| [Array.<HighResData>](#HighResData) - Scan's high res correlation coefficient data, or an array of the data.
**Category**: Data
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan or null for all scans in elevation |
### level2Radar.getScans() ⇒ number
Return the number of scans in the current elevation
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Category**: Metadata
### level2Radar.getHeader([scan]) ⇒ [MessageHeader](#MessageHeader)
Return message_header information for all scans or a specific scan for the selected elevation
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Category**: Metadata
| Param | Type | Description |
| --- | --- | --- |
| [scan] | number | Selected scan, omit to return all scans for this elevation |
### level2Radar.listElevations() ⇒ Array.<number>
List all available elevations
**Kind**: instance method of [Level2Radar](#Level2Radar)
**Category**: Metadata
### Level2Radar.combineData(...data) ⇒ [Level2Radar](#Level2Radar)
Combines the data returned by multiple runs of the Level2Data constructor. This is typically used in "chunks" mode to combine all azimuths from one revolution into a single data set. data can be provided as an array of Level2Radar objects, individual Level2Data parameters or any combination thereof.
The combine function blindly combines data and the right-most argument will overwrite any previously provided data. Individual azimuths located in Level2Radar.data[] will be appended. It is up to the calling routine to properly manage the parsing of related chunks and send it in to this routine.
**Kind**: static method of [Level2Radar](#Level2Radar)
**Returns**: [Level2Radar](#Level2Radar) - Combined data
| Param | Type | Description |
| --- | --- | --- |
| ...data | [Level2Radar](#Level2Radar) | Data to combine |
## HighResData : object
See NOAA documentation for detailed meanings of these values.
**Kind**: global typedef
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| gate_count | number | |
| gate_size | number | |
| first_gate | number | |
| rf_threshold | number | |
| snr_threshold | number | |
| scale | number | |
| offset | number | |
| block_type | string | 'D' |
| control_flags | number | |
| data_size | number | |
| name | string | 'REF', 'VEL', 'SW ', 'ZDR', 'PHI', 'RHO' |
| spare | Array.<Buffer> | Spare data per the documentation |
| moment_data | Array.<number> | Scaled data |
## MessageHeader : object
See NOAA documentation for detailed meanings of these values.
**Kind**: global typedef
**Properties**
| Name | Type |
| --- | --- |
| aim | number |
| ars | number |
| compress_idx | number |
| cut | number |
| dcount | number |
| elevation_angle | number |
| elevation_number | number |
| id | string |
| julian_date | number |
| mseconds | number |
| phi | [HighResData](#HighResData) |
| radial | [Radial](#Radial) |
| radial_length | number |
| radial_number | number |
| [reflect] | [HighResData](#HighResData) |
| [rho] | [HighResData](#HighResData) |
| rs | number |
| rsbs | number |
| spectrum | [HighResData](#HighResData) |
| sp | number |
| volume | [Volume](#Volume) |
| [velocity] | [HighResData](#HighResData) |
| [zdr] | [HighResData](#HighResData) |
## Radial
**Kind**: global typedef
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| block_type | string | 'R' |
| horizontal_calibration | number | |
| horizontal_noise_level | number | |
| name | string | 'RAD' |
| nyquist_velocity | number | |
| radial_flags | number | |
| size | number | |
| unambiguous_range | number | |
| vertical_calibration | number | |
| vertical_noise_level | number | |
## Volume
**Kind**: global typedef
**Properties**
| Name | Type | Description |
| --- | --- | --- |
| block_type | string | 'R' |
| calibration | number | |
| differential_phase | number | |
| differential_reflectivity | number | |
| elevation | number | |
| feedhorn_height | number | |
| latitude | number | |
| longitude | number | |
| name | string | 'VOL' |
| processing_status | number | |
| size | number | |
| tx_horizontal | number | |
| tx_vertical | number | |
| version_major | number | |
| version_minor | number | |
| volume_coverage_pattern | number | |
| zdr_bias_estimate | number | |