model.runtime.loaders.grid_data_loaderΒΆ

Grid data-loading helpers for ADELM.

Module ContentsΒΆ

ClassesΒΆ

GridDataLoader

Load and flatten gridded data for ADELM grid simulation.

DataΒΆ

APIΒΆ

class model.runtime.loaders.grid_data_loader.GridDataLoaderΒΆ

Bases: model.runtime.loaders.base_data_loader.BaseDataLoader

Load and flatten gridded data for ADELM grid simulation.

classmethod load_static_grid(path, var_names, lat_index=None, lon_index=None)ΒΆ
classmethod load_driver_month(path, var_names)ΒΆ
classmethod load_driver_variable(path, var_name, lat_index=None, lon_index=None)ΒΆ
classmethod load_coords(path)ΒΆ
classmethod load_time_values(path)ΒΆ
static clip_coords_to_bbox(lat, lon, bbox)ΒΆ
static clip_static(arr, lat_index=None, lon_index=None)ΒΆ
static clip_drivers(arr, lat_index=None, lon_index=None)ΒΆ
classmethod all_vars(path)ΒΆ
static resolve_name(nc_name, fcover_map, attris_map, params_map)ΒΆ
static flatten_static(arr, pixel_idx, device)ΒΆ
static flatten_drivers(arr, pixel_idx, device)ΒΆ
static unflatten_static(flat, grid_shape, pixel_idx)ΒΆ
static unflatten_layered(flat, grid_shape, pixel_idx)ΒΆ
static gapfill_interior(arr, passes=4)ΒΆ

Fill small interior NaN gaps by iterative finite-neighbour averaging.

Each pass replaces NaN cells that have at least one finite 8-neighbour with the mean of those neighbours. Bounded passes keeps large gaps (e.g. open ocean) NaN while filling the few-cell holes that some static layers (notably SoilGrids) have over wide rivers / water bodies / cities – holes that otherwise drop those cells from the valid-pixel mask and make the routed river vanish where it flows into them.

classmethod build_valid_pixel_mask(static_arrays)ΒΆ
model.runtime.loaders.grid_data_loader.__all__ΒΆ

[β€˜GridDataLoader’]