1"""Some common settings and functions."""
2
3from chart.project import SID
4from chart.common.exceptions import UnknownSIDError
5
6# Conversion Map for Satellite acronyms from SCID to SID
7PRIMARY_SCID_TO_SID_MAP = {
8 'SGA1': SID('SGA1'),
9 'SGB1': SID('SGB1'),
10 'SGxx': SID('SGxx'),
11 }
12
13# We may use a different may for some files from the secondary data source
14
15def scid_to_sid(fragment: str) -> "SID":
16 """Convert a SCID from a filename to a SID component.
17 We assume its come from the primary data source directory."""
18
19 if fragment not in PRIMARY_SCID_TO_SID_MAP:
20 raise UnknownSIDError(fragment, SID)
21
22 return PRIMARY_SCID_TO_SID_MAP[fragment]