noaa_weather_client 1.3.0

A client library for the NOAA weather.gov API
Documentation
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
use serde::{Deserialize, Serialize};

use super::{JsonLdContext, ValueUnit};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RadarStationFeature {
    /// Unique identifier for the radar station feature.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The type of the GeoJSON object, typically "Feature".
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    /// Geometric data for the feature (location of the radar station).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub geometry: Option<PointGeometry>,
    /// Detailed properties of the radar station.
    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
    pub radar_station: Option<RadarStation>,
}

/// Contains all properties of a radar station, including identity, location, and operational details.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RadarStation {
    /// JSON-LD context, can be a string, an object, or an array of strings and objects.
    #[serde(rename = "@context", skip_serializing_if = "Option::is_none")]
    pub at_context: Option<Box<JsonLdContext>>,
    /// Unique identifier (URL) for the radar station.
    #[serde(rename = "@id", skip_serializing_if = "Option::is_none")]
    pub at_id: Option<String>,
    /// Type identifier for the radar station, (e.g., "wx:RadarStation").
    #[serde(rename = "@type", skip_serializing_if = "Option::is_none")]
    pub at_type: Option<String>,
    /// Short identifier for the radar station (e.g., "KFSD").
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Human-readable name of the radar station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Type of the radar station (e.g., "WSR-88D").
    #[serde(rename = "stationType", skip_serializing_if = "Option::is_none")]
    pub station_type: Option<String>,
    /// Elevation of the radar station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub elevation: Option<ValueUnit>,
    /// Time zone of the radar station.
    #[serde(rename = "timeZone", skip_serializing_if = "Option::is_none")]
    pub time_zone: Option<String>,
    /// Latency information for the station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub latency: Option<LatencyInfo>,
    /// RDA (Radar Data Acquisition) unit information.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rda: Option<RdaInfo>,
    /// Performance metrics for the station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub performance: Option<PerformanceInfo>,
    /// Adaptation parameters for the station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub adaptation: Option<AdaptationInfo>,
}

/// Represents a GeoJSON Point geometry.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PointGeometry {
    /// The type of geometry, typically "Point".
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    /// The coordinates of the point, usually [longitude, latitude].
    #[serde(skip_serializing_if = "Option::is_none")]
    pub coordinates: Option<Vec<f64>>,
}

/// Contains latency information for a radar station.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LatencyInfo {
    /// Current latency.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub current: Option<ValueUnit>,
    /// Average latency.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub average: Option<ValueUnit>,
    /// Maximum latency observed.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max: Option<ValueUnit>,
    /// Timestamp of the last Level II data received.
    #[serde(
        rename = "levelTwoLastReceivedTime",
        skip_serializing_if = "Option::is_none"
    )]
    pub level_two_last_received_time: Option<String>,
    /// Timestamp associated with the maximum latency.
    #[serde(rename = "maxLatencyTime", skip_serializing_if = "Option::is_none")]
    pub max_latency_time: Option<String>,
    /// The host that reported this latency information.
    #[serde(rename = "reportingHost", skip_serializing_if = "Option::is_none")]
    pub reporting_host: Option<String>,
    /// The specific host associated with the latency data (e.g., LDM server).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub host: Option<String>,
}

/// Properties related to the RDA (Radar Data Acquisition) unit.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RdaProperties {
    /// Version of the resolution.
    #[serde(rename = "resolutionVersion", skip_serializing_if = "Option::is_none")]
    pub resolution_version: Option<i32>,
    /// Path for NL2 data.
    #[serde(rename = "nl2Path", skip_serializing_if = "Option::is_none")]
    pub nl2_path: Option<String>,
    /// Volume coverage pattern (e.g., "R35", "R212").
    #[serde(
        rename = "volumeCoveragePattern",
        skip_serializing_if = "Option::is_none"
    )]
    pub volume_coverage_pattern: Option<String>,
    /// Control status of the RDA.
    #[serde(rename = "controlStatus", skip_serializing_if = "Option::is_none")]
    pub control_status: Option<String>,
    /// Build number of the RDA software/firmware.
    #[serde(rename = "buildNumber", skip_serializing_if = "Option::is_none")]
    pub build_number: Option<f64>, // e.g., 23.1 or 23
    /// Summary of current alarms.
    #[serde(rename = "alarmSummary", skip_serializing_if = "Option::is_none")]
    pub alarm_summary: Option<String>,
    /// Operational mode of the RDA.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mode: Option<String>,
    /// State of the power generator.
    #[serde(rename = "generatorState", skip_serializing_if = "Option::is_none")]
    pub generator_state: Option<String>,
    /// Status of super resolution capabilities.
    #[serde(
        rename = "superResolutionStatus",
        skip_serializing_if = "Option::is_none"
    )]
    pub super_resolution_status: Option<String>,
    /// Overall operability status of the RDA.
    #[serde(rename = "operabilityStatus", skip_serializing_if = "Option::is_none")]
    pub operability_status: Option<String>,
    /// General status of the RDA.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Average transmitter power.
    #[serde(
        rename = "averageTransmitterPower",
        skip_serializing_if = "Option::is_none"
    )]
    pub average_transmitter_power: Option<ValueUnit>,
    /// Reflectivity calibration correction value.
    #[serde(
        rename = "reflectivityCalibrationCorrection",
        skip_serializing_if = "Option::is_none"
    )]
    pub reflectivity_calibration_correction: Option<ValueUnit>,
}

/// Information about the RDA (Radar Data Acquisition) unit.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RdaInfo {
    /// Timestamp of the RDA information.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
    /// The host that reported this RDA information.
    #[serde(rename = "reportingHost", skip_serializing_if = "Option::is_none")]
    pub reporting_host: Option<String>,
    /// Detailed properties of the RDA.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<RdaProperties>,
}

/// Properties of a radar station feature.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RadarStationProperties {
    /// Unique identifier (URL) for the radar station.
    #[serde(rename = "@id", skip_serializing_if = "Option::is_none")]
    pub at_id: Option<String>,
    /// Type identifier for the radar station, often from a vocabulary (e.g., "wx:RadarStation").
    #[serde(rename = "@type", skip_serializing_if = "Option::is_none")]
    pub at_type: Option<String>,
    /// Short identifier for the radar station (e.g., "KFSD").
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Human-readable name of the radar station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Type of the radar station (e.g., "WSR-88D").
    #[serde(rename = "stationType", skip_serializing_if = "Option::is_none")]
    pub station_type: Option<String>,
    /// Elevation of the radar station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub elevation: Option<ValueUnit>,
    /// Time zone of the radar station.
    #[serde(rename = "timeZone", skip_serializing_if = "Option::is_none")]
    pub time_zone: Option<String>,
    /// Latency information for the station.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub latency: Option<LatencyInfo>,
    /// RDA (Radar Data Acquisition) unit information.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rda: Option<RdaInfo>,
}

/// Represents a single feature in a GeoJSON FeatureCollection.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Feature {
    /// Unique identifier for the feature.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The type of the GeoJSON object, typically "Feature".
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    /// Geometric data for the feature.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub geometry: Option<PointGeometry>,
    /// Properties associated with the feature.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<RadarStationProperties>,
}

/// Detailed performance metrics of the radar station.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PerformanceProperties {
    #[serde(rename = "ntp_status", skip_serializing_if = "Option::is_none")]
    pub ntp_status: Option<i32>,
    #[serde(rename = "commandChannel", skip_serializing_if = "Option::is_none")]
    pub command_channel: Option<String>,
    #[serde(
        rename = "radomeAirTemperature",
        skip_serializing_if = "Option::is_none"
    )]
    pub radome_air_temperature: Option<ValueUnit>,
    #[serde(
        rename = "transitionalPowerSource",
        skip_serializing_if = "Option::is_none"
    )]
    pub transitional_power_source: Option<String>,
    #[serde(
        rename = "horizontalShortPulseNoise",
        skip_serializing_if = "Option::is_none"
    )]
    pub horizontal_short_pulse_noise: Option<ValueUnit>,
    #[serde(
        rename = "elevationEncoderLight",
        skip_serializing_if = "Option::is_none"
    )]
    pub elevation_encoder_light: Option<String>,
    #[serde(
        rename = "horizontalLongPulseNoise",
        skip_serializing_if = "Option::is_none"
    )]
    pub horizontal_long_pulse_noise: Option<ValueUnit>,
    #[serde(
        rename = "azimuthEncoderLight",
        skip_serializing_if = "Option::is_none"
    )]
    pub azimuth_encoder_light: Option<String>,
    #[serde(
        rename = "horizontalNoiseTemperature",
        skip_serializing_if = "Option::is_none"
    )]
    pub horizontal_noise_temperature: Option<ValueUnit>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub linearity: Option<f64>,
    #[serde(
        rename = "transmitterPeakPower",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_peak_power: Option<ValueUnit>,
    #[serde(
        rename = "horizontalDeltadBZ0",
        skip_serializing_if = "Option::is_none"
    )]
    pub horizontal_deltad_bz0: Option<ValueUnit>,
    #[serde(
        rename = "transmitterRecycleCount",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_recycle_count: Option<i32>,
    #[serde(rename = "verticalDeltadBZ0", skip_serializing_if = "Option::is_none")]
    pub vertical_deltad_bz0: Option<ValueUnit>,
    #[serde(rename = "receiverBias", skip_serializing_if = "Option::is_none")]
    pub receiver_bias: Option<ValueUnit>,
    #[serde(
        rename = "shortPulseHorizontaldBZ0",
        skip_serializing_if = "Option::is_none"
    )]
    pub short_pulse_horizontal_dbz0: Option<ValueUnit>,
    #[serde(
        rename = "transmitterImbalance",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_imbalance: Option<ValueUnit>,
    #[serde(
        rename = "longPulseHorizontaldBZ0",
        skip_serializing_if = "Option::is_none"
    )]
    pub long_pulse_horizontal_dbz0: Option<ValueUnit>,
    #[serde(
        rename = "performanceCheckTime",
        skip_serializing_if = "Option::is_none"
    )]
    pub performance_check_time: Option<String>,
    #[serde(
        rename = "transmitterLeavingAirTemperature",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_leaving_air_temperature: Option<ValueUnit>,
    #[serde(rename = "shelterTemperature", skip_serializing_if = "Option::is_none")]
    pub shelter_temperature: Option<ValueUnit>,
    #[serde(rename = "powerSource", skip_serializing_if = "Option::is_none")]
    pub power_source: Option<String>,
    #[serde(rename = "dynamicRange", skip_serializing_if = "Option::is_none")]
    pub dynamic_range: Option<ValueUnit>,
    #[serde(rename = "fuelLevel", skip_serializing_if = "Option::is_none")]
    pub fuel_level: Option<ValueUnit>,
}

/// Encapsulates performance data along with its reporting context.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PerformanceInfo {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
    #[serde(rename = "reportingHost", skip_serializing_if = "Option::is_none")]
    pub reporting_host: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<PerformanceProperties>,
}

/// Detailed adaptation parameters of the radar station.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdaptationProperties {
    #[serde(
        rename = "transmitterFrequency",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_frequency: Option<ValueUnit>,
    #[serde(
        rename = "pathLossWG04Circulator",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_wg04_circulator: Option<ValueUnit>,
    #[serde(
        rename = "antennaGainIncludingRadome",
        skip_serializing_if = "Option::is_none"
    )]
    pub antenna_gain_including_radome: Option<ValueUnit>,
    #[serde(
        rename = "pathLossA6ArcDetector",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_a6_arc_detector: Option<ValueUnit>,
    #[serde(rename = "cohoPowerAtA1J4", skip_serializing_if = "Option::is_none")]
    pub coho_power_at_a1j4: Option<ValueUnit>,
    #[serde(
        rename = "ameHorzizontalTestSignalPower",
        skip_serializing_if = "Option::is_none"
    )]
    pub ame_horizontal_test_signal_power: Option<ValueUnit>,
    #[serde(
        rename = "pathLossTransmitterCouplerCoupling",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_transmitter_coupler_coupling: Option<ValueUnit>,
    #[serde(rename = "staloPowerAtA1J2", skip_serializing_if = "Option::is_none")]
    pub stalo_power_at_a1j2: Option<ValueUnit>,
    #[serde(
        rename = "ameNoiseSourceHorizontalExcessNoiseRatio",
        skip_serializing_if = "Option::is_none"
    )]
    pub ame_noise_source_horizontal_excess_noise_ratio: Option<ValueUnit>,
    #[serde(
        rename = "pathLossVerticalIFHeliaxTo4AT16",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_vertical_if_heliax_to_4at16: Option<ValueUnit>,
    #[serde(
        rename = "pathLossAT4Attenuator",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_at4_attenuator: Option<ValueUnit>,
    #[serde(
        rename = "pathLossHorzontalIFHeliaxTo4AT17",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_horizontal_if_heliax_to_4at17: Option<ValueUnit>,
    #[serde(
        rename = "pathLossIFDRIFAntiAliasFilter",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_ifdrif_anti_alias_filter: Option<ValueUnit>,
    #[serde(
        rename = "pathLossIFDBurstAntiAliasFilter",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_ifd_burst_anti_alias_filter: Option<ValueUnit>,
    #[serde(
        rename = "pathLossWG02HarmonicFilter",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_wg02_harmonic_filter: Option<ValueUnit>,
    #[serde(
        rename = "transmitterPowerDataWattsFactor",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_power_data_watts_factor: Option<ValueUnit>,
    #[serde(
        rename = "pathLossWaveguideKlystronToSwitch",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_waveguide_klystron_to_switch: Option<ValueUnit>,
    #[serde(
        rename = "pulseWidthTransmitterOutputShortPulse",
        skip_serializing_if = "Option::is_none"
    )]
    pub pulse_width_transmitter_output_short_pulse: Option<ValueUnit>,
    #[serde(
        rename = "pulseWidthTransmitterOutputLongPulse",
        skip_serializing_if = "Option::is_none"
    )]
    pub pulse_width_transmitter_output_long_pulse: Option<ValueUnit>,
    #[serde(
        rename = "pathLossWG06SpectrumFilter",
        skip_serializing_if = "Option::is_none"
    )]
    pub path_loss_wg06_spectrum_filter: Option<ValueUnit>,
    #[serde(
        rename = "horizontalReceiverNoiseShortPulse",
        skip_serializing_if = "Option::is_none"
    )]
    pub horizontal_receiver_noise_short_pulse: Option<ValueUnit>,
    #[serde(
        rename = "horizontalReceiverNoiseLongPulse",
        skip_serializing_if = "Option::is_none"
    )]
    pub horizontal_receiver_noise_long_pulse: Option<ValueUnit>,
    #[serde(
        rename = "transmitterSpectrumFilterInstalled",
        skip_serializing_if = "Option::is_none"
    )]
    pub transmitter_spectrum_filter_installed: Option<String>,
}

/// Encapsulates adaptation data along with its reporting context.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdaptationInfo {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<String>,
    #[serde(rename = "reportingHost", skip_serializing_if = "Option::is_none")]
    pub reporting_host: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<AdaptationProperties>,
}