Seismic waveform file conversion tooling for GaiaCode OmegaBox digitizer
data: converting between binary miniSEED, ASCII .dat (for SeismoSignal
ingestion), and SAC formats, with StationXML metadata injection into SAC
headers.
| Path | Description |
|---|---|
seed2dat.py |
Convert miniSEED → ASCII .dat (Time, Amplitude columns) for SeismoSignal, with optional sensitivity scaling from raw counts to physical units |
dat2seed.py |
Convert ASCII .dat back to binary miniSEED, reversing the sensitivity scaling to restore raw integer counts |
SEED2SAC/GaiaCode Pipeline/ |
Headless, cron-safe pipeline: mirrors miniSEED data directly from OmegaBox units over HTTP (wget), converts to SAC with ObsPy, and injects station coordinates / component orientation from StationXML into SAC headers |
- Python 3 with ObsPy (miniSEED/SAC I/O, StationXML parsing) and NumPy
- PyYAML — pipeline configuration
- wget — mirroring OmegaBox
/data/trees (pipeline)
- GaiaCode OmegaBox digitizer units (24-bit ADC) — the headless
pipeline mirrors continuous data directly from the units' built-in HTTP
server (
http://<unit-ip>/data/). The OmegaBox does not serve StationXML, so one metadata file per station is kept alongside the pipeline. seed2dat.py/dat2seed.pyoperate on local files and have no hardware dependency.
python3 -m venv venv
./venv/bin/pip install obspy numpy pyyaml
sudo apt install wget # pipeline only (Debian/Ubuntu)from seed2dat import mseed_to_dat
# sensitivity=1.0 keeps raw counts; use the channel's StationXML
# sensitivity (counts per m/s²) to export physical units
mseed_to_dat("sample.mseed", "converted_waveform.dat", sensitivity=1.0)Output: tab-separated Time(s) / Amplitude columns with a header row,
relative time starting at 0.0 s.
from dat2seed import dat_to_mseed
# use the SAME sensitivity used during export to restore original counts
dat_to_mseed("converted_waveform.dat", "restored_sample.mseed",
sensitivity=1.0, station="ST01")Sampling rate is recovered from the time column; absolute time and
station metadata (lost by the .dat format) are supplied as arguments.
cd "SEED2SAC/GaiaCode Pipeline"
# edit config.yaml: station list, archive roots, per-unit web_url
../venv/bin/python gaiacode_pipeline.py [--config config.yaml]One-shot per invocation — drive the schedule with cron (see the
pipeline's own README for
deployment details). Exit code 0 when every file converted, 1 if any
file failed.
- miniSEED — input/output waveform format (Steim-compressed records); read/written via ObsPy.
- SAC (Seismic Analysis Code) — output of the pipeline; one file per
channel per continuous segment, named
NET.STA.LOC.CHAN.D.YYYY.JJJ.HHMMSS.SAC. Headers populated withSTLA/STLO/STEL(coordinates),CMPAZ(azimuth), andCMPINC = dip + 90(SEED dip → SAC inclination convention). - StationXML (SeisComP schema) — per-station metadata used for SAC header injection; example files with placeholder coordinates included.
- ASCII
.dat— two-columnTime(s)/Amplitudetext for SeismoSignal ingestion. - HTTP — OmegaBox units expose their
/data/archive tree over plain HTTP; the pipeline mirrors it withwget -m(timestamping, only new/changed files transferred).