fix: Improve remark decoding for ACC, VIRGA PTCHS, and PCPN VRY LGT

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-14 16:36:01 -07:00
parent d4e3a0e001
commit 5c51d8a7ef
+12 -3
View File
@@ -212,11 +212,12 @@
'CF': 'Cumulus Fractus', 'CF': 'Cumulus Fractus',
'FG': 'Fog', 'FG': 'Fog',
'SF': 'Stratus Fractus', 'SF': 'Stratus Fractus',
'SN': 'Snow' 'SN': 'Snow',
'ACC': 'Altocumulus Castellanus'
}; };
let decodedParts = []; let decodedParts = [];
const matches = code.matchAll(/([A-Z]{2})(\d)/g); const matches = code.matchAll(/([A-Z]{2,3})(\d)/g);
for (const match of matches) { for (const match of matches) {
const cloudCode = match[1]; const cloudCode = match[1];
@@ -305,7 +306,7 @@
}, },
// Cloud types summary // Cloud types summary
{ {
match: p => p[0].match(/^([A-Z]{2}\d)+$/), match: p => p[0].match(/^([A-Z]{2,3}\d)+$/),
decode: (p, ms) => ({ consumed: 1, text: ` - ${decodeCloudTypesRemark(p[0], ms)}` }) decode: (p, ms) => ({ consumed: 1, text: ` - ${decodeCloudTypesRemark(p[0], ms)}` })
}, },
// VIA // VIA
@@ -365,6 +366,9 @@
if (p.length > 1 && p[1] === 'ALQDS') { if (p.length > 1 && p[1] === 'ALQDS') {
return { consumed: 2, text: ` - VIRGA ALQDS: Virga in all quadrants` }; return { consumed: 2, text: ` - VIRGA ALQDS: Virga in all quadrants` };
} }
if (p.length > 1 && p[1] === 'PTCHS') {
return { consumed: 2, text: ` - VIRGA PTCHS: Virga in patches` };
}
if (p.length > 1 && isDirection(p[1])) { if (p.length > 1 && isDirection(p[1])) {
return { consumed: 2, text: ` - VIRGA ${p[1]}: Virga to the ${decodeDirection(p[1])}` }; return { consumed: 2, text: ` - VIRGA ${p[1]}: Virga to the ${decodeDirection(p[1])}` };
} }
@@ -398,6 +402,11 @@
return { consumed: 3, text: ` - DENSITY ALT ${altFeet}: Density altitude ${altitude} feet` }; return { consumed: 3, text: ` - DENSITY ALT ${altFeet}: Density altitude ${altitude} feet` };
} }
}, },
// PCPN VRY LGT
{
match: p => p[0] === 'PCPN' && p.length > 2 && p[1] === 'VRY' && p[2] === 'LGT',
decode: p => ({ consumed: 3, text: ` - PCPN VRY LGT: Very light precipitation` })
},
// PCPN remark // PCPN remark
{ {
match: p => p[0] === 'PCPN' && p.length > 3 && p[1].endsWith('MM') && p[2] === 'PAST' && p[3] === 'HR', match: p => p[0] === 'PCPN' && p.length > 3 && p[1].endsWith('MM') && p[2] === 'PAST' && p[3] === 'HR',