Export Your Model
Learning objectives
- Write a model to NPY, CSV, and SEG-Y-lite
- Read the actual bytes of each format
- Choose a format by portability, size, and fidelity
- Load the exported file back in a research tool
A Model That Can Leave the Browser
Every model built in this course has lived inside the page. To be useful in research it has to leave, as a file another program can open. This section writes a small velocity model in three real formats and, as its point of pride, shows you the actual bytes on the wire. A file format is never a black box here; you can read the header with your own eyes.
- NPY, the NumPy format: a short ASCII header naming the dtype and shape, then the raw little-endian float32 data. One line of numpy.load reads it back.
- CSV: plain text, one row per depth sample and one column per surface location. It opens anywhere, at the cost of a larger file and rounded values.
- SEG-Y lite: an honest, simplified SEG-Y with an ASCII textual header, the standard binary reel header, trace headers, and IEEE float samples. A real SEG-Y reader can open it.
The Format Is a Fit-for-Purpose Choice
Switch formats and watch the hex dump change: the NPY magic bytes and its human-readable shape string, the plain numbers of the CSV, the readable C-lines of the SEG-Y textual header. Each is right for a different destination. NPY is the natural feed for a numpy or Devito workflow. CSV is the universal fallback when you do not know what will read it. SEG-Y is what a seismic processing package expects. There is no best format, only the one that matches the tool receiving the file.
That is the same fit-for-purpose judgment the whole course has trained, now applied to the very last step, getting the model out. With a model built, tested, and exportable, only one question remains before you ship it: is it actually valid? The closing section runs the quality checks, velocity ranges, stability, and sampling, that catch a broken model before it wastes a compute run.