Lab · Experimental observatory
OceanLab MX
Intelligent Oceanographic Observatory of Mexico
An independent experimental platform that brings together weather and ocean data, physical simulation and artificial intelligence to study how autonomous marine observation stations behave.
Ten virtual stations in the Mexican Pacific with real data from public models, refreshed every 15 minutes, and a 3D buoy digital twin with its own physics engine and firmware.
Technologies
- C++ → WebAssemblyBuoy physics engine: JONSWAP sea, heave, pitch, RK4
- C → WebAssemblyVirtual firmware: sensors, filters, power, CRC frames
- Three.js · WebGL3D digital twin with GPU-computed waves
- TypeScript · AstroFast, static, bilingual interface
- PHP 8.3REST API, connectors and scheduled jobs
- MySQLTime series, forecasts and verification
- Open-MeteoPublic marine and weather models
- Natural Earth · d3-geoOwn map in Mercator projection
- KaTeXEquations for every method
- Observatory status
- —
- Stations
- 10
- Active sources
- —
- Last update
- —
- Stored records
- —
- Open quality events
- —
Station map
Each point shows the model value at that station. There is no interpolation between stations: the colour says nothing about the sea in between. The arrow shows where it is moving to.
Coastlines: Natural Earth (public domain).
Virtual station: a query point on numerical models. It is not a physical buoy nor an Apixqui station.
Loading data…
History and forecast:
Stored history · Forecast (external model)
Solid line: values stored by OceanLab (MODEL_ANALYSIS). Dotted line: latest stored forecast run (FORECAST). Forecasts do not replace official warnings.
Source status and quality
Buoy digital twin ·
SIMULATIONA generic 3 m buoy simulated with our own physics engine (C++ → WebAssembly) and a virtual firmware (C → WebAssembly). Live mode uses the selected station’s latest values as inputs; the buoy response is a computation, not a measurement.
Lab experiments live only in your browser. They are not sent or stored in the database.
Downloads about 145 kB compressed (three.js and the WebAssembly modules).
Input conditions
Physical response (C++ engine)
Sea elevation (dashed) and buoy heave, last 30 s
Virtual firmware (C)
Last packet (23 bytes, CRC-16)
—Small-amplitude linear model: JONSWAP sea state (32 components), heave and pitch as damped oscillators driven by the surface, wind-vane yaw. The input period uses the model’s mean period as an approximation of peak period. Details and tests in oceanlab/docs/FISICA_BOYA.md.
Weather data by Open-Meteo.com · CC BY 4.0
Mathematics and methods
Every formula OceanLab MX uses, exactly as implemented. Each section names the file where it lives; the tests that check them are in SCIENTIFIC_VALIDATION.md.
1. Data: units, quality and freshness
Every value is converted to a canonical unit before storage. Conversions are linear and recorded next to the original value:
Physical plausibility: a value is rejected if it falls outside its variable's catalogue limits, (e.g. SST between −2.5 and 40 °C). These are not hazard thresholds.
Freshness: a value is available while its age stays within the source limit (90 min). After that it is marked stale and moves to the HISTORICAL class:
A source is only marked degraded on errors or when rejections exceed 1%: .
Code: public/api/oceanlab/lib/Normalize.php, Api.php
2. Forecast verification
For each variable and horizon h, stored forecasts are compared with the value OceanLab stored later for that hour :
The baseline is persistence: assume the value does not change from issue time, . Skill measures how much the forecast improves on it:
Skill = 1 is perfect, 0 is no better than persistence and negative is worse. The reference is an analysis from the same provider, not an independent measurement.
Code: public/api/oceanlab/lib/Maintenance.php
3. Irregular sea: JONSWAP spectrum
The sea state is set by significant height and peak period , with . The spectral shape is JONSWAP with :
It is discretised into components between and . Each has an amplitude, wavenumber (deep water), direction and phase:
Directions spread around the mean direction with , . Phases come from a seeded congruential generator, so the same experiment repeats exactly. Finally amplitudes are scaled so the spectrum gives exactly the requested :
The 3D scene uses these same components on the GPU: the sea you see is the sea that moves the buoy.
Code: oceanlab/engine/buoy.cpp
4. Buoy dynamics
Heave (vertical motion ) as a damped oscillator driven by the surface . With diameter , waterplane area and mass :
With the default buoy (3 m, 1,500 kg, ζ = 0.08) the heave natural period is 2.44 s, far below ocean waves (6 to 16 s): that is why the buoy follows the surface almost exactly. The steady response to a wave of frequency ω is:
Pitch and roll (tilts ): the mast seeks the surface normal with metacentric stiffness, and wind and current add steady moments:
Static wind heel: . Heading: the buoy weathervanes into the wind, with s.
Numerical integration: 4th-order Runge-Kutta with substeps s:
Code: oceanlab/engine/buoy.cpp, buoy.hpp
5. Virtual firmware and signal processing
Each sensor reads the model value plus Gaussian noise (Box-Muller), clamps it to its range and quantises it with its converter resolution :
Exponential low-pass filter with time constant (60 s for temperatures, 120 s for pressure, 30 s for wind):
On-board waves: the vertical accelerometer (4 Hz) is integrated twice with the trapezoid rule. After each integration a first-order high-pass ( Hz) removes drift:
The high-pass underestimates Hs by about 7.5% with 9 s waves; this is tested and documented. Energy: the panel delivers power proportional to shortwave radiation and the battery integrates the balance:
The telemetry frame (23 bytes) ends with a CRC-16/CCITT-FALSE: polynomial (0x1021), initial value 0xFFFF. A pressure sensor repeating the exact same reading 12 times in a row, with noise active, is declared frozen (FAULT).
Code: oceanlab/firmware/firmware.c
6. Map projection
The map uses the Mercator projection over Natural Earth 1:50 m. Cursor coordinates come from the inverse:
Each station is drawn with its own value. Nothing is interpolated between stations: the space between points has no data.
Code: oceanlab/tools/gen-map.mjs
How to read each value
- MODEL_ANALYSIS
- An estimate from a scientific model for that time, not an instrument measurement.
- FORECAST
- A forecast from an external source.
- HISTORICAL
- The last stored value, older than the source’s normal update interval.
- UNAVAILABLE
- The source did not deliver the value.
Sources and attribution
- Open-Meteo Marine API. Open-Meteo (MeteoFrance MFWAM/SMOC, ECMWF WAM, NCEP GFS Wave, DWD). License CC BY 4.0.
- Open-Meteo Weather Forecast API. Open-Meteo (modelos meteorológicos nacionales, best_match). License CC BY 4.0.
Independence statement
OceanLab MX is an independent experimental research and technology outreach project developed by Gersaín Barrón Velázquez within the GersaDesign lab.
It uses public weather and ocean data sources, mathematical models and artificial intelligence techniques.
It is not an official monitoring, early warning, navigation or civil protection system. Simulations and experimental models do not replace official warnings and forecasts.
References to Mexican technology initiatives are for information and science only and imply no institutional affiliation.