gedih3.logger#
Attributes#
Classes#
Functions#
|
|
|
|
|
Module Contents#
- gedih3.logger.PRODUCT_STATUS_INDEXED = 'INDEXED'#
- gedih3.logger.PRODUCT_STATUS_PARTIAL_NAN = 'PARTIAL_NAN'#
- gedih3.logger.PRODUCT_STATUS_MISSING_COLUMN = 'MISSING_COLUMN'#
- gedih3.logger.PRODUCT_STATUS_MISSING_SOURCE = 'MISSING_SOURCE'#
- gedih3.logger.PRODUCT_STATUS_FAILED = 'FAILED'#
- gedih3.logger.PRODUCT_STATUS_PENDING = 'PENDING'#
- class gedih3.logger.SOCDownloadLogger(product_vars, spatial=None, temporal=None, version=None, dir=None)[source]#
- gedi_version = None#
- s3_access = False#
- log_file#
- log_data#
- updating = False#
- new_spatial = None#
- new_temporal = None#
- new_product_vars = None#
- register_pending_granules(granule_list)[source]#
Register granules as PENDING. Called before download starts.
- Parameters:
- granule_listlist of dict
Each dict must have ‘orbit’, ‘granule’, ‘track’ keys.
- update_granule_status(gran_key, status)[source]#
Update status of a single granule (does NOT auto-save).
Caller controls save frequency via explicit save_log() calls.
- Parameters:
- gran_keydict
Dict with ‘orbit’, ‘granule’, ‘track’ keys.
- statusstr
‘DOWNLOADED’ or ‘FAILED’.
- set_post_download_info()[source]#
Scan SOC directory and record downloaded granules.
Refreshes
_soc_manifest.txtfirst so subsequentsoc_file_treecalls (here and on the next resume) skip the recursive glob over the SOC tree. This is the same pattern the H3 database uses viaMANIFEST_FILENAME.
- class gedih3.logger.H3BuildLogger(product_vars, spatial=None, temporal=None, res: int = 12, part: int = 3, version: int = None, dir=None, source_mode=None)[source]#
- default_products#
- log_file#
- log_data#
- updating = False#
- source_mode = None#
- build_start_time#
- previous_status#
- new_spatial = None#
- new_temporal = None#
- new_product_vars = None#
- register_pending_granules(granule_list)[source]#
Register granules as PENDING. Called before build starts.
- Parameters:
- granule_listlist of dict
Each dict must have ‘orbit’, ‘granule’, ‘track’ keys.
- update_granule_status(gran_key, status)[source]#
Update status of a single granule (does NOT auto-save).
Caller controls save frequency via explicit save_log() calls.
- Parameters:
- gran_keydict
Dict with ‘orbit’, ‘granule’, ‘track’ keys.
- statusstr
‘INDEXED’ or ‘PENDING’.
- get_finished_granules()[source]#
Return skip list when resuming with same filters.
Only returns successfully completed granules, with the status and products fields stripped for backward compatibility with
_filter_granules()dict comparison (which expects bare{'orbit', 'granule', 'track'}dicts). Legacy logs without status fields are treated as successful.
- is_up_to_date()[source]#
Check if database already matches requested parameters.
Returns True when all of these hold: - Log exists (updating=True) - No new products, spatial, or temporal changes detected - No pending variable update from a previous crash - All tracked granules are INDEXED
- get_granule_product_status(gran_key, product)[source]#
Return per-product status for a granule, or None if unknown.
- Parameters:
- gran_keydict or tuple
Either
{'orbit', 'granule', 'track'}or(orbit, granule, track).- productstr
Product code (e.g. ‘L4A’).
- get_product_gaps(active_products=None, gap_statuses=None)[source]#
List granules where any active product is not INDEXED.
Returns a list of
(gran_key_dict, [missing_products])pairs. Used by gh3_doctor as the fast-path audit (log-only, no parquet scan).- Parameters:
- active_productsiterable of str, optional
Products to check. Defaults to
self.product_vars.keys().- gap_statusesiterable of str, optional
Per-product statuses considered as gaps. Defaults to everything except
INDEXED(i.e. PARTIAL_NAN, MISSING_COLUMN, MISSING_SOURCE, FAILED, PENDING).