FM 34-81-1 MILITARY WEATHER INTELLIGENCE
00 Pipeline Overview 01 Taking In Data 02 Doctrine Processing 03 DuckDB & Parquet Storage 04 Calling Data & Pushdown 05 Display & Delivery
🧭 00. END-TO-END TELEMETRY ARCHITECTURE

The system operates as an autonomous, low-overhead edge telemetry pipeline deployed on a Raspberry Pi (ARM64). It bridges live meteorological sensors and numerical models directly into tactical operational decision matrices conforming to FM 34-81-1 and TB MED 507/81.

STEP 01
πŸ›°οΈ
Ingest & Collect
Batched Open-Meteo numerical predictions + NOAA Aviation Weather Center live METAR airfield observations.
Open-Meteo • NOAA AWC METAR • OOB Table
→
STEP 02
βš–οΈ
Doctrinal Processing
Calculates sWBGT thermal stress, flight categories, and trafficability; evaluates Aviation, Ground, and Dismounted thresholds.
FM 34-81-1 • TB MED 507 • TB MED 81
→
STEP 03
πŸ¦†
Time-Series Storage
Batch-inserts into DuckDB append-only table (15 columns) and archives to Snappy-compressed monthly Parquet.
DuckDB • Apache Parquet • Snappy Codec
→
STEP 04
⚑
Predicate Pushdown
Historical queries on base_id & timestamp_zulu pushed directly to columnar scanners, skipping disk I/O.
REST Endpoints • DuckDB Engine • Parquet Pushdown
→
STEP 05
πŸ–₯️
Tactical Delivery
Interactive web dashboard, 24h/7d telemetry drawer, Matplotlib charts, Piper TTS audio, and two-way Signal alerts.
Flask/Waitress • Piper TTS • Signal-CLI
πŸ›°οΈ 01. TAKING IN DATA: MULTI-SOURCE INGESTION ENGINE

1.1 Dual-Feed Meteorological Sourcing

Modern military decision-making demands both high-resolution forward projections and legally authoritative, certified airfield observations. The system queries two primary data providers simultaneously:

  • Open-Meteo Numerical Weather Prediction (NWP): Queries surface temperature, apparent temperature, relative humidity, precipitation, weather code (WMO), surface pressure, wind vectors, wind gusts, cloud cover layers (low/mid/high), cloud base, solar direct radiation, and 7-day numerical forecast projections.
  • NOAA Aviation Weather Center (AWC) Live METARs: Official METAR observations from co-located military and joint-use airfields (e.g., KPOB at Fort Liberty, KHLR at Fort Cavazos, KFBG at Fort Moore, EDDN for USAG Bavaria). Provides certified ceiling, runway visibility, flight categories, altimeter settings, and present weather codes.
  • Order of Battle (OOB) Enrichment: Every observation is joined with installations_oob.json to attach the host command (e.g., FORSCOM, USARPAC, USAREUR-AF), tenant combat formations, primary weapon platforms (Apache, Abrams, HIMARS), and mission profile.

1.2 Batch Query Optimization & Network Fallback

Batch Coordinate Query Strategy PYTHON / HTTP
# All 43 installation coordinates queried in 1 single HTTP GET
params = {
    "latitude": "41.3918,35.1391,31.1352,...",
    "longitude": "-73.9563,-79.0060,-97.7758,...",
    "current": "temperature_2m,dew_point_2m,relative_humidity_2m,"
               "wind_speed_10m,wind_gusts_10m,visibility,cloud_cover",
    "hourly": "temperature_2m,dew_point_2m,cloud_base,direct_radiation",
    "forecast_days": "7",
    "timezone": "auto"
}
# Typical execution: ~1.2s across all 43 installations worldwide

Network Resilience: If the primary batched request fails due to temporary connection drops on the Pi, the engine automatically falls back to sequential per-base queries with exponential backoff (retrying at 2s, 4s, and 8s).

βš–οΈ 02. PROCESSING DATA: DOCTRINAL RISK EVALUATION ENGINE

Raw numbers (e.g., "18 km/h wind" or "28Β°C") are meaningless without operational military context. In doctrine.py, raw metrics are mapped into tactical units (knots, feet AGL, statute miles) and evaluated against authoritative Department of the Army doctrine.

FM 34-81-1

1. Aviation / Rotorcraft

Evaluates flight envelope limits for Army aviation platforms (UH-60, AH-64, CH-47):

NO-GO: Gusts ≥ 35 kts • LIFR (Ceiling < 500' or Vis < 1 SM) • Thunderstorms / Freezing Rain
CAUTION: Gusts 25–34 kts (Sling loads halted) • IFR/MVFR (Ceiling ≤ 3,000' or Vis ≤ 5 SM)
GO: VFR (Ceiling > 3,000' AND Vis > 5 SM) • Gusts < 25 kts
FM 34-81-1

2. Ground Maneuver

Evaluates soil trafficability and target acquisition for armored & motorized forces:

NO-GO: Current rain > 10 mm/hr • 24h rain ≥ 25 mm (soil saturation/bogging) • Vis < 1 km
CAUTION: Rain 2.5–10 mm/hr • 24h rain 10–24.9 mm • Vis 1–4 km • Wind ≥ 40 km/h (dust)
GO: Dry ground • Rain < 2.5 mm/hr • Vis > 4 km • Sustained wind < 40 km/h
TB MED 507 & 81

3. Dismounted Infantry

Calculates thermal injury risk and outdoor physical activity controls:

NO-GO: WBGT ≥ 90Β°F / 32.2Β°C (Black Flag / Cat 5) • Severe Cold ≤ 0Β°F / -18Β°C • Lightning Strike Threat
CAUTION: WBGT 85–89.9Β°F (Yellow/Red Flag, mandatory 30/30 work/rest) • Freezing ≤ 32Β°F / 0Β°C
GO: Temperate (WBGT < 82Β°F) • Continuous work/rest cycles apply
Mathematical Derivation: Simplified Wet Bulb Globe Temperature (sWBGT)
\[ e = \left(\frac{\text{RH}}{100}\right) \times 6.105 \times \exp\left(\frac{17.27 \times T_a}{237.7 + T_a}\right) \] \[ \text{sWBGT} = 0.567 \times T_a + 0.393 \times e + 3.94 \]
Where \(T_a\) is ambient dry-bulb temperature in Β°C, \(\text{RH}\) is relative humidity percentage, and \(e\) is water vapor pressure in hectopascals (hPa). This standardized Australian Bureau of Meteorology / ACSM formula models environmental heat stress when co-located globe sensors are not installed.
Worst-Case Doctrinal Rollup Rule: If any of the three operational branches evaluates to NO-GO, the installation's overall posture is flagged as NO-GO, and the primary constraint is extracted as the Limiting Factor.
πŸ¦† 03. HOW DATA IS STORED: DUCKDB & APACHE PARQUET

Previously, time-series history was accumulated in an unbounded JSON file that grew to thousands of lines. To optimize storage, reduce microSD card wear, and accelerate analytical queries on the Raspberry Pi, the system replaced raw JSON history with an embedded DuckDB analytical engine and automatic Apache Parquet archival.

3.1 Append-Only Relational Schema (weather_observations)

Every hourly collection run extracts a strictly typed 15-column observation record and performs a batch insert:

Column Name SQL Type Physical Unit Doctrinal / Tactical Purpose
base_id VARCHAR Identifier Unique installation key (e.g. usma_west_point, fort_liberty)
timestamp_zulu TIMESTAMP UTC DateTime Standardized Zulu observation epoch for time-series alignment
temp_c FLOAT Β°Celsius Surface ambient temperature (METAR / Open-Meteo)
dew_point_c FLOAT Β°Celsius Dew point temperature (Magnus-Tetens calculation or METAR)
rel_humidity FLOAT % (0–100) Surface relative humidity for thermal stress & fog formation
wind_speed_kts FLOAT Knots (kt) Sustained 10-meter surface wind speed
wind_gust_kts FLOAT Knots (kt) Peak wind gusts (checked against 25 kt and 35 kt limits)
ceiling_agl_ft INTEGER Feet AGL Lowest cloud ceiling above ground level (checked against 500' / 1,000')
visibility_sm FLOAT Statute Miles Surface horizontal visibility (checked against 1.0 SM / 3.0 SM)
wbgt_c FLOAT Β°Celsius Derived Wet Bulb Globe Temperature for heat category determination
heat_category VARCHAR Flag Category TB MED 507 flag category (Category 1 through Category 5)
aviation_posture VARCHAR Status Badge Rotary & fixed-wing flight operational status (GO, CAUTION, NO-GO)
ground_posture VARCHAR Status Badge Ground maneuver & trafficability status (GO, CAUTION, NO-GO)
infantry_posture VARCHAR Status Badge Dismounted infantry heat & cold stress status (GO, CAUTION, NO-GO)
limiting_factor VARCHAR Text String Specific doctrinal threshold that triggered the caution or hazard status
PARQUET ARCHIVAL

Monthly Partitioned Parquet

After batch insertion into DuckDB, data is automatically exported to Snappy-compressed Parquet files organized in Hive-style directory partitions:

Partition Hierarchy
data/history/
β”œβ”€β”€ year=2026/
β”‚   β”œβ”€β”€ month=08/
β”‚   β”‚   └── data_0.parquet  (Snappy compressed)
β”‚   └── month=09/
β”‚       └── data_0.parquet  (Snappy compressed)

Snappy Compression: Achieves a >85% compression ratio compared to raw JSON while enabling zero-decompression random seek access.

CRASH RESILIENCE

Raspberry Pi MicroSD Card Protection

Raspberry Pi single-board computers often suffer unexpected power losses. The storage architecture incorporates dual-layer write safety:

  • DuckDB WAL (Write-Ahead Logging): In-flight transactions are committed with ACID durability to ensure database integrity.
  • Atomic Snapshot Write: Dashboard state is written to data.json.tmp, flushed with os.fsync to physical flash media, and moved via atomic os.replace.
  • Automated Fallback (.bak): If primary storage is ever compromised, the system automatically recovers from the backup.
⚑ 04. HOW DATA IS CALLED: PREDICATE PUSHDOWN & REST APIS

4.1 What is Predicate Pushdown?

In traditional database querying, all rows from disk are loaded into RAM before applying a WHERE filter. On a Raspberry Pi, this wastes CPU cycles and exhausts memory.

With Predicate Pushdown, DuckDB pushes the filter conditions directly into the storage scan operator:

❌ Traditional Naive Query
Read ALL parquet blocks → Load 500,000 rows into RAM → Filter for Fort Liberty → Return 24 rows. High I/O & memory spikes.
βœ… Predicate Pushdown (DuckDB)
Push base_id = 'fort_liberty' down to Parquet metadata → Skip 98% of row groups without reading them → Read only relevant rows.
Verified DuckDB EXPLAIN Plan SQL EXPLAIN
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             READ_PARQUET            β”‚
β”‚  Function: READ_PARQUET             β”‚
β”‚  Projections: base_id, temp_c, ...  β”‚
β”‚  Filters: base_id = 'usma_west_pointβ”‚  <-- PUSHED DOWN!
β”‚  Partition Filter: year='2026'      β”‚  <-- SKIPS OTHER YEARS!
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

4.2 Historical REST API Endpoints

GET
/api/base/<base_id>/logs
Returns 24-hour observation logs with predicate pushdown. Powers the Installation Detail Drawer.
GET
/api/base/<base_id>/trends
Returns 7-day tactical trend analysis, min/max/avg temperature, peak gusts, and posture breakdown.
GET
/api/base/<base_id>/history?hours=48&source=parquet
Arbitrary time-window querying with source selection (auto, duckdb, or parquet).
GET
/api/export-toc?theater=CONUS&status=CAUTION_NOGO
Generates a downloadable CSV matrix of filtered installations for staff officer briefings.
INTERACTIVE LIVE QUERY CONSOLE (Test DuckDB & Parquet in Real Time)
LIVE SANDBOX
Ready. Select parameters and click "Execute Query".
// Live JSON output from DuckDB/Parquet engine will be rendered here...
πŸ–₯️ 05. HOW DATA IS DISPLAYED: COMMAND INTERFACES & DECISION DELIVERY
πŸ“‹

Installation Detail Drawer

An off-canvas side drawer that slides in when clicking "⏱ Logs" on any installation card. Directly calls /api/base/<id>/logs and /api/base/<id>/trends, presenting 24-hour tabular readings and 7-day posture breakdown bars without requiring a full page reload.

πŸ—‚οΈ

Dual-Mode Command Directory

The main landing page serves tactical officers with an instant dual-mode switcher: a rich Card Grid with individual 7-day forecast outlook strips, and a compact High-Density Table for TOC display boards with multi-column alphabetical and numeric sorting.

πŸ“Š

Server-Side Trend Graphics

Rendered using Matplotlib's non-interactive Agg backend, producing 24-hour multi-variable tactical plots (temperature, apparent heat, wind gusts, precipitation). Enforces a strict 48-hour pruning policy to protect microSD storage.

πŸ”Š

Offline Synthetic Speech (Piper TTS)

Converts Bottom Line Up Front (BLUF) briefings into natural spoken English audio using an offline ONNX neural model (en_US-lessac-medium). Stored as unique per-base/per-date audio files ({base_id}_{date}.wav) with 48h rotation.

πŸ“Ά

Signal Two-Way Verification

Verified subscribers receive daily tactical briefings and attached audio via signal-cli. Inbound web subscriptions trigger a verification challenge requiring a "YES" reply, polled every 5 minutes by a dedicated background daemon.

πŸ“…

Historical D-Day Analog Tracker

An Operation Overlord comparative scoring tool that continuously scores current installation forecasts against the historic June 6, 1944 invasion threshold constraints (winds ≤ 15 kt, ceiling ≥ 2,500 ft).