ADL FTP decoder for Kenya Meteorological Department (KMD) KCSAP AWS minute files
# ADL KMD KCSAP FTP Decoder
An ADL FTP decoder plugin for the Kenya Meteorological Department (KMD)
KCSAP automatic weather station network.
## Description
This repository contains a decoder for the generic ADL FTP plugin. It
registers the **KCSAP / KMD AWS** decoder (`kcsap`), which reads the per-minute CSV files the KCSAP loggers deliver
over FTP and turns them into ADL observation records.
ADL is a web based tool that automates periodic observation data collection from
different Automatic Weather Station (AWS) networks and pushes it to receiving systems.
**Requires** `adl-ftp-plugin` >= 0.10.0 to be installed in the ADL instance (for the *Populate Variable Mappings from
Decoder* action; decoding itself works with any version).
## File format
One file per station per minute, named `KMD_ _ .csv`, e.g. `KMD_001_202408241414.csv`. Each
file has exactly two lines:
```
KMD,001,202408241414
KMD,001,202408241414, 1,13.39, 18.4, 62.0, 0.0, 80.6, 826.4,/////,//////, 0,////,////,////,////,////,////,/////,/////,/////,/////,/////,/////, 2.47, 3.88,114.0,14:13:03,120.6,100.1,137.3
```
- Line 1 is a short preview; line 2 is the 32-field record. Files that do not have exactly two lines are skipped.
- The timestamp (field 3, `YYYYMMDDHHMM`) is **UTC**. Records are emitted with an aware UTC `observation_time`; ADL
localises it to the station link's timezone.
- Any field made of slashes (`////`, `/////` ...) is the feed's missing-value marker and decodes to `None`.
- Occasionally two records are glued into one line, joined by a literal `?KMD`; the decoder splits them.
- Field 29 (`HH:MM:SS`, time of the minute's peak gust) is discarded: gust speed and direction are stored as period
statistics at the record's minute timestamp, like every other field.
### Variables
All 157 KCSAP stations share the same layout, so the field map is fixed in the decoder (`decoders/kcsap.py`,
`VARIABLES`). Index is 0-based within the 32-field record.
| Index | File variable name | F …