Repository navigation
feat: implement JD proxy's with CROPGRIDS area-share allocation - #27
Merged
Merged
Conversation
switch downsampling categorical from mode to nearest
TenaciousThee
approved these changes
Nov 4, 2026
TenaciousThee
left a comment
There was a problem hiding this comment.
Comments are more questions than blocking for merging. Therefore approving.
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.
Background
With FDaP and CROPGRIDS ingested, we can wire them together to formulate the JD proxy area-share allocation. This builds upon the 30m direct land conversion and emissions modeling which underlies the spatial statistical and jurisdictional direct allocation methods. This will be wired into trace (along with the necessary production crosswalk from FAOSTAT to CROPGRIDS) in the next PR, constituting the final stage of JD proxy in cornerstone.
The changes
I broke the changes into separate commits to hopefully streamline the understanding and review process:
NEARESTis an unbiased estimator which produces approximately the same results without all the hardwired connections. So this catalogues FDaP to categorical (which is correct) and swaps the downscale reduce from mode to neareststatistical, including attributing to crop/pasture first and then within those groups in a second pass. crop and livestock attribution are consistent withstatisticaland so are peatlands conversion and occupation modelsemitsince we updated the global crop maskNotes
10N_010W), whereasmodeloses about 6% of smallholder cocoa; since no datasets were downsampling bymodethis doesn't change any existing resultstracein the next PR. that will require special logic for FAOSTAT's production and crosswalking to (or from) CROPGRIDSManual validation
I ran
attributeforCIV:4.7 Mha) matchesCROPGRIDS' own total forCIV; FAOSTAT's total is4.3 Mhastatisticalandjdpboth calculateDROPPED ~ 49.5 Mt(vs67 Mtbefore FDaP) and commodities plusUNATTRIBUTED ~ 29.5 Mt