Skip to content

feat: implement JD proxy's with CROPGRIDS area-share allocation - #27

Merged
jeffseif merged 9 commits into
mainfrom
jeffseif/jd-proxy-allocation
Nov 4, 2026
Merged

jeffseif merged 9 commits into
mainfrom
jeffseif/jd-proxy-allocation

Conversation

@jeffseif

@jeffseif jeffseif commented Nov 4, 2026

Copy link
Copy Markdown
Member

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:

  • 0d2a02c originally, the thought was that we needed to take the mean of the 10m FDaP crop mask when downscaling to the 30m GLAD grid ... but it turns out that NEAREST is 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 nearest
  • b7a6dd0 extend the global crop mask with FDaP and ensure we are able to track both of its crops in the destination bitmask
  • 6e6d367 gather all the prerequisites for computing area share, along with all of the component emissions and downscaled them all to the CROPGRIDS grid
  • f9d601c implement area-share allocation. the patterns are heavily borrowed from statistical, including attributing to crop/pasture first and then within those groups in a second pass. crop and livestock attribution are consistent with statistical and so are peatlands conversion and occupation models
  • 21a7f73 update docs (including stubs for the not-yet-implemented trace/production logic)
  • 0d983b2 bust caches downstream of emit since we updated the global crop mask

Notes

  1. I measured (via claude) that nearest keeps FDaP's masked area (~0.9995 on 10N_010W), whereas mode loses about 6% of smallholder cocoa; since no datasets were downsampling by mode this doesn't change any existing results
  2. we'll wire through to trace in the next PR. that will require special logic for FAOSTAT's production and crosswalking to (or from) CROPGRIDS
  3. We went with "jurisdictional direct proxy" for the name rather than a more descriptive name. Hopefully that doesn't cause confusion down the road!

Manual validation

I ran attribute for CIV:

  • the propagated cocoa crop area (4.7 Mha) matches CROPGRIDS' own total for CIV; FAOSTAT's total is 4.3 Mha
  • statistical and jdp both calculate DROPPED ~ 49.5 Mt (vs 67 Mt before FDaP) and commodities plus UNATTRIBUTED ~ 29.5 Mt

@TenaciousThee TenaciousThee left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are more questions than blocking for merging. Therefore approving.

Comment thread docs/methodology.md Resolved
Comment thread jdluc/datasets/fdap.py Resolved
Comment thread jdluc/jurisdictional_direct_proxy.py Resolved
Comment thread jdluc/jurisdictional_direct_proxy.py Resolved
Comment thread jdluc/jurisdictional_direct_proxy.py Resolved
Comment thread jdluc/jurisdictional_direct_proxy.py Resolved
Comment thread jdluc/jurisdictional_direct_proxy.py Resolved
@jeffseif
jeffseif merged commit 2296f18 into main Nov 4, 2026
2 checks passed
@jeffseif
jeffseif deleted the jeffseif/jd-proxy-allocation branch November 4, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants