libera_utils.footprint_matching.readers.registry.ReaderRegistry#
- class libera_utils.footprint_matching.readers.registry.ReaderRegistry#
Bases:
objectPlugin registry mapping string keys to AncillaryReader subclasses.
This is a stateless class (all methods are static) that wraps a module-level
_registrydict. Readers register themselves automatically when their module is imported via the__init_subclass__hook in AncillaryReader. Manual registration is neither necessary nor recommended.Examples
>>> import libera_utils.footprint_matching.readers # triggers registration >>> ReaderRegistry.list_readers() ['CLDPIX', 'ERA5_Pressure', 'ERA5_Surface', 'FLASHFlux', 'IGBP', 'NISE', 'VIIRS_AOD', 'VIIRS_BRDF', 'VIIRS_CLDPROP_D3'] >>> ReaderRegistry.get("IGBP").__name__ 'IGBPReader'
- __init__()#
Methods
get(name)Return the reader class registered under
name.get_readers_for_mode(mode)Return the readers that contribute to a product's definition.
Return a sorted list of all registered reader keys.
- _registry: dict[str, type[AncillaryReader]] = {'CLDPIX': <class 'libera_utils.footprint_matching.readers.cldpix.CLDPIXReader'>, 'ERA5_Pressure': <class 'libera_utils.footprint_matching.readers.era5_pressure.ERA5PressureLevelReader'>, 'ERA5_Surface': <class 'libera_utils.footprint_matching.readers.era5_surface.ERA5SurfaceReader'>, 'FLASHFlux': <class 'libera_utils.footprint_matching.readers.flashflux.FLASHFluxReader'>, 'IGBP': <class 'libera_utils.footprint_matching.readers.igbp.IGBPReader'>, 'NISE': <class 'libera_utils.footprint_matching.readers.nsidc.NISEReader'>, 'VIIRS_AOD': <class 'libera_utils.footprint_matching.readers.aod.VIIRSAODReader'>, 'VIIRS_BRDF': <class 'libera_utils.footprint_matching.readers.brdf.VIIRSBRDFReader'>, 'VIIRS_CLDPROP_D3': <class 'libera_utils.footprint_matching.readers.viirs.VIIRSCldpropD3Reader'>}#
- static get(name: str) type[AncillaryReader]#
Return the reader class registered under
name.
- static get_readers_for_mode(mode: OperationalMode) dict[str, type[AncillaryReader]]#
Return the readers that contribute to a product’s definition.
Membership is read from
FMATCH_MODE_READERS, which is derived from the built-in readers’VariableSpec.modes.- Parameters:
mode (OperationalMode) – The operational mode (product) whose readers to return.
- Returns:
Mapping of registry key to reader class for every reader in the product’s set. Only the built-in readers are returned; readers other code registers after the package import are not included.
- Return type:
Examples
>>> from libera_utils.footprint_matching.types import OperationalMode >>> import libera_utils.footprint_matching.readers # triggers registration >>> sorted(ReaderRegistry.get_readers_for_mode(OperationalMode.CAM)) ['IGBP', 'NISE', 'VIIRS_CLDPROP_D3'] >>> imager = ReaderRegistry.get_readers_for_mode(OperationalMode.IMAGER) >>> 'CLDPIX' in imager and 'ERA5_Pressure' in imager # RBSP alongside ERA5 True >>> camtime = ReaderRegistry.get_readers_for_mode(OperationalMode.IMAGER_CAMTIME) >>> 'ERA5_Pressure' in camtime # pressure-level ERA5 is radiometer-timescale only False