SPECTRA

Spatiotemporal Personal Exposure Characterization and TRAjectory Analyzer
by CHEAQI‑MNCH · Place Alert Labs (PALS) · Supported by DSI Africa
Developed by Place Alert Labs (PALS) · MSU
No coding required ~2 hours hands‑on Zimbabwe sample data included Enrol on this course →
Your course path
  1. Enrol and choose a password: spectra-enrol.html (already enrolled? check your status there).
  2. Sign in to the SPECTRA app with your enrolment email and password: portal.placealert.org/apex/
  3. Work through the lessons on this page.
  4. Take the final assessment: spectra-assessment.html. Score 80% or more and your certificate is issued straight away.
Overview

About this course

SPECTRA is the trajectory‑and‑exposure web app on the Place Alert Labs platform (the PALs Portal, from placealert.org → portal.placealert.org). It turns raw GPS tracks from wearables, phones, or low‑cost sensors into personal air‑pollution & heat exposure estimates by working out, point by point, where a person was, whether they were indoors or outdoors, how long they stayed, and how much they were exposed to there.

This course takes a non‑technical user from a raw CSV to a finished, publishable analysis, using only the buttons that exist in the live app. It mirrors SPECTRA's eight modules exactly.

What you need: a SPECTRA account (sign‑up + email verification on the login page), a modern browser, and a dataset with a person ID, a timestamp, GPS coordinates, and at least one exposure column. (Or just use the sample data below.)
Roadmap

Course map

#LessonApp moduleYou will be able to…
0Account & sign‑inLogin pageRegister, verify email, log in
1What SPECTRA doesconceptExplain the pipeline end‑to‑end
2Preparing your dataoff‑appBuild a CSV that maps first time
3Load & map fieldsInput & ConfigurationUpload & map columns
4Configure & runInput & ConfigurationSet parameters, choose buildings, run
5DashboardDashboardInterpret exposure summaries
6Maps & tracksGeospatial & TracksRead points, tracks, grid cells
7QualityQuality AssessmentRead accuracy, precision, recall, F1
8SegmentationSegmentationInterpret micro‑environments
9Export & sessionsData & ExportDownload CSV/GeoJSON/JSON + session
10TroubleshootingallFix the common failures
Hands‑on

Sample datasets — Zimbabwe

Synthetic GPS + exposure data for the exercises (fabricated for teaching, not real measurements). Column names auto‑map in SPECTRA. Built‑in story: indoor biomass cooking → PM2.5 spikes; commuting → NO₂; midday outdoors → WBGT heat stress.

Quick‑start · PM2.5

One participant, one day, PM2.5 only. Use for your first run (Lessons 3–5).

Gweru · 201 rows · PID, datetime, lat, lon, pm25
Download CSV

Master · all exposures

6 people × 3 days. PM2.5, NO₂, WBGT, temp, humidity, heat index + ground truth.

Gweru/Harare/Bulawayo/Mutare · 3,618 rows
Download CSV

Heat stress · WBGT

Harare participants with WBGT as the headline exposure. Map wbgt → Exposure 1.

Harare · 1,206 rows
Download CSV

Quality · labelled

Includes indoor_truth labels for the Quality lesson (Lesson 7).

Gweru · 1,206 rows
Download CSV
Heat‑stress file: SPECTRA has no automatic “WBGT” slot — after upload set Exposure 1 = wbgt (optionally + Add Exposure Variable for air_temp_c / heat_index_c). See datasets README.
Lesson 0

Getting an account & signing in

  1. Open SPECTRA at portal.placealert.org/apex/.
  2. On the dark login page click Sign up, enter email + password.
  3. Confirm via the verification email (check spam; ask a PALS admin if none arrives).
  4. Log in → you land on the SPECTRA home menu: seven module cards + About.
Golden rule, shown on the home screen: “Start by uploading your GPS trajectory data under Input & Configuration.”
Exercise 0: Log in, click each card once, then return home via the ⌂ Menu button (top‑left of every module).
Lesson 1

What SPECTRA actually does

CSV/GPS upload
  → Field mapping (lat? lon? person? time? exposure?)
  → Boundary filter (keep points in your study area)
  → Dwell time (how long at each point; remove "teleports")
  → Building footprints (OSM / Microsoft / Overture / custom)
  → Indoor / Outdoor classification (point-in-building + buffer + speed)
  → Micro-environment segmentation (indoor / outdoor / in-transport)
  → Grid aggregation (e.g. 100 m cells)
  → Daily summaries + dashboard + maps + quality metrics → Export

Key idea — time‑weighted exposure

SPECTRA weights each reading by how long the person dwelled there, so 8 hours indoors counts far more than a 2‑minute walk past a busy road. That is the “Personal Exposure” in the name.

Exercise 1: In one sentence, explain why dwell time matters for an exposure estimate. (Two people on the same street can have very different exposures.)
Lesson 2

Preparing your data

SPECTRA auto‑detects columns, but a clean file maps first time. One row per GPS point:

FieldRequired?Auto‑detected names
Latitude (WGS‑84)✅lat, latitude
Longitude (WGS‑84)✅lon, lng, longitude
Person ID✅PID, participant, id
Date/Time✅datetime, timestamp, date
Exposure 1 (e.g. PM2.5)✅ (≥1)pm25, pm2.5
Exposure 2 (e.g. NO₂)optionalno2
Ground‑truth indoor/outdooroptionalindoor_truth, label

Rules that save time: decimal‑degree coordinates; one consistent timestamp format; a real Person ID column (the engine batches per person); up to ~1 GB per file. Also accepted: .rds, .geojson, .gpx (wearables), or a direct CSV / published Google‑Sheet URL.

Exercise 2: Open zim_spectra_master.csv and confirm each required field exists and is clean.
Lesson 3

Load data & map fields · Input & Configuration

  1. From home click the Input & Configuration card.
  2. Section 1 · Data Input — pick the File Format toggle (CSV / RDS / GeoJSON / GPX / URL) and upload, or paste a URL and Load from URL.
  3. Section 2 · Field Mapping — confirm/fix the auto‑filled guesses: Coordinates (Lat, Lon), Identification (Person ID, Date/Time), Exposure Variables (map your pollutant to Exposure 1; + Add Exposure Variable for more), and the optional Ground‑truth.
A .gpx from a wearable exposes heart rate / cadence / speed / temperature — map any to an Exposure slot to analyse it like a pollutant.
Exercise 3: Upload gweru_pm25_quickstart.csv and confirm all five required fields map and the preview shows real data.
Lesson 4

Configure & run

ParameterDefaultControls
Grid size100 mMap/aggregation cell size
Speed limit100–120 km/hFlags impossible jumps (“teleports”)
Max dwell10–20 minCaps a single stationary point
Building buffer5 mTolerance around building edges
Remove teleportsYesDrops GPS glitches
Exclude indoorNoOptionally remove indoor points from grid

Building source (for indoor/outdoor)

SourceSpeedNotes
Microsoft FootprintsFast (local)Recommended; download for study area
Overture MapsFast (local)Merged global sources
OSM auto‑fetchSlow (API)No setup; fine for the sample data
Custom GeoJSON/GPKGFastYour own / government footprints

Click Run. Large datasets process in per‑person batches; a progress indicator shows the stage, and the live map previews your points.

Exercise 4: Run zim_spectra_master.csv with OSM auto‑fetch; note the runtime.
Lesson 5

Reading the Dashboard

The Dashboard summarises the run: total points, participants, days, indoor‑vs‑outdoor share, and time‑weighted mean exposure per pollutant, with plotly charts. This is your headline result — note how indoor cooking dominates the PM2.5 dose.

Exercise 5: Record the time‑weighted mean PM2.5 and the % of time indoors for one participant.
Lesson 6

Maps & trajectories · Geospatial & Tracks

Interactive Leaflet maps with switchable basemaps show classified points (indoor/outdoor), trajectory lines per person‑day, and grid cells shaded by exposure. Use them to sanity‑check classification and spot hotspots.

Exercise 6: Find one high‑exposure grid cell and describe what is there.
Lesson 7

Quality Assessment

With a ground‑truth label, this module shows a confusion matrix plus accuracy, precision, recall, F1 for the indoor/outdoor classifier — use it to defend your method. No ground truth → informational only.

Exercise 7: Upload gweru_quality_labelled.csv, map indoor_truth as Ground‑truth, and report accuracy and F1.
Lesson 8

Segmentation (micro‑environments)

Breaks each track into themes — typically indoor, outdoor, in‑transport — using building location, dwell time and speed. This is what lets you say “most of this person’s PM2.5 dose came from indoor cooking, not commuting.”

Exercise 8: For one participant, report the share of total exposure dose indoors vs in transport.
Lesson 9

Exporting & saving sessions · Data & Export

Download classified points / grid cells / daily summaries as CSV, GeoJSON, or JSON, and a Session RDS snapshot of the whole analysis.

Reuse trick: re‑load a Session RDS under Input & Configuration → Restore Previous Session to get all results back instantly, without re‑running.
Exercise 9: Export grid cells as GeoJSON, download a Session RDS, then restore it in a fresh login.
Lesson 10

Troubleshooting & good practice

SymptomLikely causeFix
Fields won’t auto‑mapOdd names / coords as textRename; use decimal‑degree numbers
Everything reads “outdoor”No buildings in areaUse Microsoft/Overture or custom footprints
Run is very slowOSM over a big areaUse a local building file; narrow boundary
Points jump on the mapGPS glitchesKeep Remove teleports on; lower speed limit
Indoor over‑counted at edgesBuffer too largeReduce building buffer from 5 m
No verification emailSMTP not configuredContact a PALS admin
Finish

Capstone project

Take one participant‑week from zim_spectra_master.csv and produce: (1) time‑weighted mean exposure per pollutant, (2) a hotspot map, (3) an indoor‑vs‑transport dose split, (4) a quality figure. Export everything plus a Session RDS and write a one‑paragraph interpretation — that is a CHEAQI‑MNCH mini‑analysis.

Certificate

Final assessment and certificate

When you have finished the lessons and the capstone, take the final assessment: 15 multiple-choice questions, pass mark 80%, up to 3 attempts in 24 hours. Passing issues your Place Alert Labs certificate straight away, with a QR code that anyone can scan to verify it.

Take the final assessment →

Cheat sheet

Quick reference

  • Always start at Input & Configuration → upload → map fields → run.
  • Five required fields: Lat, Lon, Person ID, Date/Time, ≥1 Exposure.
  • Faster & more accurate indoor/outdoor: use a local building footprint file.
  • Reproducibility: export the Session RDS every time.
  • Modules in order: Input → Dashboard → Geospatial → Quality → Segmentation → Export.