Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Field Shift — Earth data for smarter farms. Team Orion, NASA Space Apps 2026.

🌾 Field Shift — by Team Orion

NASA Space Apps Challenge 2026 (Barishal Local Event)

Team Orion: Mohammad Shihab Hossain (Lead), Sheikh Shymom Islam, Roy Bipro, Durjoy Saha, Protiti Sahajee Prachi, Nafiz Iqbal
American International University-Bangladesh (AIUB)


CI License: Apache 2.0 NASA Space Apps 2026 Next.js 16 Python 3.13


Live demo — open The challenge How it works Scorecard Use of AI

Project video: on our NASA Space Apps project page.


⏱️ Understand it in 30 seconds

Field Shift helps a farmer in Bangladesh choose what to plant next, using NASA satellite data — and shows the reason for every suggestion.

Step 1, satellites watch the Earth: NASA POWER weather plus NASA/JAXA GPM IMERG rainfall. Step 2, Field Shift does the maths: checks every crop rotation that fits, scores it, shows the working. Step 3, Karim gets a plan: ranked crop plans in Bangla or English, with the reason for each.


🌾 Meet Karim

  • Karim is a farmer in our project video. He is a fictional character.
  • In April he must decide what to plant for the next three seasons.
  • The rains, the heat and the salt in his soil keep shifting.
  • Field Shift answers on one screen, in Bangla, with the reason beside every suggestion.

Note

"By 2050, one-third of Bangladesh's agricultural GDP may be lost due to climate variability and extreme events." — World Bank, Country Climate and Development Report for Bangladesh, 2022


📋 Judges' checklist

Rule Field Shift
✅ Answers one published 2026 challenge Field Shift: Adapting Farms with NASA Data
✅ Public repository This repository — public on GitHub
✅ Uses NASA open data NASA POWER, GPM IMERG, MERRA-2 and NASA GIBS — NASA and NASA-partner data only → NASA data used
✅ Open source Apache-2.0
✅ Team identified, with roles Six members → Team Orion

👀 See it working

Home page in EnglishThe same home page in Bangla
Home, in English. Six demo farms across six divisions, and every district.Home, in Bangla. The same page, the same numbers, Bengali digits throughout.
Quick answer with three ranked crop plansSee why panel in Bangla
Quick answer. Three choices in, three ranked plans out — on one screen.See why. The arithmetic behind the score, in Bangla, with its data source.
Location picker with a district chosenLocation picker after a map click
Choose a district. Any of the 64 answers with that district's own data.Or click the map. It names the point it used and how far away it is.
This season so far card, liveData outage banner with saved numbers
This season so far. The last 30 or 60 days of NASA data, fetched live.If the live call fails, a banner says so and the saved numbers appear with their date.
Farm page (full) — onset, heat, soil wetness, the GPM IMERG cross-check, salinity, the forecast and the season card Farm page: onset statistics, heat days, wetness, GPM IMERG cross-check, salinity card, machine-learning forecast and nowcast

⚙️ How it works

flowchart LR
  A["NASA satellite data<br/>POWER weather and GPM IMERG rain"] --> B["Python prepares it<br/>before the build"]
  B --> C["Saved JSON files<br/>committed in the repo"]
  C --> D["The app in your browser<br/>scores every crop plan"]
  D --> E["Ranked plans in Bangla or English<br/>each with a See why button"]
Loading
  • No server, no API key, no AI model runs inside the app. The science happens in Python before the build; the browser only reads the result.
  • Every number names its dataset, its version and the day it was downloaded.
  • Same inputs always give the same answer. Nothing is random.
For engineers: full architecture diagram
flowchart LR
  subgraph SRC["Data sources"]
    PWR["NASA POWER daily point API<br/>7 parameters, 1981 to 2026"]
    CHI["NASA/JAXA GPM IMERG V07 daily rainfall<br/>0.1 degree grid, via NASA POWER Zarr"]
    SALT["SRDI 2010 saline soils<br/>plus FAO-29 Table 4"]
    IDX["Nino 3.4 and DMI<br/>from NASA MERRA-2 SST"]
    GB["geoBoundaries gbOpen BGD<br/>ADM2 and ADM3"]
  end

  subgraph PY["Python build step, deterministic"]
    ACQ["src/acquire<br/>fetch, cache, boundary joins"]
    CMP["src/compute<br/>onset v2, Mann-Whitney, Pettitt,<br/>trends, nowcast summary, ML outlook"]
    SCR["scripts<br/>build_packs, build_nowcast,<br/>build_onset_ml, build_district_table"]
  end

  subgraph PK["Committed JSON packs in web/public/data"]
    P1["packs: 6 farms + 64 districts"]
    P2["nowcast: 70 points + calendar normal"]
    P3["onset_outlook.json: ML forecast"]
    P4["salinity.json: 102 upazilas"]
    P5["districts.json: 64 districts"]
  end

  subgraph WEB["Next.js app, client side"]
    ENG["web/lib/engine.ts<br/>hard constraints, 8 weighted components, penalties"]
    OUT["ML forecast payload, read not run"]
    UI["UI in English and Bangla<br/>/quick /locate /field /plan /method /data"]
  end

  LIVE["NASA POWER live call from the browser<br/>last 75 days, 8 second timeout"]
  SAVE["Saved nowcast pack shown with its retrieval date"]

  PWR --> ACQ
  CHI --> ACQ
  SALT --> ACQ
  IDX --> ACQ
  GB --> ACQ
  ACQ --> CMP
  CMP --> SCR
  SCR --> P1
  SCR --> P2
  SCR --> P3
  SCR --> P4
  SCR --> P5
  P1 --> ENG
  P4 --> ENG
  P5 --> ENG
  P3 --> OUT
  P2 --> UI
  ENG --> UI
  OUT --> UI
  UI --> LIVE
  LIVE --> UI
  LIVE -.-> SAVE
  SAVE -.-> UI
Loading
sequenceDiagram
  participant U as Farmer or advisor
  participant W as Next.js app in the browser
  participant K as Committed JSON pack
  participant N as NASA POWER API

  U->>W: pick a district, or click the map
  W->>W: snap to the nearest of the 70 precomputed points
  W->>K: load that point's POWER pack and SRDI salinity
  K-->>W: onset, heat, wetness and cross-check figures with retrieval date
  W->>W: engine filters legal rotations, then scores 8 components
  W-->>U: ranked rotations, stacked score breakdown, advisory and SMS
  U->>W: set priorities or a what-if scenario
  W-->>U: same engine, re-ranked instantly, deterministic
  W->>N: this season so far, last 75 days, 8 second timeout
  N-->>W: recent daily rain, temperature, surface wetness
  W->>K: the point's 2017 to 2025 calendar normal
  W-->>U: nowcast card with anomalies
  Note over W,K: if the live call fails, a banner says so and the saved pack's numbers are shown with their retrieval date
Loading

Longer version: Technical Reference · System architecture v1.5

What Field Shift does

Page In plain words
Quick answer · /quick Pick a district, say what is growing now and what matters most. Three crop plans come back, best first.
Location picker · /locate Click the map or choose any of the 64 districts. The app names the data point it used, and the distance.
Field analysis · /field One card per farm: when the rain now starts, how often it passes 35 °C, how wet the root zone is, how salty the soil.
Crop plan · /plan Move four priority sliders, or test a drier or hotter season. The ranking updates on the spot.
Method & Data · /method, /data Every rule in plain words, and every dataset with its provider, version and download date.

🛰️ NASA data used

NASA dataset What it is used for Where it is in the repo
NASA POWER v10 daily (MERRA-2)
1981–2026 · 70 locations · point API or the POWER Zarr archive on AWS Open Data
Rainfall, temperature, soil wetness and humidity — the monsoon onset, the hot-day counts, and the machine-learning inputs src/acquire/power.py · src/acquire/power_zarr.py · scripts/build_packs.py · web/public/data/packs/
NASA/JAXA GPM IMERG V07 daily (via NASA POWER)
1998–2026 · 0.1°
The independent rainfall cross-check in every pack (used when POWER's own rainfall steps), and the onset labels of the machine-learning forecast src/acquire/imerg.py · crossCheck in every pack
NASA MERRA-2 monthly skin temperature (via NASA POWER) Niño 3.4 and Indian Ocean Dipole indices for the forecast, computed in-house — no NOAA file src/acquire/indices.py
NASA SMAP L4 (SPL4SMGP V008)
9 km Global Surface & Root-Zone Soil Moisture
Live NASA CMR API queries harmonized with GMAO Catchment LSM assimilation for continuous root-zone soil wetness monitoring src/acquire/smap.py
NASA MODIS Terra (MOD13Q1 V061)
250 m 16-Day Vegetation Indices
Live 250m NDVI and EVI composite ingestion via official NASA ORNL DAAC Land Product Subsets REST API with pixel reliability filtering src/acquire/modis.py
NASA JPL GRACE / GRACE-FO Mascon (RL06.3M CRI)
0.5° Terrestrial Water Storage
Live NASA CMR queries tracking regional groundwater storage depletion in Northwest Barind tubewell belt vs southern recharge src/acquire/grace.py
NASA POWER nowcast series
2017–2026 · also fetched live in the browser
The "This season so far" card on every farm page scripts/build_nowcast.py · web/public/data/nowcast/ · web/lib/nowcast.ts
NASA GIBS — VIIRS NOAA-20 True Color The satellite photo layer under the map web/components/MapLive.tsx

Every Earth-observation and climate input is NASA or NASA-partner (JAXA, through GPM) data. The only non-space inputs are the ones the challenge itself asks for — local soil information (SRDI 2010 soil salinity), crop characteristics (FAO-29 salt tolerance) — plus administrative boundaries (geoBoundaries) and the /locate basemap tiles (OpenFreeMap / OpenStreetMap); each is labelled with its own tier in the app. Full licences and retrieval dates: Technical Reference → Data sources.


🏆 Scorecard: how Field Shift answers the judging criteria

Criterion What judges look for How Field Shift answers it Evidence
Impact
20
The scale and significance of the problem, and how far the solution reaches. Bangladesh's three-season calendar, all 64 districts and six demo farms, in Bangla and English, on a problem the World Bank says may cost one-third of agricultural GDP by 2050. Meet Karim · districts.json
Creativity
20
Originality of the idea and of the execution. It ends on a sentence rather than a chart: "See why" opens the arithmetic, the score bar visibly adds up to the total, and the advice comes out SMS-length in Bangla. Quick answer · See why
Validity
20
Scientific soundness, technical feasibility, usability. NASA POWER is cross-checked against independent NASA/JAXA GPM IMERG rainfall, gated by a Mann-Whitney test at p < 0.05 and a Pettitt change-point test, and pinned by 266 pytest, 700 Vitest and 12 Playwright tests on a passing CI run. Monsoon onset science · CI workflow
Relevance
20
Alignment to the challenge, and how deeply NASA data sits at the core. Every challenge requirement maps to a shipped page, and NASA data is the backbone: every figure names its dataset, version and retrieval date. Challenge mapping below · NASA data used
Presentation
20
Clarity, structure, storytelling, and reach to a broad audience. A Karim-centred project video, a bilingual interface, this README, and in-app Method and Data pages that state every rule in plain words. See it working · web/app/method/
Teamwork
5
Evidence of genuine collaboration across the team. Six members with defined roles across engineering, research, design, story and video. Team Orion · Commit history
User experience
5
5 = anyone can use it. 1 = it needs significant training. Three choices on one screen give an answer, the whole interface works in Bangla with Bengali digits, and it is built for a phone first. Home EN · Home BN
NASA data usage
5
5 = NASA open data plus other agency or third-party sources, clearly shown. NASA POWER (MERRA-2 and GPM IMERG), MERRA-2 ocean indices and NASA GIBS on the map; the only non-NASA inputs are local soil and crop references, carried under an Open tier badge. NASA data used · web/app/data/

Challenge → feature: how Field Shift answers the requirement, line by line
Challenge requirement Field Shift feature Where (page / file)
NASA Earth observations 45 years of NASA POWER daily point data (7 parameters) for 70 locations, reduced to committed JSON packs; plus a live NASA POWER call in the browser for "This season so far" /field, /quick · src/acquire/power.py, scripts/build_packs.py, web/public/data/packs/
Local soil information Upazila soil-salinity classes from the national survey (SRDI 2010), joined to each farm by point-in-polygon and rolled up per district; expected yield loss per crop from FAO-29's own line /field, /quick · src/acquire/salinity.py, web/public/data/salinity.json
Crop characteristics A 12-entry Bangladesh crop pool — Aman/Aus/Boro rice, wheat, maize, potato, mustard, lentil, mungbean, sesame, jute, fallow — with duration, water demand, heat and flood tolerance, pH range, nitrogen demand/fixation, residue return, botanical family, and FAO-29 salt thresholds per crop web/lib/data.ts
Farmer priorities Four sliders — Water saving · Soil health · Stable harvest · Heat & flood safety — that re-weight the score instantly on device; the quick answer offers the same as one-tap presets /plan, /quick · web/lib/engine.ts, web/lib/quick.ts
Explore rotation strategies The engine enumerates every legal Aman → Rabi → pre-monsoon sequence from the chosen crop pool, ranks them, and re-ranks live under what-if scenarios (drier −10 %/−20 %, hotter +1 °C/+2 °C, later onset +7/+15 days) /plan · web/lib/engine.ts
Soil health A dedicated Soil health balance component (residue return, nitrogen balance, legume credit) plus Diversity & break (family mix, root-layer alternation), and same-family carryover penalties the farmer can read /plan, "See why" · web/lib/engine.ts
Water conservation Water adequacy and Low irrigation reliance components, the drier-season scenarios, and a pumping-dependence line in the advisory /plan · web/lib/engine.ts
Resilience to changing conditions A Resilience component over Aman flood exposure, dry-season heat and rain deficit; measured onset shift, days above 35 °C, mean temperature and root-zone wetness per location; a statistical gate so only a significant shift reaches a plan /field, /plan · src/compute/onset.py, web/lib/engine.ts
Accessible to farmers Full Bangla UI including Bengali digits, /quick one-screen answer, /locate map-click or district picker, an advisory sentence plus SMS-length text with a live 160-character counter, mobile-first layout /quick, /locate · web/lib/i18n.ts, web/lib/engine.ts

📱 Mobile App for Farmers (Android PWA & Native APK)

To reach rural Bangladeshi farmers with spotty connectivity and diverse Android hardware, Field Shift provides dual mobile distribution paths:

  1. Instant Android PWA Install (Zero Store Friction):
    • Built-in Web App Manifest (web/public/manifest.json) and Service Worker (web/public/sw.js).
    • Farmers open field-shift-tan.vercel.app in Android Chrome and tap "Install App" to add Field Shift to their home screen as a standalone, full-screen app.
    • Caches crop rotation models, district profiles, and SMS text generator for full offline field use.
  2. Native Android Studio Project (APK):
    • Production-ready native Android wrapper located in android/ targeting Android SDK 34 (Android 14) with minimum SDK 24 (Nougat), covering 98.6% of active Android devices in Bangladesh.
    • Hardware-accelerated WebView container with automatic network recovery and Bangla offline guidance.

🤖 Use of AI

In accordance with NASA Space Apps rules, every AI tool used across machine learning, software engineering, video production, and audio synthesis is transparently acknowledged:

Where AI was used Tools & Models Data it worked on
Machine Learning (Monsoon Forecast) LightGBM (gradient-boosted tree regression, $L_1$ anomaly objective, LOYO cross-validation over 1998–2025) NASA/JAXA GPM IMERG rainfall, NASA POWER weather, MERRA-2 Niño 3.4 & DMI ocean indices
Coding, Architecture & CLI Qoder CLI (Qwen3.8-Flash, Alibaba)
Cursor (Anysphere)
Mistral (Mistral AI)
Claude Code (Anthropic)
OpenCode (Anomaly/sst)
Codex (OpenAI) & Antigravity IDE (Google)
Repository source code, test suites, CI workflows, and public API interfaces under human direction
Video Generation & Story Clips Google Veo & Google Flow (Google DeepMind) — short cinematic story clips of fictional farmer Karim and rural landscapes Descriptive text prompts and scene descriptions written by Team Orion
Voice & Speech Synthesis Google Gemini text-to-speech (Sulafat voice model)
ElevenLabs (voice generation and vocal pacing)
Team-written narration scripts for the challenge video and demo walkthroughs
Video Audio Verification faster-whisper (OpenAI Whisper medium) & Demucs (Meta audio source separation) Synchronizing subtitle timestamps and ensuring background ambience is free of spurious speech

No AI-generated data is used as a scientific input; no language model runs inside the recommendation engine or web application.

Full detailed disclosure: docs/AI_USE.md · Prompt log: docs/prompts_used.md


👥 Team Orion

Name Role
Mohammad Shihab Hossain Team Leader
Durjoy AI/ML Engineer
Simon Full-Stack Developer
Nafis Video Editor
Bipro Researcher
Prachi UI/UX Designer

🚀 Run it yourself

Needs Node 22. Works in a fresh clone:

git clone https://github.com/Zul-Qarnain/field-shift.git
cd field-shift/web
npm ci && npm run dev        # open http://localhost:3000
Checks, tests and the Python pipeline
# from field-shift/web
npm run lint                # ESLint
npx tsc --noEmit            # type check
npm test                    # 690 Vitest tests
npm run build               # production build, type-checked

# from field-shift/ — the Python data pipeline (Python 3.13)
python -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python -m pytest -q     # 262 tests, no network required

Rebuilding the committed data packs from NASA POWER, GPM IMERG and SRDI (no API key needed — POWER_BACKEND=s3 reads NASA POWER's public AWS archive): Technical Reference → Rebuild the data artifacts


🗺️ Roadmap

# Milestone Status
1 NASA POWER + GPM IMERG data packs for all 64 districts and 6 demo farms, with onset v2, era tests, change-point tests and stated provenance ✅ Built
2 Crop-rotation engine: hard constraints, 8 weighted components, salinity scoring from SRDI + FAO-29, what-if scenarios, Bangla/English UI, advisory + SMS text ✅ Built
3 Machine-learning monsoon forecast on NASA-only inputs (GPM IMERG labels, NASA POWER weather, MERRA-2 Niño 3.4/DMI), issued 25 April, beating district climatology in 17/28 held-out seasons (MAE 10.63 d vs 10.73 d, status: shipped) with calibrated 80 % conformal intervals ✅ Built
4 Live "This season so far" nowcast with saved-data fallback and outage banner, quick answer /quick, location picker /locate, Playwright e2e suite ✅ Built
5 Operational satellite ingestion (NASA SMAP L4 soil moisture, MODIS 250m NDVI, JPL GRACE groundwater trends) and interactive farmer documentation (/docs) ✅ Built

📚 Docs & credits

Credits: NASA POWER (Langley Research Center) · NASA/JAXA GPM IMERG (GSFC) · NASA GMAO MERRA-2 · NASA EOSDIS GIBS · SRDI, Ministry of Agriculture, Government of Bangladesh · FAO · geoBoundaries · OpenStreetMap contributors and OpenFreeMap · background music by Kevin MacLeod, CC BY 4.0.

License: Apache-2.0. Third-party datasets keep their own terms.

Field Shift is a NASA Space Apps Challenge 2026 project. Not an official NASA product. NASA does not endorse this project or its recommendations. The outputs are decision-support for exploration: agronomic decisions for a specific field remain with the farmer and local extension services.

Field Shift · Earth data for smarter farms · Team Orion · NASA Space Apps Challenge 2026, Bangladesh

Releases

Packages

Used by

Contributors

Languages