libera_utils.footprint_matching.sources.build_sources#
- libera_utils.footprint_matching.sources.build_sources(mode: OperationalMode, source_file_paths: dict[str, Sequence[Path]]) dict[str, AncillaryReader]#
Instantiate the readers active for
modeover their staged granules.Selects the active reader classes via
get_readers_for_mode()and instantiates each with the granule paths supplied insource_file_paths. This is the single construction path the product code calls, so the reader wiring lives in one place. Each reader checks at construction that its staged granules exist but opens none of them, so an unreadable staged file raises from the firstsamples_in()call that loads it.- Parameters:
mode (OperationalMode) – Operational mode whose active readers should be built.
source_file_paths (dict[str, Sequence[Path]]) – Mapping of reader registry key to the staged local granules for that source. Its keys must be exactly the readers active in
mode.
- Returns:
Reader registry key to instantiated reader, one entry per source active in
mode.- Return type:
- Raises:
KeyError – If
source_file_pathsholds a key for a sourcemodedoes not use, or is missing an entry for any active reader.TypeError – If an entry is a single
strorPathrather than a sequence of them.ValueError – If an entry holds no granule.
FileNotFoundError – If any staged granule path is not an existing file.