Write a portable ZIP snapshot of an inversion result.
The archive always contains common products (metadata, NPZ, CSV). Existing
backend-native files referenced by result.files are included under
native_files/ when include_native is true.
Export a recovered resistivity model as long-form CSV.
The CSV writer stores one row per model cell with profile position, depth,
resistivity value, and station label. It is the simplest exchange format for
spreadsheets, quick inspection, and downstream scripts that do not need mesh
topology.
Each model cell is written as one polygon feature. Cell properties include
ix, iz, cell-center coordinates, resistivity, and matching
uncertainty maps such as uncertainty_confidence when available.
Export a 2-D inversion section as a single-band GeoTIFF.
This writer requires rasterio. The raster axes are profile distance
and depth in metres; pass crs only when those coordinates are already tied
to a projected coordinate reference system.
Parameters:
result (InversionResult) – Inversion result convertible to a 2-D resistivity model.
path (path-like) – Output GeoTIFF path. Parent directories are created automatically.
log_rho (bool, default True) – If True, write log10 resistivity. If False, write linear
resistivity in ohm metres.
crs (object, optional) – Coordinate reference system passed to rasterio. Use this only
when profile/depth coordinates are already in a projected CRS.
Export common result arrays to a compressed NumPy archive.
The NPZ writer preserves numerical arrays used by the inversion API:
resistivity grid, coordinates, station metadata, RMS, and optional
uncertainty/history arrays. It is the preferred lightweight format for
Python workflows because arrays are stored without text parsing.
Parameters:
result (InversionResult) – Inversion result convertible to a resistivity model. Uncertainty and
convergence-history arrays are exported when present.
path (path-like) – Output .npz path. Parent directories are created automatically.
The profile coordinate is written on the VTK X axis, a dummy cross-line
axis is written on Y, and positive-down depth is written on Z. Matching
2-D uncertainty arrays are included as additional cell scalars.