CO₂ Interpolation Tool
The CO₂ Interpolation Tool generates a spatial concentration map by fitting a Gaussian process model to the active CO₂ sensor network. The result is visualized as either a smooth heatmap or contour polygons on the Cesium globe.
Prerequisites
- CO₂ Sensors must be enabled and loaded before running interpolation (see CO₂ Sensors)
- At least 3 sensors must pass the validity checks
Opening the Tool Panel
Enable CO₂ Sensors from the sidebar. A CO₂ Interpolation Tool panel appears as a floating panel above the bounding box area. It contains:
- Run Interpolation button
- Smooth / Contours mode toggle
- Opacity slider (0–0.95)
- Stats area (populated after a successful run)
- Target Mode button
Sensor Validity Checks
When Run Interpolation is clicked, the app screens each sensor:
| Check | Criterion |
|---|---|
| Has coordinates | lat and lon (or long) must be present and numeric |
| Valid CO₂ range | CO₂ must be between 0 and 1500 ppm |
| Within Central FL bounds | Latitude: 27.5–29.5 °N, Longitude: 80.5–82.5 °W |
Sensors that fail are excluded. A rejection popup lists each excluded sensor and the reason. If fewer than 3 sensors pass, interpolation is aborted with an error notification.
The Interpolation Request
Valid sensors are sent to the UCF JetStream Cloud backend:
POST https://ucf-urbangeolens-backend.cis251126.projects.jetstream-cloud.org/co2/interpolate-co2
Content-Type: application/json
{
"coordinates": [[lat1, lon1], [lat2, lon2], ...],
"values": [co2_1, co2_2, ...]
}
Response
{
"status": "success",
"grid_points": [[lat, lon], ...],
"predictions": [co2_value, ...],
"contours": { GeoJSON FeatureCollection },
"l": 0.042,
"area_m2": 1234567.8,
"bbox_area_m2": 2000000.0
}
| Field | Description |
|---|---|
grid_points | Regular grid of coordinates covering the sensor convex hull |
predictions | Predicted CO₂ value at each grid point |
contours | GeoJSON polygons representing iso-concentration contours |
l | Gaussian process length scale parameter (km) |
area_m2 | Area of the convex hull of input sensors (m²) |
bbox_area_m2 | Area of the bounding box around the sensors (m²) |
Visualization Modes
Smooth Heatmap
A textured rectangle entity is rendered on the Cesium globe, sized to the sensor bounding box. The texture is generated by:
- Mapping each prediction value to an RGBA color (blue → green → yellow → red)
- Painting the colors onto a
<canvas>as a grid - Converting the canvas to a
Cesium.MaterialusingMaterialProperty
Contour Mode
GeoJSON contour polygons from the API response are rendered as Cesium polygon entities. Each contour is filled with a semi-transparent color matching the CO₂ concentration range it represents.
Toggle between modes using the Smooth / Contours buttons in the tool panel.
Opacity Control
The opacity slider adjusts the transparency of both the heatmap and contour layers in real time (range 0–0.95).
Statistics Panel
After a successful run, animated stat cards display:
| Stat | Description |
|---|---|
| Mean | Average predicted CO₂ across the grid (ppm) |
| Median | Median predicted CO₂ (ppm) |
| Std Dev | Standard deviation of predictions |
| Min / Max | Minimum and maximum predicted values |
| Length Scale (l) | Gaussian process characteristic length scale — represents the spatial correlation distance in km |
| Hull Area | Area of the convex hull of input sensors (km²) |
| Bbox Area | Area of the bounding box around sensors (km²) |
Copy buttons allow copying each stat to the clipboard.
Target Query Mode
Click Target Mode to enable an on-map query cursor. Click any point on the globe to estimate the CO₂ concentration at that location using the fitted model. A pin is placed at the clicked location and the interpolated value is displayed.
Click Target Mode again to disable it.
Color Scale
The CO₂ color mapping runs from blue (low) through green and yellow to red (high), scaled to the min/max of the current prediction set.
Limitations
- Interpolation is limited to the Central Florida region (sensor deployment area)
- The JetStream Cloud backend must be reachable from the server
- Results are a statistical estimate, not a direct measurement — sensor density and placement affect accuracy
- The Gaussian process assumes spatial stationarity; it works best when sensors are distributed across the area of interest