This repository downloads recent NOAA coastal water temperature observations for a small set of California stations and stores them as CSV files.
main.py— script that requests water temperature data from the NOAA Tides & Currents API and writes one CSV per station.stations.csv— list of California stations used by the script.data/— downloaded station-level water temperature files.pyproject.toml— minimal Python project configuration and dependencies.
The data comes from the NOAA Tides & Currents API using the water_temperature product.
The script requests:
- station observations
- metric units
- local station time (
lst_ldt) - CSV output format
.
├── data/
│ ├── water_temperature-<StationName>-<begin_date>-<end_date>.csv
├── main.py
├── stations.csv
├── pyproject.toml
└── README.md
List of stations to query.
| column | description |
|---|---|
id |
NOAA station ID |
name |
human-readable station name |
Example:
id,name
9410170,San Diego
9410230,La JollaThe script writes one CSV file per station into data/.
Filename pattern:
data/water_temperature-<StationName>-<begin_date>-<end_date>.csv
Example:
data/water_temperature-San Diego-20260619-20260720.csv
| column | description |
|---|---|
StationID |
NOAA station ID |
StationName |
station name from stations.csv |
Date_Time |
observation timestamp in local station time |
Water_Temperature |
water temperature in degrees Celsius |
X |
NOAA quality/control flag field from the API output |
N |
NOAA quality/control flag field from the API output |
R |
NOAA quality/control flag field from the API output |
{
"StationID": "NOAA station identifier",
"StationName": "Human-readable station name",
"Date_Time": "Observation timestamp in local station time (lst_ldt)",
"Water_Temperature": "Observed water temperature in degrees Celsius",
"X": "NOAA flag column carried through from source data",
"N": "NOAA flag column carried through from source data",
"R": "NOAA flag column carried through from source data",
}- Read the station list from
stations.csv - Request water temperature data for each station
- Normalize column names
- Add
StationIDandStationName - Save one CSV file per station under
data/
Install dependencies and run:
python main.py- The date range is currently hard-coded in
main.py. - Existing files are not overwritten unless you confirm it interactively.
- Some stations may return no data for the selected date range.