Skip to content

bioepic-data/ecosim-agent / .agents/skills/gapon-coefficient-estimator

gapon-coefficient-estimator

Verified

Estimate calcium-normalized Gapon selectivity coefficients from paired exchange and solution chemistry, or initialize depth-explicit EcoSIM Gapon inputs from the closest bundled ecosystem template when paired chemistry is unavailable. Use when deriving or checking EcoSIM GKC4, GKCH, GKCA, GKCM, GKCN, or GKCK values; matching a target ecosystem, climate, vegetation, and management regime to a starting profile; remapping template values to target soil layers; or documenting that template-based values require calibration or tuning.

FileKindSize
SKILL.mdskill md8.4 KB
agents/openai.yamlconfig467 B
assets/ecosystem_templates/Arctic_Tundra_AK/soil_gapon_coefficients.csvother5.8 KB
assets/ecosystem_templates/Arctic_Tundra_NWT/soil_gapon_coefficients.csvother6.7 KB
assets/ecosystem_templates/Arctic_Wetland_NWT/soil_gapon_coefficients.csvother4.5 KB
assets/ecosystem_templates/Boreal_Aspen_SK/soil_gapon_coefficients.csvother2.2 KB
assets/ecosystem_templates/Boreal_Black_Spruce_MB/soil_gapon_coefficients.csvother1.8 KB
assets/ecosystem_templates/Boreal_Black_Spruce_PQ/soil_gapon_coefficients.csvother1.6 KB
assets/ecosystem_templates/Boreal_Crop_Rotation_AB/br/soil_gapon_coefficients.csvother1.8 KB
assets/ecosystem_templates/Boreal_Jack_Pine_SK/soil_gapon_coefficients.csvother1.7 KB
assets/ecosystem_templates/Cool_Temperate_Douglas_Fir_BC/soil_gapon_coefficients.csvother1.7 KB
assets/ecosystem_templates/Cool_Temperate_Maize_Soybean_ON/soil_gapon_coefficients.csvother2.2 KB
assets/ecosystem_templates/Cool_Temperate_Oak_MA/soil_gapon_coefficients.csvother1.9 KB
assets/ecosystem_templates/Cool_Temperate_Pasture_Switzerland/soil_gapon_coefficients.csvother2.0 KB
assets/ecosystem_templates/Meditteranean_Pasture_CA/soil_gapon_coefficients.csvother2.0 KB
assets/ecosystem_templates/README.mdmarkdown619 B
assets/ecosystem_templates/Semiarid_Grassland_AB/soil_gapon_coefficients.csvother2.1 KB
assets/ecosystem_templates/Tropical_Peatland_Indonesia/soil_gapon_coefficients.csvother5.5 KB
assets/ecosystem_templates/Tropical_Rainforest_Amazon/soil_gapon_coefficients.csvother2.3 KB
assets/ecosystem_templates/Warm_Temperate_Loblolly_Pine_TN/soil_gapon_coefficients.csvother1.7 KB
assets/ecosystem_templates/Warm_Temperate_Maize_Soybean_Dryland_NB/soil_gapon_coefficients.csvother2.8 KB
assets/ecosystem_templates/Warm_Temperate_Maize_Soybean_Irrigated_NB/soil_gapon_coefficients.csvother2.8 KB
assets/ecosystem_templates/index.csvother3.9 KB
assets/ecosystem_templates/template_catalog.csvother4.4 KB
references/data-requirements.mdmarkdown3.4 KB
references/template-fallback.mdmarkdown2.8 KB
scripts/estimate_gapon_coefficients.pyscript10.1 KB
scripts/select_gapon_template.pyscript18.2 KB
tests/test_select_gapon_template.pyscript4.2 KB

references/data-requirements.md

View on GitHub
# Data Requirements for Gapon Coefficient Estimation

## Minimum paired data

For each horizon, layer, or sample:

- `exchange_ca_cmolc_kg` plus one or more target exchangeable cations:
  `exchange_na_cmolc_kg`, `exchange_mg_cmolc_kg`,
  `exchange_k_cmolc_kg`, `exchange_nh4_cmolc_kg`,
  `exchange_al_cmolc_kg`, `exchange_fe_cmolc_kg`,
  `exchange_h_cmolc_kg`.
- `activity_ca` plus the matching solution activity columns:
  `activity_na`, `activity_mg`, `activity_k`, `activity_nh4`,
  `activity_al`, `activity_fe`, `activity_h`.

If activities are unavailable, use consistently normalized solution
concentration columns such as `solution_ca_mol_l` or `solution_ca_mmol_l`, but
flag the result as concentration-as-activity.

## Lyotropic adsorption series

Use the cation adsorption series `Al = Fe > Ca > Mg > K = NH4` as a
scientific prior and sanity check. For EcoSIM, this means:

- `Al` and `Fe` should generally be the strongest exchange competitors.
- `Ca` should be preferred over `Mg`, and `Mg` over `K` and `NH4`.
- `K` and `NH4` should usually be treated as similar-strength competitors.
- `Na` remains useful for sodicity and Ca-Na exchange, but it is outside this
  specific series.
- `H` is governed by pH and acidity conventions; do not force it into the
  base-cation adsorption order.

If paired data imply a different order, do not silently adjust the
coefficients. Report the inversion and first check unit conversions,
extraction methods, activity corrections, and Fe/Al speciation.

## Common SSURGO/gSSURGO columns

Useful priors:

- `cec7_r`: CEC at pH 7, cmolc/kg
- `ecec_r`: effective CEC, cmolc/kg
- `sumbases_r`: sum of bases, cmolc/kg
- `ph1to1h2o_r`: pH in 1:1 water
- `ec_r`: electrical conductivity
- `sar_r`: sodium adsorption ratio
- `extracid_r`: extractable acidity, cmolc/kg
- `extral_r`: extractable aluminum, cmolc/kg

Standard SSURGO `chorizon` does not provide all individual exchangeable
`Ca`, `Mg`, `Na`, `K`, `NH4`, `Al`, and `Fe` needed to isolate Gapon solid
ratios. Do not treat non-standard names such as `extrca_r`, `extrmg_r`,
`extrna_r`, `extrk_r`, or `extrfe_r` as guaranteed SSURGO columns without
checking the actual dataset.

## CaX closure assumptions

Only use closure when `exchange_ca_cmolc_kg` is missing and enough companion
exchange cations are present.

Neutral/non-acidic approximation:

`CaX = CEC7 - (MgX + NaX + KX + NH4X + FeX_known)`

Acidic approximation:

`CaX = ECEC - (MgX + NaX + KX + NH4X + AlX + FeX + HX)`

If only exchangeable acidity and Al are known:

`HX = max(exchange_acidity - AlX, 0)`

Do not infer `FeX` from total Fe, citrate-dithionite Fe, oxalate Fe, or
generic extractable Fe unless the analytical method is explicitly an
exchangeable Fe measurement in charge-equivalent units.

All closures are estimates and must be reported in QC.

## Global database suitability

- WoSIS: best global profile backbone, partial support depending on profile
  measurements; still often lacks complete paired exchange and solution data.
- SoilGrids: useful for spatial priors such as pH, CEC, texture, SOC, and bulk
  density; not enough for direct Gapon coefficient calculation.
- HWSD/WISE/GSDE: useful for coarse priors such as pH, CEC, base saturation,
  total exchangeable bases, and salinity/sodicity screening; not enough for
  direct coefficient calculation.
- Water-quality datasets such as GEMStat or GLORICH can help with regional
  solution chemistry, but they are not soil exchange datasets and need careful
  spatial/depth interpretation.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall