qgis-tem-loader

qgis plugin for loading TEM geophysical inversion XYZ files as 3D objects
git clone git://src.adamsgaard.dk/qgis-tem-loader # fast
git clone https://src.adamsgaard.dk/qgis-tem-loader.git # slow
Log | Files | Refs | README | LICENSE Back to index

README.md (3284B)


      1 # TEM Loader
      2 
      3 A QGIS 3.40+ plugin for loading Time-Domain Electromagnetic (TEM) geophysical inversion XYZ files as styled 3D vector layers.
      4 
      5 ## Overview
      6 
      7 TEM Loader parses XYZ inversion model files and loads them into QGIS as three layer types:
      8 
      9 - **Points** — surface terrain positions with survey line labels
     10 - **DOI** — depth-of-investigation points at depth
     11 - **Layers** — resistivity model layers as vertical 3D line segments
     12 
     13 Each file gets its own layer group. Layers are styled with pre-built QML styles and support the QGIS Elevation Profile tool for profile visualization.
     14 
     15 ## Requirements
     16 
     17 - QGIS 3.40.0 or later (up to 4.1.0)
     18 - Python 3 (bundled with QGIS)
     19 
     20 ## Installation
     21 
     22 1. Download `tem_loader.zip` from the [releases page](https://gitlab.com/qgeomodel/qgis-tem-loader/-/releases) or build it yourself (see below).
     23 2. In QGIS: **Plugins > Manage and Install Plugins > Install from ZIP**.
     24 3. Select the zip file and click **Install Plugin**.
     25 
     26 ## Usage
     27 
     28 1. Open a QGIS project.
     29 2. Go to **Plugins > TEM Loader > Load TEM XYZ files…**.
     30 3. Select one or more `.xyz` inversion files.
     31 4. If the file metadata declares an EPSG code, imported layers use that CRS; otherwise the loader falls back to the project CRS, then to EPSG:4326.
     32 5. Three CSV files (`.points.csv`, `.doi.csv`, `.layers.csv`) are written beside each source file, and the corresponding layers are added to the project with `points` above `doi` above `layers`.
     33 6. Invalid or malformed `.xyz` inputs are rejected with explicit validation errors, and when multiple files are selected the loader continues with the remaining files while reporting the failing input filename.
     34 
     35 ## XYZ File Format
     36 
     37 Input files are whitespace-delimited with optional `/`-prefixed metadata lines. The loader currently supports two export families:
     38 
     39 - **TEMImage** exports with `Line`, `StationNo`, `Z`, `DOI`, `DataResidual`, `NumLayers`, `Res_*`, and `Thick_*`
     40 - **Aarhus Workbench** exports with `LINE_NO`, `ELEVATION`, `RECORD`, `RESDATA`, `RHO_*`, `THK_*`, `DEP_TOP_*`, `DEP_BOT_*`, and `DOI_STANDARD`
     41 
     42 For Aarhus Workbench files, the plugin normalizes fields into the existing output schema by:
     43 
     44 - accepting either `X` / `Y` or `UTMX` / `UTMY` as source coordinate headers
     45 - deriving `StationNo` from `LINE_NO` and `RECORD` as `LINE_RECORD`, for example `1_00001`
     46 - mapping `DOI_STANDARD` to the output `DOI` field
     47 - using `ELEVATION` as the surface Z value
     48 - using `DEP_TOP_*` and `DEP_BOT_*` when building layer geometry
     49 
     50 Legacy TEMImage files with an extra leading index or project column are handled automatically.
     51 
     52 ## Development
     53 
     54 ```sh
     55 make test      # run the unittest suite
     56 make package   # build tem_loader.zip for installation
     57 make clean     # remove the zip
     58 ```
     59 
     60 `core.py` (XYZ parsing and CSV writing) has no QGIS dependency and is fully unit-testable. `tem_loader.py` (layer loading) requires a running QGIS instance and is verified manually.
     61 
     62 ## References
     63 
     64 - Test data from Salling from Madsen et al 2026:
     65   - publication DOI: <https://doi.org/10.1002/gdj3.70067>
     66   - data DOI: <https://doi.org/10.5281/zenodo.16894038>
     67 
     68 ## Repository
     69 
     70 - Source: <https://gitlab.com/qgeomodel/qgis-tem-loader>
     71 - Issues: <https://gitlab.com/qgeomodel/qgis-tem-loader/issues>
     72 - Author: Anders Damsgaard (<andam@geus.dk>)