4/8 Feature GISA-new impervious surface - #41
Open
Timothy-W-Hilton wants to merge 6 commits into
Open
Conversation
added 6 commits
August 15, 2026 14:48
Add a public GISA-new manager that lazily loads tiled first-detection-year rasters, derives year-specific binary impervious-surface percentages, windows data before polygon clipping, and handles antimeridian mosaics.
Add conservative impervious-surface-area regridding to the VPRM preprocessor, retain the regridded field alongside other static inputs, and preserve it when compatible preprocessors are merged.
Add a reusable conservative ESMF regridding helper for regular xarray grids and route impervious-surface preprocessing through it. High-resolution GISA- derived ISA source grids can contain hundreds of millions of 30 m cells, exceeding an apparent ESMF mesh/indexing limit during single-grid conservative weight generation despite being geographically valid. The helper optionally divides a source grid into contiguous, non-overlapping y-axis strips below a configurable cell limit, generates and caches a separate ESMF weight file for each strip, regrids every strip to the complete satellite destination grid, fills unmapped contributions with zero, and sums the destination-area-normalized conservative results. This preserves the area ISA percentage expected by VPRM while retaining existing single-grid behaviour for smaller sources, supports cache reuse and restart after partial completion, and provides a general path for other very-high-resolution continuous ancillary datasets.
Allow SCRIP grid masks to be supplied to conservative regridding and pass a positive-ISA mask from impervious-surface preprocessing. ESMF now excludes zero-valued GISA source cells from weight generation, substantially reducing the active memory demand while preserving the intended zero contribution from non-impervious cells.
Restore the destination grid’s CRS and affine transform after xESMF returns a conservatively regridded dataset. This preserves spatial metadata on regridded outputs such as MODIS-grid GISA ISA fields, allowing them to be exported and interpreted correctly without changing any regridding values or weight files.
Add self-contained coverage for GISA-new detection-year conversion, zero-value source masking, source-grid partitioning and contribution summation, and preservation of destination CRS and affine transform. The tests replace ESMF and xESMF execution where appropriate, making the new regridding behavior reproducible without external data or a multi-hour weight-generation run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add scalable GISA-new impervious-surface preprocessing
Summary
Add support for preparing GISA-new impervious-surface data on a VPRM satellite grid. The implementation is designed for high-resolution sources that can exceed the practical source-grid size handled by one
ESMF_RegridWeightGeninvocation.What this adds
gisa_newsatellite manager for GISA-new GeoTIFF tiles.vprm_preprocessor.add_impervious_surface_area().impervious_surface_area.grid_imask, reducing ESMF memory use for sparse impervious-surface products.Why
For two New Zealand MODIS tiles, a full-resolution GISA-new source grid approached 391 million cells. A single ESMF weight-generation run failed near element ID 2^28 with a degenerate-element error. Splitting the source grid keeps each ESMF mesh below that practical limit while preserving conservative destination contributions. The mask is equally important because GISA is mostly zero over ocean and other non-impervious areas.
The resulting helper is intentionally general: any regular, high-resolution, sparse source field can use it when omitted source cells legitimately represent zero destination contribution.
Example
Validation
4 passed.