1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Data access for NEXRAD weather radar files.
//!
//! This crate provides tools for working with NEXRAD Archive II volume files and
//! accessing data from cloud providers like AWS.
//!
//! # Overview
//!
//! - [`volume`] - Parse and decode local Archive II volume files
//! - `aws` - Download data from AWS (archive and real-time, requires `aws` feature)
//!
//! # Working with Local Files
//!
//! ```ignore
//! use nexrad_data::volume::File;
//!
//! let data = std::fs::read("KTLX20130520_201643_V06.ar2v")?;
//! let volume = File::new(data);
//!
//! // Access the volume header
//! if let Some(header) = volume.header() {
//! println!("Volume date: {:?}", header.date());
//! }
//!
//! // Process LDM records
//! for record in volume.records()? {
//! let decompressed = record.decompress()?;
//! let messages = decompressed.messages()?;
//! // Process radar messages...
//! }
//! ```
//!
//! # Downloading from AWS
//!
//! The `aws` feature (enabled by default) provides access to NOAA's NEXRAD data on AWS:
//!
//! - **Archive data**: Historical volumes from the NEXRAD Level II archive
//! - **Real-time data**: Live radar data with minimal latency
//!
//! ```ignore
//! use nexrad_data::aws::archive;
//! use chrono::NaiveDate;
//!
//! // List available files for a date and site
//! let date = NaiveDate::from_ymd_opt(2023, 5, 20).unwrap();
//! let files = archive::list_files("KTLX", date).await?;
//!
//! // Download a specific file
//! let data = archive::download_file(&files[0]).await?;
//! ```
//!
//! # Features
//!
//! - `aws` - Enable AWS S3 data access (requires async runtime)
//! - `nexrad-model` - Enable conversion to high-level `Scan` model
//! - `parallel` - Parallelize LDM record decompression and decoding using Rayon
//!
//! # Crate Boundaries
//!
//! This crate provides **data access and I/O operations** with the following
//! responsibilities and constraints:
//!
//! ## Responsibilities
//!
//! - ✓ Read and parse Archive II volume files
//! - ✓ Handle file I/O operations
//! - ✓ Decompress bzip2-compressed LDM records
//! - ✓ AWS S3 integration for archive and real-time data (when `aws` feature enabled)
//! - ✓ Use `nexrad-decode` for message parsing
//! - ✓ Use `nexrad-model` for high-level type conversion (when feature enabled)
//! - ✓ Orchestrate the data pipeline from raw bytes to structured models
//!
//! ## Constraints
//!
//! - ✗ **No rendering or visualization**
//! - ✗ **No CLI or user interaction**
//!
//! This crate serves as the **I/O boundary layer** for the NEXRAD library suite. It
//! handles all file and network operations, decompression, and coordinates between
//! the low-level binary parsing (`nexrad-decode`) and high-level data models
//! (`nexrad-model`).
/// AWS S3 integration for downloading NEXRAD data from the cloud.
/// Local Archive II volume file handling.
/// Result and error types for data operations.