Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about Calculation Method in Invest Urban Cooling Module (cc_park_ini.tif) #1726

Open
GuohuaHu opened this issue Dec 25, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@GuohuaHu
Copy link

I am using the Invest Urban Cooling module and noticed something strange when checking the intermediate results. The cc_park_ini.tif file seems to be calculated using green_area with an exponential distance weighting, rather than using cci. According to the documentation, the formula should be:

$CC_{park_i}=\sum_{j\in\ d\ radius\ from\ i} g_j \cdot CC_j \cdot e^{\left( \frac{-d(i,j)}{d_{cool}} \right)}$

However, after further inspection, I found the following code snippet in the source on GitHub:
https://github.com/natcap/invest/blob/main/src/natcap/invest/urban_cooling_model.py#L524

green_area_decay_kernel_distance = int(numpy.round(
        float(args['green_area_cooling_distance']) / cell_size))
cc_park_raster_path = os.path.join(
        intermediate_dir, f'cc_park{file_suffix}.tif')
cc_park_task = task_graph.add_task(
        func=convolve_2d_by_exponential,
        args=(
            green_area_decay_kernel_distance,
            task_path_prop_map['green_area'][1],
            cc_park_raster_path),
        target_path_list=[cc_park_raster_path],
        dependent_task_list=[
            task_path_prop_map['green_area'][0]],
        task_name='calculate T air')

This seems to indicate that green_area is being used in the calculation, not cci. Could I be misunderstanding the code? I would appreciate some clarification.

@davemfish
Copy link
Contributor

Hi @GuohuaHu , thanks for bringing this up. I agree that this seems like an error. As it is, cc_park.tif is simply an exponential decay of the green area map, which is a binary mask. It is not a product of cc.tif at all.

For the sample data,
cc.tif (cooling capacity) has a range of values from (0.138 - 0.839), while
cc_park.tif (allegedly, the exponentially decayed cooling capacity index, due to proximity to green areas) has a range of values from (0.0006 - 0.0041).

This does not make sense to me. @chrisnootenboom or @jagoldstein , would you be able to confirm that the cc_park.tif intermediate results are not logical?

@davemfish davemfish added the bug Something isn't working label Jan 6, 2025
@davemfish davemfish added this to the 3.14.4 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants