DRAFT: ycx_build_rasters.R emits AGC values (unblocks carbon-by-ecoregion)#85
Draft
holoros wants to merge 1 commit into
Draft
DRAFT: ycx_build_rasters.R emits AGC values (unblocks carbon-by-ecoregion)#85holoros wants to merge 1 commit into
holoros wants to merge 1 commit into
Conversation
So carbon can be summarized by ecoregion downstream instead of only shown as a PNG. Adds, after the existing PNG render: a per-plot AGC table (lon/lat/state/agc) for dependency-free point-in-polygon zonal stats, and georeferenced GeoTIFFs of the binned agc2022/dagc100 grids when terra is available. Faithful to the existing agc0/dagc computation — no new data. UNRUN: the script still depends on membership_slim.csv, which is not currently present in yield_curves_conus; regenerate it before running. CRS caveat documented (this grid is lat_0=38 spherical vs the 37.5 ellipsoidal grid of the ph_*/structure rasters). R parses clean.
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.
Status: DRAFT — unrun, needs verification. Do not merge as-is.
What
Makes
ycx_build_rasters.Remit the values behind the carbon overlay, not just the display PNG, so carbon (and the 100-yr change) can be summarized by EPA L3 ecoregion the same way harvest / structure / CSPI already are. Added after the existing PNG render block:hybrid_agc_perplot.csv— per-plot AGC density (Mg C/ha) with lon/lat/state. Enables dependency-free point-in-polygon zonal stats by ecoregion (the same approach used for the other ecoregion layers), no GDAL needed.conus_hybrid_agc2022.tif+conus_hybrid_dagc100.tif— georeferenced GeoTIFFs of the binned grids, written only whenterrais available (guarded so the no-terra path is unchanged).It is faithful to the existing
agc0/dagccomputation — it saves the same numbers the deployed PNG already draws. Nothing is fabricated and nopublic/api/data changes.Why it's a draft (two things to resolve before running/merging)
membership_slim.csv(the per-plot FIA/TreeMap table), which is not currently present anywhere inyield_curves_conuson Cardinal.hybrid_carbon_fits.csvandproduct_fractions_by_cell_age.csvare present;membership_slim.csvmust be regenerated before the script can run.Verification done / not done
parse()check). Not executed (blocked onmembership_slim.csvand terra/GDAL on a compute node).Next steps for whoever picks this up
Regenerate
membership_slim.csv→ runRscript ycx_build_rasters.R <build_dir> <product_fractions_csv> <out_dir>on Cardinal with the geo modules loaded → confirm the AGC tif aligns to a state outline → zonal-averagehybrid_agc_perplot.csv(or the tif) by EPA L3 → addagc_2022/dagc_100fields toecoregion_harvest_summary.jsonvia the existing generator.