7/8 Add UrbanVPRM model and reference-EVI preprocessing - #44
Open
Timothy-W-Hilton wants to merge 5 commits into
Open
7/8 Add UrbanVPRM model and reference-EVI preprocessing#44Timothy-W-Hilton wants to merge 5 commits into
Timothy-W-Hilton wants to merge 5 commits into
Conversation
added 5 commits
August 15, 2026 16:00
Add the UrbanVPRM model subclass and its constructor-level configuration for urban VPRM classes, UHI temperature adjustment, and reference-EVI selection. Later commits implement the UrbanVPRM driver and respiration calculations.
Extract the existing base-VPRM GPP and respiration equations into protected calculation hooks while preserving the shared prediction loop and output assembly. Add a numerical regression test to confirm the new hooks produce the same xarray results as the former inline expressions, creating a focused override point for UrbanVPRM.
Replace the UrbanVPRM scaffold with a model that applies configurable UHI-adjusted temperature, normalized ISA, and local reference EVI to urban and transport classes while retaining base-VPRM behavior elsewhere. Implement Hardiman Supplement Eqs. 6–8 for respiration, require explicit UHI adjustment input, and add a numerical regression test. Hardiman, B. S., Wang, J. A., Hutyra, L. R., Gately, C. K., Getson, J. M., & Friedl, M. A. (2017). Accounting for urban biogenic fluxes in regional carbon budgets. Science of The Total Environment, 592, 366–372. https://doi.org/10.1016/j.scitotenv.2017.03.028
Cache validated ISA and nearest-reference minimum EVI for each UrbanVPRM model instance, and cache current reference EVI by selected MODIS composite. This avoids repeated whole-tile reference gathers for each urban class and hour while refreshing correctly when the satellite-image counter changes. Add coverage for ISA bound handling, coordinate-safe vectorized lookup, cache reuse, and composite refresh.
Add cached per-composite dynamic selection of the nearest zero-ISA vegetated cell with positive EVI, retain static selection as a fallback, and return missing respiration rather than magnifying a zero reference EVI. Record annual extrema for selected static references and add regression coverage for reference changes between satellite composites.
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 UrbanVPRM model and reference-EVI preprocessing
Summary
Add an initial UrbanVPRM extension of the standard VPRM model. It applies the impervious-surface-area (ISA), reference-EVI respiration treatment, and UHI-adjusted temperature drivers from Hardiman et al. (2017), while preserving ordinary VPRM calculations for every non-urban class.
Design
Base-model extension points
The base model now exposes protected GPP and respiration calculation hooks. The existing classwise loop and output assembly remain in the base model. This lets an extension override only the class-specific flux calculation it needs, without duplicating the VPRM prediction workflow.
Urban preprocessing
urban_vprm_preprocessor(vprm_preprocessor)builds a static reference EVI lookup for each satellite-grid cell:ISA itself is supplied on the satellite grid by a compatible preprocessing step. The separate GISA-new PR #41 provides one such workflow; this PR does not tie UrbanVPRM to a particular ISA product.
Urban flux model
vprm_urban_model(vprm_base_model):By default, dynamic EVI reference selection finds the nearest eligible cell with finite positive EVI for the current satellite image. The result is cached until the image changes. This avoids using an ISA-zero reference whose EVI is currently cloud-masked or zero while avoiding repeated work for every modelled hour in the same satellite image.
Example
The identity callable in this example represents an explicit zero-UHI assumption; applications should provide a suitable local parameterization when one is available.
Validation
5 passed.