The AgroIA Score is a composite index from 0 to 100 that condenses six years of Sentinel-2 NDVI history, thermal stress hours from NASA POWER, and a statistical anomaly detector into a single, actionable number per agricultural field. Rather than forcing agronomists to interpret raw satellite bands or climate tables, the Score surfaces the signal that matters most at each crop’s critical growth month — making the difference between a field in excellent health and one at critical risk immediately legible.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sdarionicolas-boop/AgroIA-RAG/llms.txt
Use this file to discover all available pages before exploring further.
Formula
Score components
Vigor — 40 points
Vigor measures the current photosynthetic activity of the field by normalising the NDVI reading captured at the crop’s critical month against a reference ceiling of 0.9:(0.72 / 0.9) × 40 = 32 pts. NDVI is sourced from COPERNICUS/S2_SR_HARMONIZED Band 8 (NIR) and Band 4 (Red), filtered for scenes with less than 20% cloud cover. If the critical month is cloud-free, a fallback window of ±2 months is applied by get_gee_ndvi_ventana().
Stability — 30 points
Stability penalises inter-annual inconsistency. It uses the coefficient of variation (CV = σ/μ) of the NDVI series, normalised against a reference CV of 0.45:A minimum of 3 years of historical NDVI data is required to compute Stability. With fewer years, the component defaults to 15 pts (half weight) to avoid over-penalising new lotes.
Cleanliness — 20 points
Cleanliness detects anomalous seasons using Isolation Forest withcontamination=0.2. Each year classified as an outlier (label == -1) reduces the component proportionally:
A minimum of 4 years of data is required to fit the Isolation Forest. With fewer years, the component defaults to 10 pts (half weight).
Climate — 10 points
Climate measures thermal stress using heat hours accumulated during the campaign, sourced from NASA POWER’s daily temperature data via a sinusoidal approximation. Fewer heat hours above the crop-specific threshold produce a higher score:horas_calor equals or exceeds umbral_clima, the climate component drops to 0.
Full function signature
The following is the completecalcular_score() function from src/pipeline/agro_math.py:
Crop configuration
TheCONFIG dictionary in agro_math.py defines per-crop agronomic parameters calibrated against INTA and University of Nebraska research. The following table lists the three supported crops:
| Crop | Critical month | NDVI min | NDVI max | Heat threshold (h) | Source |
|---|---|---|---|---|---|
maiz | January | 0.25 | 0.92 | 40 | INTA Marcos Juárez / Univ. Nebraska |
soja | February | 0.25 | 0.90 | 35 | INTA Marcos Juárez |
trigo | October | 0.20 | 0.88 | 30 | INTA Pergamino |
ndvi_min and ndvi_max define the plausible range for NDVI validation via validar_ndvi(). Readings outside these bounds are flagged as suspicious before being passed to calcular_score().
Score interpretation
| Range | Category | Recommended action |
|---|---|---|
| 90–100 | Excellent | No intervention required |
| 75–89 | Good | Routine monitoring |
| 60–74 | Moderate | Review input applications; monitor closely |
| 40–59 | Low | Conduct field inspection; consider agronomic adjustments |
| 0–39 | Critical | Immediate field diagnosis required |
Frequently asked questions
What happens when NDVI data is missing for a year?
What happens when NDVI data is missing for a year?
The pipeline first attempts to retrieve NDVI from the crop’s exact critical month. If no cloud-free Sentinel-2 scenes are available,
get_gee_ndvi_ventana() searches within a ±2-month window. If no valid image is found within the window, that year is excluded from the historical series and flagged in the pipeline log. It does not count toward the Stability or Cleanliness calculations.Why is the Vigor ceiling 0.9 and not 1.0?
Why is the Vigor ceiling 0.9 and not 1.0?
NDVI rarely reaches 1.0 in real agricultural fields due to soil background signal and mixed pixels at field edges. Using 0.9 as the normalisation ceiling ensures that peak-performing crops score near 40 pts rather than being systematically under-rewarded. This value is calibrated to the NDVI max values observed across the three supported crops.
Can I use the Score for crops not in the CONFIG dictionary?
Can I use the Score for crops not in the CONFIG dictionary?
Not directly. The
calcular_score() function accepts a configurable umbral_clima parameter, so you can call it manually with custom values. However, the pipeline’s run_full_analysis() entry point resolves crop config from the CONFIG dict. Adding a new crop requires a new entry in agro_math.py:CONFIG with calibrated NDVI ranges, critical month, and heat threshold.How is the K-Means zone classification related to the Score?
How is the K-Means zone classification related to the Score?
Related pages
Pipeline guide
Run the full analysis pipeline on a shapefile or batch GeoJSON.
SAM field delineation
How AgroIA converts GPS points into precise GeoJSON polygons.
RAG engine
Query score history and components in natural language.
AgroMath API module
API reference for calcular_score() and related functions.