Specialization kata · AGR-001

Inspect a daily weather record: dates, units, gaps and flags

Open a year of real daily weather from NOAA and write down what it holds before you use it: station, dates, units, missing values, and every measurement, quality and source flag.

Draft. This recipe is a draft. Its checks may not have been run, and it can change.

Status
Draft
Kata ID
AGR-001
Maintainer
Agriculture pathway maintainer
Last verified
Not available. Built and checked by the Dojo maintainers and CI; no independent, agronomic or engineering review yet.
Found a problem?
Report it

The outcome

An inspection record of the weather file, with every claim traced to a column, row or flag.

For: Learners who have done the foundations and want to treat weather data as evidence rather than as a chart.

Done when

  • You name the station, its coordinates and elevation, and the first and last date
  • You count the days expected and present, and list any missing dates as unavailable, never as zero
  • For each element you give the unit, the count, the range and every flag with its count
  • Your counts match /examples/agriculture-pathway/generated/inspection.json

You make: Weather inspection. Outcome: Inspect weather record.

Showcase and provenance

The Dojo’s worked example, made by the maintainers rather than by a learner: one year of NOAA daily weather for a California station, FAO-56 reference evapotranspiration and a maize irrigation estimate, every number computed by the site’s CI.

See the showcase

Made by
NOAA National Centers for Environmental Information (weather record); Developer Dojo maintainers (script and results)
Source
NOAA GHCN-Daily station USW00093193, 2023; method from FAO Irrigation and Drainage Paper 56; results from /examples/agriculture-pathway/tools/agri_pathway.py
Licence
Weather record is a US government work (no US copyright, 17 U.S.C. 105); script and outputs MIT
Date

Brief, inputs and constraints

Inputs

  • noaa-ghcnd-USW00093193-2023.csv. Source: noaa/ghcn-daily (copy on /examples/agriculture-pathway/inputs/). Terms: US government work from NOAA NCEI; cite the dataset as NCEI asks.

Constraints

  • No paid tools
  • Offline capable
  • No personal data

Capabilities practised

  • Analyze data
  • Verify evidence

Stack, permissions and cost

Stack components with version, permissions and cost
PartComponentVersionPermissionsCost
RuntimePython, standard library only3.12Reads the files you give it and writes only the output folder you nameFree
ToolAny spreadsheetNot available. Not fixed; any spreadsheet that opens CSV worksOpens a copy of the CSV filesNot available. Depends on the spreadsheet you use; free ones work
DataNOAA GHCN-Daily record, station USW000931932023, SHA-256 abde4990…b3b9a7Read a copyFree (US government work)
HarnessAny chat assistant or coding agentNot available. Not fixed; an assistant may explain an equation or draft code, and every number it gives is checked against FAO's worked examplesReads what you paste in; give it a copy of the record onlyNot available. Depends on your assistant and plan; not measured

Stack recipes

  • Python standard library

Why this stack

The standard library is enough for these equations, runs offline with nothing to install, and gives the same numbers on every machine. CI runs the identical script on every pipeline.

Alternatives

  • A ready-made evapotranspiration package or FAO's ETo Calculator. Faster, but hides the equations this pathway is about. Not tried for this pathway, so its numbers are not compared here. Not tested for this recipe.

Agents and review gates

  1. Explaining assistant

    Explains a GHCN-Daily column or flag you paste in, and drafts the Python to count it.

    Review gate: You check the explanation against NOAA's documentation and run the code on the file.

  2. Learner as reviewer

    Compares the record with the file and with the Dojo's CI output.

    Depends on: Explaining assistant

    Review gate: A claim stays only if it cites a column, row or flag.

Setup and smoke test

  1. Install Python 3.12 or later. Nothing else is needed.
  2. Download the record and the pathway script from /katas/agriculture-pathway into a new, empty folder. Work on copies; keep the original.

Sign-in and access: None. Nothing here needs an account.

Smoke test

Do
Run: python3 -I tools/agri_pathway.py . out (from the folder that holds inputs/ and tools/)
Expect
13 reference checks pass and out/inspection.json reports 365 rows
Result
Passed /examples/agriculture-pathway/generated/inspection.json, recomputed by CI on every pipeline

Prompts

Copy a prompt into the assistant you use. Replace anything that does not fit your situation, and never paste private or personal data you are not allowed to share.

Explain the flags

Learn what each attribute on a GHCN-Daily value means, without trusting the explanation blindly.

You can also select and copy the text.

Practice exercise

Global Historical Climatology Network - Daily (GHCN-Daily). From Global Historical Climatology Network - Daily (GHCN-Daily) (NOAA National Centers for Environmental Information).

Terms: US government work from NOAA NCEI; NCEI asks for a citation and gives no warranty.

Execution and handoffs

  1. Learner: Open the CSV in a text editor or spreadsheet and find the station columns, the dates and the attribute columns.
  2. Explaining assistant: Drafts a script that counts values, gaps and flags per element. Hand-off: You run it and compare the output with the file.
  3. Learner: Write the inspection record and compare it with the CI output.

Tests, failures and corrections

Checks with expected and recorded results
CheckExpectedResultEvidence
Inspect the record with the pathway scriptStation USW00093193, 2023-01-01 to 2023-12-31, 365 rows, no missing dates, no missing values, no quality flags, 23 rain values flagged T (trace), rain total 346.6 mmPassed on /examples/agriculture-pathway/generated/inspection.json, recomputed by CI on every pipeline
Your own inspection record matches the CI outputSame station, dates, counts, ranges and flagsNot runNot run, so there is no evidence. This is not a pass.

Failures and corrections

  • Observed: A trace of rain is recorded as 0 mm Correction: That is how NOAA records it; the T flag says some rain fell but too little to measure. Count trace days separately; do not treat them as missing.

Adapt it

  • Use another station or year Expect gaps and quality flags. Report each gap as unavailable and decide, before computing, how a result handles it.

Unseen Randori

See the agriculture Randori recipe, AGR-R01.

Constraints

  • Every claim cites the file

How it is judged: The record matches the CI output for the same file.

More Randori challenges

Belt evidence

Belt stages are proposed practice stages, not issued credentials. Evidence below is what a reviewer would look for; it is not a record that anyone has shown it.

Evidence a reviewer looks for

  • An inspection record (station, dates, units, missing values and flags per element) that matches the Dojo's CI output for the same file (Automated check)
  • Each claim in the record points to a column, row or flag in the CSV (Self-check)

Belt criteria

  • Practice: Reproduces the inspection for the record and explains what the trace flag T means for rain totals
  • Adapt: Downloads another GHCN-Daily station-year and inspects it the same way, recording any gaps as unavailable
  • Demonstrate: Explains to a reviewer which uses the record supports and which it does not, citing NOAA's own limits

See the belt stages

Connections

Used by
No other kata names this one as a foundation yet.
Transfers to
Professional review
Required. Any real use of this outcome needs independent validation and any approval required from a qualified professional. Practice here does not grant a licence.

Sources

Maintenance and caveats

Review cadence: Every six months, or when NOAA changes the GHCN-Daily format or terms

  • This recipe is a draft: the example was built and checked by the Dojo maintainers and CI, and no learner has run it yet.
  • Nothing here is an irrigation recommendation. No agronomist, irrigation engineer or water authority has reviewed it, and real water use needs the qualified people and local rules that apply to it.
  • Humidity, radiation and wind are estimated from temperature, as FAO-56 describes for missing data. The results are estimates, not measurements.
  • NOAA says GHCN-Daily is not homogenized. One station and one year say nothing about a trend.

All kata recipes · Back to katas