Skip to content
Back to skills

Docs

ASecurity

> **Stage ID**: s1_crop_selection > **Pipeline order**: 1 of 10 > **Depends on**: none

  • 200 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
testingpythondocumentation

Works with

  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 16 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lzwei196-docs-kiss-knowledge-infrastructure-/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-kiss-knowledge-infrastructure-)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Crop Selection & Parameterization -- Skill Document

> **Stage ID**: s1_crop_selection
> **Pipeline order**: 1 of 10
> **Depends on**: none

## Purpose

Select the crop type and configure phenological, canopy, and water productivity parameters. This stage determines what plant species the model simulates and how it responds to temperature, water stress, and management. If skipped, there is no crop to simulate. Choosing the wrong crop type or GDD base temperature produces physically plausible but scientifically wrong results (silent error).

## Prerequisites

Before starting this stage, verify:

- [ ] `aquacrop` package is installed (`pip install aquacrop`)
- [ ] Python environment is activated
- [ ] Target region and growing season are known (to select planting date)

## Inputs

| Input | Type | Source | Description |
|-------|------|--------|-------------|
| crop_name | string | User decision | Built-in crop name (e.g., 'Maize', 'MaizeGDD') or 'custom' |
| planting_date | string | User / regional calendar | Planting date in MM/DD format (e.g., '05/01') |
| harvest_date | string | Optional | Latest harvest date in MM/DD format |
| overrides | dict | Optional | Parameter overrides (e.g., `Tbase=10, HI0=0.50`) |

## Procedure

### Step 1: Choose between Calendar-Day and GDD crop variant

If the target region has **variable inter-annual temperature**, use the GDD variant (e.g., `MaizeGDD` instead of `Maize`). GDD variants adapt phenological timing to actual temperature accumulation. Calendar-day variants assume fixed development durations regardless of temperature.

**Rule of thumb**: Always use GDD variants unless you have calibrated calendar-day parameters for the specific site.

### Step 2: Create the Crop object

```python
from aquacrop import Crop
crop = Crop('MaizeGDD', planting_date='05/01')
```

**If this fails**: See diagnostic triplet dt_002 (wrong crop name).

### Step 3: Override parameters if needed

Pass changed parameters as keyword arguments. Only parameters in the `allowed_keys` set can be overridden.

```python
crop = Crop('MaizeGDD', planting_date='05/01', HI0=0.50, Tbase=10, WP=35.0)
```

**Key parameters for calibration**:
- `Tbase`: Base temperature for GDD (crop-specific: Maize=8, Wheat=0, Rice=8, Soybean=5)
- `Tupp`: Upper temperature for GDD (typically 30-35 C)
- `HI0`: Reference harvest index (0.30-0.60 for grain crops)
- `WP`: Normalized water productivity (15-40 g/m2 depending on crop)
- `CCx`: Maximum canopy cover (0.70-0.98)
- `CGC`: Canopy growth coefficient
- `CDC`: Canopy decline coefficient
- `p_up1..p_up4`: Upper water stress thresholds
- `PlantPop`: Plants per hectare

### Step 4: Validate crop parameters

Run tool `validate_crop_params` to check:
- `Tbase < Tupp`
- `Emergence < Senescence < Maturity` (for GDD crops)
- `0 < HI0 <= 1`
- `WP > 0`
- `0 < CCx <= 1`

## Expected Outputs

| Output | Path | Verification |
|--------|------|--------------|
| Crop object | in-memory | `crop.Name` matches chosen name; `crop.planting_date` is set |

## Validation Checks

1. **GDD parameter ordering**: `crop.Emergence < crop.Senescence < crop.Maturity`
   - If unexpected: Crop will not progress through growth stages correctly. See dt_002.

2. **Temperature thresholds**: `crop.Tbase < crop.Tupp`
   - If Tbase >= Tupp: GDD accumulation will be zero or negative. Fatal.

3. **Harvest index**: `0 < crop.HI0 <= 1`
   - If HI0 = 0: Yield will always be zero. See dt_014.

## Common Pitfalls

> **PITFALL**: Using wrong GDD base temperature for the crop
> This happens when using a generic Tbase (e.g., 10 C) for a crop that has a lower base (e.g., Wheat Tbase=0 C). The symptom is that the crop matures too slowly or too quickly. The yield may still be positive but the phenology timing is wrong.
> **Do this instead**: Check the crop-specific Tbase in `crop_params.py` or FAO documentation.
> See diagnostic triplet dt_002 for full details.

> **PITFALL**: Using calendar-day crop for multi-year simulation
> Calendar-day crops have fixed development timing regardless of temperature. In multi-year runs across different climate years, this produces identical phenology every year, which is unrealistic.
> **Do this instead**: Use the GDD variant (e.g., `MaizeGDD` instead of `Maize`).

> **PITFALL**: Planting date in wrong format
> The format is `MM/DD` (month/day with slash), not `DD/MM` or `YYYY-MM-DD`.
> Using the wrong format may silently swap month and day if both are <= 12.

---

*This skill document is part of the aquacrop-ospy-knowledge infrastructure.*
*Stage 1 of 10 | Tools used: select_crop, validate_crop_params | Related triplets: dt_002, dt_005, dt_014*

Files in this skill

  • REFERENCES.md1.6 KB
  • format_spec.yaml35.8 KB
  • model_couplings.yaml13.5 KB
  • papers.json4.9 KB
  • s10_water_productivity_skill.md7.1 KB
  • s1_crop_selection_skill.md4.5 KB
  • s2_soil_profile_skill.md4 KB
  • s3_weather_prep_skill.md5.7 KB
  • s4_initial_conditions_skill.md3.4 KB
  • s5_irrigation_skill.md5.7 KB
  • s6_field_management_skill.md2.9 KB
  • s7_model_assembly_skill.md4 KB
  • s8_execution_skill.md3.3 KB
  • s9_output_analysis_skill.md5.3 KB
  • validation_convention.yaml23 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…