gedih3.logger#

Attributes#

Classes#

Functions#

load_log_data(file_path)

merge_temporal(existing, new)

merge_product_vars(existing_product_vars[, ...])

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'#
gedih3.logger.load_log_data(file_path)[source]#
gedih3.logger.merge_temporal(existing, new)[source]#
gedih3.logger.merge_product_vars(existing_product_vars, new_product_vars=None)[source]#
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.txt first so subsequent soc_file_tree calls (here and on the next resume) skip the recursive glob over the SOC tree. This is the same pattern the H3 database uses via MANIFEST_FILENAME.

get_finished_granules()[source]#

Return skip list when resuming with same filters.

Only returns successfully completed granules, with the status field stripped for backward compatibility with _filter_granules() dict comparison. Legacy logs without status fields are treated as successful.

get_temporal()[source]#
get_spatial()[source]#
get_product_vars()[source]#
to_dict(status)[source]#
save_log(status)[source]#
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#
get_temporal()[source]#
get_spatial()[source]#
get_product_vars()[source]#
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

set_post_build_info()[source]#
to_dict(status)[source]#
save_log(status)[source]#
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).

mark_granule_product(gran_key, product, status)[source]#

Set per-product status for a granule (does not auto-save).

Caller is responsible for invoking save_log() to persist. Used by gh3_doctor after a fix or verification step.