Hourly meteorological data from 40 weather stations at NUS campus, Singapore (2025)
Project description
🌦️ nus-campus-weather
Python package for the NUS Campus Meteorological Network dataset — hourly observations from 40 automatic weather stations across the National University of Singapore (NUS) main campus, Singapore, for the full calendar year 2025.
Dataset repo: nus-campus-weather-paper
PyPI:pip install nus-campus-weather(once published)
📦 Installation
From PyPI (once published):
pip install nus-campus-weather
From source:
git clone https://github.com/City-Syntax/nus-campus-weather.git
cd nus-campus-weather
pip install -e .
Dependencies: pandas, numpy, matplotlib, seaborn
Optional (for map backgrounds): contextily
🚀 Quick Start
import nus_campus_weather as ncw
# Just use it — the dataset auto-downloads from Zenodo on first call
# (~100 MB, one-time), then cached for future use.
df = ncw.load_station("WS01")
fig = ncw.plot_climatology()
Optional — explicit fetch
ncw.fetch_dataset() # download/cache now instead of on first load
Optional — bring your own copy
If you have a local clone of the dataset repo (useful for development or offline work), point the loader at it:
ncw.set_data_dir("/path/to/nus-campus-weather-paper")
# Or via env var:
# export NUS_WEATHER_DATA="/path/to/nus-campus-weather-paper"
The auto-fetch caches to your platform cache dir (~/Library/Caches/nus_campus_weather/
on macOS, ~/.cache/nus_campus_weather/ on Linux, %LOCALAPPDATA%\nus_campus_weather\
on Windows). Override with the NUS_WEATHER_CACHE environment variable.
Dataset version
ncw.DATASET_VERSION # '1.0.0'
ncw.DATASET_DOI # '10.5281/zenodo.20477761'
📂 Loading Data
Single station
# Raw sensor data
df = ncw.load_station("WS01")
# Gap-filled data (includes _flag columns)
df = ncw.load_station("WS01", imputed=True)
Each CSV has columns: Datetime, Latitude, Longitude, and six meteorological variables. Imputed files add a _flag column per variable (0 = original, 1 = linear interpolation, 2 = XGBoost).
All 40 stations
# Wide format — one column per station (8760 rows × 40 cols)
temp = ncw.load_all(variable="AirTemp Ave (C)", imputed=True)
# Long format — all stations stacked
long_df = ncw.load_all(imputed=True)
Station metadata
meta = ncw.station_metadata()
# Returns a DataFrame indexed by station (WS01..WS40) with columns: lat, lon
📊 Plot Functions
All plot functions use the data directory set via set_data_dir() and save figures to a figures/ subfolder within it.
| Function | Output |
|---|---|
ncw.plot_completeness() |
Bubble map (Fig 4) + monthly heatmap (Fig 5) |
ncw.plot_climatology() |
Diurnal × seasonal climatology (Fig 6b) |
ncw.plot_radials() |
Annual radial climatology, all variables (Fig 6a, 8a–f) |
ncw.plot_imputation_examples() |
Representative gap-fill examples (Fig 10) |
ncw.plot_completeness()
ncw.plot_climatology()
ncw.plot_radials()
ncw.plot_imputation_examples()
🗂️ Dataset Variables
| Column | Units | Notes |
|---|---|---|
AirTemp Ave (C) |
°C | 2 m height |
RelHum Ave (%) |
% | 2 m height |
AtmPress Ave (hPa) |
hPa | |
GlobalRad Ave (W/m2) |
W m⁻² | Global horizontal irradiance |
WindSpeed Ave (m/s) |
m s⁻¹ | 2 m height |
WindDir Ave (degrees) |
° | 0–360° |
Rain Tot (mm) |
mm | WS02, WS16, WS35 only |
⚠️ Known issues
- WS17 atmospheric pressure — faulty sensor;
AtmPress Ave (hPa)isNaNin both raw and imputed files. - WS38 global irradiance — complete pyranometer failure; imputed values are spatially reconstructed, treat with caution.
- Wind speed/direction — spatially decorrelated at intra-campus scale; use only flag = 0 observations for wind analyses.
📄 Citation
If you use this package or dataset, please cite:
[Authors]. World's densest campus weather network: a 40-station hourly meteorological dataset from tropical Singapore. Scientific Data [year]. DOI: [to be assigned]
📜 Licence
Code (this package): MIT — see LICENSE.
Dataset: CC BY 4.0 — see the dataset repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nus_campus_weather-1.1.0.tar.gz.
File metadata
- Download URL: nus_campus_weather-1.1.0.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b6f82aefeb7dba308c526414ddc11568b646f0be3e81f2ad7eff2d4d84e7ff0
|
|
| MD5 |
5b793ac2e6eed402c3a6ce336d374f7f
|
|
| BLAKE2b-256 |
faffc70b70a1bdd4fe3e404cc1923ecaab2f3dd727fad45fa69c48fa34844d1b
|
File details
Details for the file nus_campus_weather-1.1.0-py3-none-any.whl.
File metadata
- Download URL: nus_campus_weather-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cf28775c813a47a2b3bba6f03693c9626269384c31aa68f357cc499d7e83c77
|
|
| MD5 |
29a01f6ad85d3e6d5378f7547861df3e
|
|
| BLAKE2b-256 |
b2ce652b081344445414d6aecb3a8aae0556cab5892bce0928be3c8d8913b2ae
|