Earth & Environmental Computing · Week 01 · Course session · 30 slides
Download HTML
Earth & Environmental Computing | Computational Methods for Earth & Environmental Science | 16-Week Course

Course Overview and Reproducible Computation

From Python syntax to geoscience insight: one river, one dataset, sixteen weeks.

Python · Real Iowa data · Reproducible workflows · MWF studio format
Week 01·Course session·Open Course Materials | Adapt for your classroom·Week 1 | Course session
Learning Objectives

By the end of this lecture, you will be able to...

  • Describe the course structure, grading, and weekly rhythm
  • Define a reproducible computational workflow
  • Identify the parts of the course repository
  • Explain what happens in Wednesday's first lab
Contents

Today's Lecture

01How the course runs
03The first notebook
02What reproducible means
04Studio culture and Lab 1
Motivation

June 2008: the River Outside This Building

The flood

  • Iowa River crested far above flood stage
  • Campus buildings flooded, semester disrupted
  • One of Iowa's costliest natural disasters

The questions

  • How rare was that flow?
  • How fast did the river rise?
  • What rainfall produced it?
  • All answered with data you will use in this course

Same USGS record the labs use all semester.

Data

Today's Datasets

FileSourceCoverageUsed for
iowa_city_weather_daily.csvIowa Environmental Mesonet, station IOWDaily, 2019–2025, 2,549 rowsThe live demo and Lab 1
iowa_streamflow_daily.csvUSGS NWIS, site 05454500, Iowa River at Iowa CityDaily, 2015–2025, 4,018 rowsThe flood question, from Week 4 on
data/metadata/data_sources.ymlCourse record of every downloadURLs, stations, date rangesChecking where a number came from
01

How the Course Runs

Three contact hours a week, and what each one is for.

01 · How the course runs

What This Course Is

Real data

Seven years of Iowa City weather, eleven years of Iowa River flow, water quality back to 1901.

Real questions

Floods, droughts, heat waves, water quality: every lab answers an Earth question.

Reproducible work

Analyses anyone can re-run and get your figures. The professional standard.

01 · How the course runs

The Weekly Rhythm

DayFormatWhat you do
MondayLectureConcepts, live demos, the why
WednesdayDebrief + integrated lab10 min student debrief, 5 min bridge, then coding
FridayOpen studioDebug, finish, get help, prepare debrief card
01 · How the course runs

Grading

ComponentWeight
Individual labs (6)30%
Group labs (6)25%
Final group project30%
Contribution statement and participation10%
Attendance and in-class engagement5%

Rubrics live in the syllabus overview file in the course repository.

01 · How the course runs

The Semester in Three Acts

1

Foundations (Wk 1-6)

Individual labs: Jupyter, Python basics, loops, functions, NumPy, pandas.

2

Applications (Wk 7-12)

Group labs: visualization, statistics, algorithms, AI-assisted coding, geostatistics, modeling.

3

Project (Wk 13-16)

Group research project on real data, presented in the final week.

01 · How the course runs

AI Coding Tools: the One-Sentence Version

  • Allowed for debugging, refactoring, tests, and documentation
  • Every use disclosed in an AI usage log
  • You must be able to explain every line you submit
  • Week 10 teaches the full responsible workflow
Pause and think

?

You download a spreadsheet, fix a few cells by hand, make a chart, and email it. Next month the data update. What breaks?

No record of which cells changed, or why
The chart cannot regenerate itself from new data
Nobody else, including future you, can repeat the steps
02

What Reproducible Means

Same data and same code, run by a stranger, giving the same number.

02 · What reproducible means

What Reproducible Means

The definition

  • Same data + same code = same figures and numbers
  • Without asking the author anything
  • Verifiable by a stranger, or by you in a year

The counterexample

final_analysis_v3_REALLY_FINAL.xlsx on a laptop desktop, edited by hand, author graduated in May.

02 · What reproducible means

The Course in One Relationship

result = analysis(data, code)

data = archived raw observations

code = every processing step, recorded

analysis = runs start to finish, no hands

result = figures anyone can regenerate

  • If any input is missing, the result is an anecdote
  • The project folder keeps all of them together
02 · What reproducible means

The Course Repository

data/processed/

Clean, class-ready datasets. Labs read from here; no internet needed in class.

notebooks/student/

Your labs and final-project templates. Guided code plus exercises.

src/earthcourse + tests/

Shared functions with automated tests. You will read and reuse them.

scripts/ + lectures/

Data download and cleaning pipeline; these lecture notes and slides.

02 · What reproducible means

The Ritual: Restart and Run All

  • Kernel > Restart Kernel and Run All Cells
  • Re-executes the whole notebook from nothing
  • Catches hidden state from cells run out of order
  • Do it before every submission, all semester
Pause and think

?

Your notebook works when you run cells in the order you wrote them, but fails on Restart and Run All. What happened, and why does the grader care?

A cell depended on state from a deleted or reordered cell
The grader always runs fresh: if it fails fresh, it fails
03

The First Notebook

The path cell, the data, and one labelled figure.

03 · The first notebook

The Cell That Opens Every Lab

Python

from pathlib import Path

PROJECT_ROOT = Path.cwd()
while not (PROJECT_ROOT / "data").exists() and PROJECT_ROOT != PROJECT_ROOT.parent:
    PROJECT_ROOT = PROJECT_ROOT.parent

DATA_DIR = PROJECT_ROOT / "data"
print(f"Project root: {PROJECT_ROOT}")
  • Finds the project folder no matter where the notebook opens
  • If it prints False for the data folder, stop and fix paths first
03 · The first notebook

Load Data, Then Look at It

Python

import pandas as pd

weather = pd.read_csv(DATA_DIR / "processed" / "iowa_city_weather_daily.csv",
                      parse_dates=["date"])
print(weather.shape)      # (rows, columns)
print(weather.head())     # first five days
  • 2,500+ days, one row per day, physical units in every column
  • Looking before computing is a habit, not a step to skip
03 · The first notebook

The First Figure of the Semester

Python

import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(10, 4))
ax.plot(weather["date"], weather["temp_mean_c"], linewidth=0.7)
ax.set_xlabel("Date")
ax.set_ylabel("Temperature (deg C)")
ax.set_title("Seven years of daily mean temperature, Iowa City")
plt.show()
  • Labels and units are part of the analysis, not decoration
  • Wednesday you build this yourself, line by line
03 · The first notebook

Lab 1 as Given, Solve, Interpret

01

Given

Daily weather for Iowa City, 2019-2025, as a clean CSV with units.

02

Solve

Load with pandas, compute mean, min, max temperature, plot the series with labels.

03

Interpret

Iowa's seasonal swing spans roughly 40 deg C. Write two sentences on the pattern.

04

Studio Culture and Lab 1

How we work together, and what you hand in on Friday.

04 · Studio culture and Lab 1

How to Succeed Here

Bring evidence

The next Lab starts with student reports of solved or unresolved problems. Error messages, values, and tiny tests help the class reason together.

Read errors bottom-up

The last line names the problem. Error messages are information, not verdicts.

Check one number

Verify one value by hand before trusting a table of thousands.

04 · Studio culture and Lab 1

Lab 1: Jupyter Workflow and Your First Plot

Lab session

  • Open JupyterLab from the repository root
  • Run the path cell, load the weather CSV
  • Build one labeled temperature plot

Deliverables (Friday)

  • Summary statistics: mean, min, max
  • One labeled time-series figure
  • Two or three interpretation sentences with units
04 · Studio culture and Lab 1

What This Course Is Not

  • Not a computer science course: no theory for theory's sake
  • Not software engineering: small, readable, tested scripts
  • Not AI-dependent: tools assist, you decide and verify
  • Not math-heavy: arithmetic and one regression line
Bridge

Connection to Next Week

This weekNext weekBridge idea
Run notebooks and make a plotVariables, lists, dictionariesFrom running code to writing your own
Summary

Key Takeaways

  • Monday concepts, Wednesday debrief and lab start, Friday studio
  • Reproducible = same data + code gives same result, hands-free
  • The project folder is the unit of reproducibility
  • Restart and Run All before every submission
Discussion · Next week: Python basics

?

What is one dataset from your own interests, any field, that you would want to analyze by December? Keep it in mind: it may become your final project.