Created
November 7, 2025 19:54
-
-
Save phargogh/c14404abac7d3e178a022349913073bb to your computer and use it in GitHub Desktop.
Skeleton for a raster_map equation
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
| """Calculate work intensity with the Hothaps function. | |
| Written by request of @empavia to try out as a new work function for the InVEST Urban Cooling Model. | |
| To install dependencies, `mamba install pygeoprocessing`. | |
| """ | |
| import pygeoprocessing | |
| def calculate_work_intensity(target_raster, wbgt_raster, alpha1, alpha2): | |
| """Calculate work intensity with the Hothaps function. | |
| Args: | |
| target_raster (str): The path to the new work intensity raster being created. | |
| wbgt_raster (str): The path to an already-calulated Wet Bulb Globe Temp raster. | |
| alpha1 (float): The alpha1 parameter. | |
| alpha2 (float): The alpha2 paramter. | |
| Returns: | |
| ``None``. | |
| """ | |
| def _calculate_workability(wbgt): | |
| return 0.1 + (0.9/(1+((wbgt/alpha1)**alpha2))) | |
| pygeoprocessing.raster_map(_calculate_workability, [wbgt_raster], target_raster) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment