-
Notifications
You must be signed in to change notification settings - Fork 81
Carbon model requires aligned input rasters (rather than aligning/resizing rasters itself) #1836
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
Comments
I like your intention here, but I suppose the reason it's like this now is to ensure that the LULC pixels are reasonable representations of reality. If the model were to realign (and/or resize) pixels, the realigned rasters may be inaccurate, such as if a user obtains LULCs for the two different years from different sources. The way it is now puts the responsibility on the user to critically assess their inputs, which I believe is best. |
Hm... Jesse makes a good point that the way it is now forces users to pay attention to their input maps, which is generally a good thing. The carbon model is so simple that any misalignment with the inputs can be obvious in the outputs, and it would be on the user to deal with that. We can automagically align their layers like we do in other models, but while doing that does make the individual pixels line up, it does not sanity check that any shifting that happens to the alternate LULC shifts pixels in the correct way, so that, say, the same urban street corner pixel appears in the same place in both maps (not off by a pixel in some direction). I've had this issue with freshwater models that do automatic alignment to the DEM, where the result maps are shifted a bit from the original LULC, then it's hard to overlay and compare (especially if you're working in a small area and/or coarse resolution where the individual pixels are obvious). So I can see where it's temping to auto-align, since that's consistent with other models, and is one less burden for the user. And I also know that the auto-aligning can cause problems. We don't actually address the alignment thing in the User Guide, and usually it's not a big deal, except when it is. How does Blue Carbon handle it? That's the other model I can think of that takes a series of land cover maps at different times (but it has more actual modeling going on). |
Ah that makes sense, I wasn't thinking about it that way since it does seem like most models do the alignment/resizing for the user (Coastal Blue Carbon also does align and resize the LULC rasters). I am curious if the alignment preprocessing that most users would do would be meaningfully different than the alignment we could do for them? Or, if we do have recommendations on how to ensure a user's rasters are properly aligned in a way that reduces the risk of bad pixel shifting, perhaps we could add these to the user's guide? |
I'd be curious to know more about this too! For other InVEST models, certainly one thing we could do a better job of at the moment is explicitly stating which layer is used as the baseline for aligning. We haven't always been consistent with this. |
It sounds like it's time to do an experiment in model input aligning, and compare the model's result to me doing the aligning manually. Also to see what happens when I put my intentionally-aligned layers into the model, do they change? Here's what I usually do, which is pretty simple. Let's say we're talking about current and alternate LULC for Carbon. It happens early in the layer preparation process, often when reprojecting (or, if the layer doesn't need to be reprojected, just exporting to create a new aligned layer).
It seems like steps 1 and 3-5 could be automated, and perhaps that's what InVEST actually does? It's the sanity checking of step 6 and fussing of step 7 that really needs a human.
Totally agreed.
Also agreed. I'd want to go through the process of understanding exactly what InVEST does, so we can inform the user, as well as make recommendations for pre-aligning that are specific to both Arc and QGIS. |
The carbon model currently requires that the baseline and alternate LULC rasters be exactly aligned. The model will throw an error if these 2 rasters have different pixel sizes or dimensions. Is there a reason why we require users to provide perfectly aligned input rasters, or could we ease this requirement and instead use
pygeoprocessing.align_and_resize_raster_stack
based on the baseline LULC raster?@jagoldstein @newtpatrol @dcdenu4
The text was updated successfully, but these errors were encountered: