feat: Add support for decoding obscuration remarks like FG8

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-14 15:22:01 -07:00
parent 47f9e8aa41
commit 7e6475c09a
+18
View File
@@ -208,12 +208,30 @@
return `${code}: ${decodedParts.join(', ')}`;
}
function decodeObscurationRemark(code) {
const weatherMap = {
'FG': 'Fog',
'BR': 'Mist',
'FU': 'Smoke',
'HZ': 'Haze',
'DU': 'Widespread dust',
'SA': 'Sand',
};
const weatherCode = code.substring(0, 2);
const oktas = code.substring(2);
const weatherName = weatherMap[weatherCode];
return `${code}: ${weatherName} obscuring ${oktas}/8 of the sky`;
}
function decodeRemarks(parts) {
let decoded = ["RMK: Remarks"];
const weatherRegex = /^([+-]|VC)?(MI|PR|BC|DR|BL|SH|TS|FZ|DZ|RA|SN|SG|IC|PL|GR|GS|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|TR)+$/;
const obscurationRegex = /^(FG|BR|FU|HZ|DU|SA)\d$/;
parts.forEach(part => {
if (part.startsWith('SLP')) {
decoded.push(` - ${decodeSlp(part)}`);
} else if (obscurationRegex.test(part)) {
decoded.push(` - ${decodeObscurationRemark(part)}`);
} else if (part.match(/^([A-Z]{2}\d)+$/)) {
decoded.push(` - ${decodeCloudTypesRemark(part)}`);
} else if (weatherRegex.test(part)) {