Export Your Model

Part 9, Part 9: Earth Models at Scale

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.

Export your modelfirst bytes (offset hex ascii):0000093 4e 55 4d 50 59 01 00 76 00 7b 27 64 65 73 63.NUMPY..v.{'desc0001027 3a 20 27 3c 66 34 27 2c 20 27 66 6f 72 74 72': '<f4', 'fortr0002061 6e 5f 6f 72 64 65 72 27 3a 20 46 61 6c 73 65an_order': False000302c 20 27 73 68 61 70 65 27 3a 20 28 34 38 2c 20, 'shape': (48, 0004036 34 29 2c 20 7d 20 20 20 20 20 20 20 20 20 2064), } NPY header: dtype float32 (<f4), shape (48, 64). numpy.load reads it in one line.Export the model as NPY, CSV, or SEG-Y lite, with the bytes shown so the file is never a black box. Match the format to the tool that will read 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.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.