-Inf values in raster outputs of Coastal Blue Carbon Model

Hi James,

I’ve been getting -Inf values in some of the output rasters of the Coastal Blue Carbon Model (v 3.7). In other rasters, the high value is 3.40282e+38 and the low value is -3.40282e+38, neither of which is the NoData value of the input or output rasters. The model completes successfully, but I keep getting these errors. I’ve tried this on two different machines. When I switch from running this on windows 10 + ArcMap 10.4 to windows 7 + ArcMap 10.6.1, more -Inf values are produce and none of the rasters have the 3.40282e+38 values. In either case, ArcMap cannot compute the histogram so the true carbon values can’t be visualized.

The other strange thing is that I used the exact same input layers but with an earlier set of years (trying to compare what happens if restoration begins at different time points). All of the outputs looked fine using the earlier years with the exception of carbon stock in the start year, which had a low value of -Inf. I have a carbon stock raster of that year already, so I have been ignoring the -Inf in this particular layer, but now I’m wondering if it’s causing bigger problems down the line.

I’ve attached three log files:
Many -Inf later restoration 2050.txt (17.6 KB)
Many 3_40282e38 later restoration 2050.txt (17.4 KB)
Only 1 -Inf rearlier restoration 2030.txt (18.6 KB)

Hi Monica,

Very curious! I’ve taken a shot at patching this (since it seems related a thread on the old forums where the model wasn’t handling a reclassification case correctly). Would you mind trying out this development build and seeing if that does the trick?

https://storage.googleapis.com/natcap-dev-build-artifacts/invest/jdouglass/3.7.0.post32+h4d1ae7f5e3ea/InVEST_3.7.0.post32+h4d1ae7f5e3ea_x86_Setup.exe

Please do let me know if that doesn’t resolve the issue.

Thanks,
James

Hi James,

I tried it out and I got fewer -Inf values, but -Inf was still the low value for carbon stock in the start year and for net present value.

Monica

InVEST-Coastal-Blue-Carbon-log-2019-06-07–10_22_18.txt (9.82 KB)

Hmm I’m not quite sure what’s going on there, but nice to hear that some of the -inf pixels are at least taken care of. Could you send me your inputs for this run so I can take another look? Or are these the same data that you had sent previously?
Thanks!
James

Hi James,

I ran it again and now this build produces normal values for all rasters except for carbon stock raster of the start year, which has -1.#INF as the low value. I can look at the values for any individual cell in the raster and the -1.#INF values correspond to the NoData cells, and all the cells that do have data have values that make sense. However, ArcMap 10.6.1 won’t allow any computation of statistics for those rasters, which limits the ways I can work with them. Not sure if that’s something you can fix or if that’s an issue with ArcMap.

All of the other raster outputs produce normal values. Since my specific analysis focuses on the carbon sequestration instead of stock, those are the ones I care most about, so I’m able to keep going with this. Thanks for adding that calculation of net present value at multiple time points. That’s going to save me a lot of time!

I’ve attached my inputs and log file in separate messages to get around the size limit.

Monica

InVEST-Coastal-Blue-Carbon-log-2019-06-19–16_47_40.txt (12.6 KB)

input_tables.zip (13.2 KB)

I’ve been having trouble sending the input rasters due to their size, so I’ve made a link to them.

Thanks for your inputs, Monica! Glad the sequestration rasters are saving some time … hopefully future CBC users will find them useful as well :slight_smile:

For the initial raster, it looks like the -inf values are being caused by there not being some reclassification rules in the initial carbon pool table and the lulc lookup table. There should be an error raised instead of -inf values written to the output, but at least it’s a reproducible issue! I’ve added this to our issue queue so that we can address this in a future InVEST version.

I’ve added a few rows to two of your input tables (attached here) which looks like it’s enough for the model to no longer produce -inf values.

LULC_restore.csv (13.3 KB)
C_initial_restore.csv (15.8 KB)

Hope this helps!
James

Hi James,

Thanks for the addition! The outputs are working mostly okay in ArcGIS now. One thing I noticed is that if any cells are NoData at any time point but do have some sequestration at other time points (restoration happens), the total net carbon sequestration layer shows the cell as being NoData (and no sequestration) for the entire modelled time. This is technically correct in regards to adding the rasters, but it ignores that there is sequestration happening sometimes, leading to areas with missing sequestration in the total net sequestration raster. It could be useful to warn people about that in the documentation so they can prepare their input rasters with that in mind. In my case, I’ve been working with look at blue carbon habitat only and don’t contain information on what’s outside of the habitat footprint at any given time point, so the area of cells with actual data values changes with the extent of the habitat over time.

Ah, the nodata question is tricky! You’re right that CBC (and most in InVEST as well) treats a pixel stack with a nodata value in it as invalid since there isn’t enough information to complete a calculation if a required numeric value is missing. CBC is interesting because of the timesteps involved, and the concept of nodata could in theory take on a different meaning, or maybe that some sequestration would happen between some timesteps but then not at all outside of that range. I agree, that’s not particularly sensible. I’ll update the docs to mention this … thanks for the suggestion!