Files
nexrad-level-2-data/docs/quicksearch.html
T
2025-05-14 11:24:44 -05:00

32 lines
19 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<html>
<head>
</head>
<body style="background: transparent;">
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/lunr.min.js"></script>
<script src="scripts/fulltext-search.js"></script>
<script type="text/x-docstrap-searchdb">
{"global.html":{"id":"global.html","title":"Global","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global Global Type Definitions Header File header details See NOAA documentation for detailed meanings of these values. Type: object Properties: Name Type Description ICAO string Radar site identifier milliseconds number Milliseconds since midnight modified_julian_date number Days since Dec 31, 1969 raw Uint8Array Raw header from file version string Version number HighResData See NOAA documentation for detailed meanings of these values. Type: object 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.&lt;Uint8Array&gt; Spare data per the documentation moment_data Array.&lt;number&gt; Scaled data MessageHeader See NOAA documentation for detailed meanings of these values. Type: object Properties: Name Type Argument Description 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 &lt;optional&gt; radial Radial radial_length number radial_number number reflect HighResData &lt;optional&gt; rho HighResData &lt;optional&gt; rs number rsbs number spectrum HighResData &lt;optional&gt; sp number volume Volume velocity HighResData &lt;optional&gt; zdr HighResData &lt;optional&gt; ParsedData Intermediate parsed radar data, further processed by Level2Radar Type: object Properties: Name Type Description data object Grouped and sorted data header Header vcp Vcp isTruncated boolean hasGaps boolean ParserOptions parser options Type: object Properties: Name Type Argument Default Description logger object | boolean &lt;optional&gt; 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() functions. Radial See NOAA documentation for detailed meanings of these values. Type: object 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 Vcp Volume coverage pattern See NOAA documentation for detailed meanings of these values. Type: object Properties: Name Type Description channel number id_sequence number message_julian_date number message_mseconds number message_size number message_type number record VcpRecord segment_count number segment_number number VcpRecord See NOAA documentation for detailed meanings of these values. Type: object Properties: Name Type Description clutter_number number elevations Array.&lt;VcpElevations&gt; message_size number num_elevations number pattern_number number pattern_type number pulse_width string reserved1 number Reserved per NOAA documentation reserved2 number Reserved per NOAA documentation vcp_sequencing VcpSequencing vcp_supplemental VcpSupplemental velocity_resolution number version number VcpSequencing See NOAA documentation for detailed meanings of these values. Type: object Properties: Name Type Description elevations number max_sails_cuts number sequence_active number truncated_vcp number VcpSupplemental See NOAA documentation for detailed meanings of these values. Type: object Properties: Name Type Description base_tilt_vcp boolean mpda_vcp boolean mrle_vcp boolean number_base_tilts number number_mrle_cuts number number_sails_cuts number sails_vcp number Volume See NOAA documentation for detailed meanings of these values. Type: object 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 × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "},"classes.list.html":{"id":"classes.list.html","title":"Classes","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global Classes Classes Level2Radar Level2Record parseData RandomAccessFile × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "},"index.html":{"id":"index.html","title":"Index","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global 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 Changes in v2.0.0 Install Usage API Testing Error Recovery and handling Supported Messages Source Data Documentation 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. Allow for processing of \"chunks\" in addition to entire volume scan archives. Chunks (real time data) is provided by Unidata in the s3 bucket s3://unidata-nexrad-level2-chunks/ Full archives are provided by Unidata in the s3 bucket s3://noaa-nexrad-level2 When processing a chunk all data may not be populated in the resulting object. This is deatiled in UPGRADE.md Improve error reporting by throwing when data is not present or invalid elevations or scans are accessed. Unify the data accessor functions (breaking change) Follow NOAA convention of the lowest elevation being 1, and properly sort elevations above 1 into a sparse array (breaking change) Provide a mechanism for consolidating data read from several chunks. 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 =&gt; { 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: Buffer not provided for parsing Calling a data accessor on non-existant data such as invalid elevations or azimuths A successfully parsed file that did not contain any data A cursory check on data validity is done by checking the ICAO identifier of each record in the file before further parsing occurs. Basic file length checks against offsets and block lengths listed in the file. The Nexrad archives and chunks do contain errors when read from the Unidata archives in s3 buckets s3://noaa-nexrad-level2 and s3://unidata-nexrad-level2-chunks/. A very basic attempt is made to detect these errors, discard the affected record and find the begining of the next record. This does not always succeeded. The following are the possible outcomes: Successful error detection and skipping to a known good block. Logs to console Invlaid record id or Invalid block type Returns as much data that could be parsed with some gaps in data. The actual gaps are not logged. A manual scan of the Level2Radar.data[] arrays looking at Azimuths would need to be performed to find the gaps in data. However any program calling this routine should be considering the Level2Radar.data[].azimuth data for further processing and thus should be unaffected. Level2Data.hasGaps is set to true Error detection with no skipping to a known good block Logs to console Invalid record id or Invalid block id Later logs to console Unable to recover message Returns as much data that could be parsed. Level2Data.isTruncated is set to trueThe scripttest-error.jscan be run to test some of this functionality. It parses data in./data/messagesizeerror`. 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 × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "},"Level2Radar.html":{"id":"Level2Radar.html","title":"Class: Level2Radar","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global Class: Level2Radar Level2Radar new Level2Radar(file [, options]) Parses a Nexrad Level 2 Data archive or chunk. Provide `rawData` as a `Uint8Array`. 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. Radar data is accessed through the get* methods Parameters: Name Type Argument Description file Uint8Array | Level2Radar Uint8Array with Nexrad Level 2 data. Alternatively a Level2Radar object, typically used internally when combining data. options ParserOptions &lt;optional&gt; Parser options Members hasGaps :boolean Gaps were found in the source data Type: boolean header :Header Type: Header isTruncated :boolean Source data was truncated Type: boolean vcp :Vcp Type: Vcp Methods &lt;static&gt; combineData(data) 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. Parameters: Name Type Argument Description data Level2Radar &lt;repeatable&gt; Data to combine Returns: Combined data Type Level2Radar getAzimuth( [scan]) 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. Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan Returns: Azimuth angle Type number | Array.&lt;number&gt; getHeader( [scan]) Return message_header information for all scans or a specific scan for the selected elevation Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan, omit to return all scans for this elevation Returns: Type MessageHeader getHighresCorrelationCoefficient( [scan]) Returns an Object of radar correlation coefficient data for the current elevation and scan (or all scans if not provided) Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan or null for all scans in elevation Returns: Scan's high res correlation coefficient data, or an array of the data. Type HighResData | Array.&lt;HighResData&gt; getHighresDiffPhase( [scan]) Returns an Object of radar differential phase data for the current elevation and scan (or all scans if not provided) Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan or null for all scans in elevation Returns: Scan's high res differential phase data, or an array of the data. Type HighResData | Array.&lt;HighResData&gt; getHighresDiffReflectivity( [scan]) Returns an Object of radar differential reflectivity data for the current elevation and scan (or all scans if not provided) Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan or null for all scans in elevation Returns: Scan's high res differential reflectivity data, or an array of the data. Type HighResData | Array.&lt;HighResData&gt; getHighresReflectivity( [scan]) Returns an Object of radar reflectivity data for the current elevation and scan (or all scans if not provided) Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan or null for all scans in elevation Returns: Scan's high res reflectivity data, or an array of the data. Type HighResData | Array.&lt;HighResData&gt; getHighresSpectrum( [scan]) Returns an Object of radar spectrum data for the current elevation and scan (or all scans if not provided) Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan, or null for all scans in this elevation Returns: Scan's high res spectrum data, or an array of the data. Type HighResData | Array.&lt;HighResData&gt; getHighresVelocity( [scan]) Returns an Object of radar velocity data for the current elevation and scan (or all scans if not provided) Parameters: Name Type Argument Description scan number &lt;optional&gt; Selected scan, or null for all scans in this elevation Returns: Scan's high res velocity data, or an array of the data. Type HighResData | Array.&lt;HighResData&gt; getScans() Return the number of scans in the current elevation Returns: Type number listElevations() List all available elevations Returns: Type Array.&lt;number&gt; setElevation(elevation) Sets the elevation in use for get* methods Parameters: Name Type Description elevation number Selected elevation number × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "},"Level2Record.html":{"id":"Level2Record.html","title":"Class: Level2Record","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global Class: Level2Record Level2Record new Level2Record(raf, record, message31Offset, header [, options]) Read a single record from the radar data Parameters: Name Type Argument Description raf RandomAccessFile Random access file record number Record number message31Offset number Additional record offset caused by message 31 size header Header Original parsed file header options ParserOptions &lt;optional&gt; Parser options Returns: Variable data based on message types present in record Type object × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "},"parseData.html":{"id":"parseData.html","title":"Class: parseData","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global Class: parseData parseData new parseData(file [, options]) Internal function. Parses a Nexrad Level 2 Data archive or chunk. Provide `rawData` as a `Uint8Array`. Parameters: Name Type Argument Description file Uint8Array Uint8Array with Nexrad Level 2 data. Alternatively a Level2Radar object, typically used internally when combining data. options object &lt;optional&gt; Parser options Properties Name Type Argument Description logger object | boolean &lt;optional&gt; 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(), warn() and error() function. Returns: Intermediate data for use with Level2Radar Type object × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "},"RandomAccessFile.html":{"id":"RandomAccessFile.html","title":"Class: RandomAccessFile","body":" Documentation Classes Level2RadarLevel2RecordparseDataRandomAccessFile Global Global Class: RandomAccessFile RandomAccessFile new RandomAccessFile(file, endian) Store a array or string and add functionality for random access Unless otherwise noted all read functions advance the file's pointer by the length of the data read Parameters: Name Type Description file Uint8Array | string A file as a string or Uint8Array to load for random access endian number Endianess of the file constants BIG_ENDIAN and LITTLE_ENDIAN are provided Methods getLength() Get array length Returns: Type number getPos() Get current position in the file Returns: Type number read(length) Read a set number of bytes from the array Parameters: Name Type Default Description length number 1 Number of bytes to read Returns: number if length = 1, otherwise number[] Type number | Array.&lt;number&gt; readByte() Read a single byte from the array Returns: Type number readFloat() Read a float from the array Returns: Type number readInt() Read a 4-byte unsigned integer from the array Returns: Type number readShort() Read a 2-byte unsigned integer from the array Returns: Type number readSignedInt() Read a 2-byte signed integer from the array Returns: Type number readSInt4() Read a 4-byte signed integer from the array Returns: Type number readString(length) Read a string of a specificed length from the array Parameters: Name Type Description length number Length of string to read Returns: Type string seek(position) Seek to a provided array offset Parameters: Name Type Description position number Byte offset skip(length) Advance the pointer forward a set number of bytes Parameters: Name Type Description length number Number of bytes to skip × Search results Close Documentation generated by JSDoc 3.6.11 on 2025-05-14T11:21:08-05:00 using the DocStrap template. "}}
</script>
<script type="text/javascript">
$(document).ready(function() {
Searcher.init();
});
$(window).on("message", function(msg) {
var msgData = msg.originalEvent.data;
if (msgData.msgid != "docstrap.quicksearch.start") {
return;
}
var results = Searcher.search(msgData.searchTerms);
window.parent.postMessage({"results": results, "msgid": "docstrap.quicksearch.done"}, "*");
});
</script>
</body>
</html>