adamsgaard.dk

my academic webpage
git clone git://src.adamsgaard.dk/adamsgaard.dk # fast
git clone https://src.adamsgaard.dk/adamsgaard.dk.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit eddb5b5e2e7713cc499f51c5a5ad936bcc4d2d9c
parent a417e514b168e88c578ba85256f2cbfee50c4d2b
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri, 10 Apr 2026 16:40:04 +0200

018-tem-loader.html: fix legend

Diffstat:
Aimg/tem-loader.png | 0
Aimg/tem-loader2.png | 0
Apages/018-tem-loader.cfg | 8++++++++
Apages/018-tem-loader.html | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apages/018-tem-loader.txt | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 184 insertions(+), 0 deletions(-)

diff --git a/img/tem-loader.png b/img/tem-loader.png Binary files differ. diff --git a/img/tem-loader2.png b/img/tem-loader2.png Binary files differ. diff --git a/pages/018-tem-loader.cfg b/pages/018-tem-loader.cfg @@ -0,0 +1,8 @@ +filename=tem-loader.html +title=QGIS plugin for TEM data +description=A new QGIS plugin for loading TEM geophysical inversion files as 3D geospatial objects +id=tem-loader +tags=gis, science, geophysics +created=2026-04-10 +updated=2026-04-10 +#index=0 diff --git a/pages/018-tem-loader.html b/pages/018-tem-loader.html @@ -0,0 +1,75 @@ +<blockquote> +<p><a href="/tmp/tem_loader.zip">Download the current release: tem_loader.zip</a></p> +</blockquote> + +<p>If you run into problems installing or using the plugin, please <a href="mailto:andam@geus.dk">get in touch</a>.</p> + +<h2 id="motivation">Motivation</h2> +<p>The Transient Electromagnetic Method (TEM) geophysics method for imaging subsurface electrical properties from the ground surface or airborne instrumentaiton. The method is popular in ground-water surveys, mineral exploration, and other geological applications where differences in electrical resistivity of the subsurface are of interest.</p> + +<p>The subsurface resistivities are calculated through numerical inversion, where the observed decay of an induced magnetic field is matched against subsurface properties. The inverted resistivity models are the end goal for the geological analysis, and are typically exported from the inversion software as XYZ text files. The files contain one row per sounding, with a stack of resistivity layers and a depth of investigation. Reading these data usually requires specialized commercial software.</p> + +<p>TEM Loader is a QGIS plugin that does the import to QGIS. I made it for teaching activities under the Danish Strategic Sector Cooperation program, where we collaborate with geological surveys and water authorities in african countries on geophysics and geological modelling.</p> + +<h2 id="what-it-does">What it does</h2> +<p>The plugin reads inversion XYZ files exported from TEMImage and Aarhus Workbench. For each file it creates three layers in a group:</p> + +<ul> + <li><strong>Points</strong>: surface positions of each sounding.</li> + <li><strong>DOI</strong>: depth-of-investigation points, revealing the lower confidence boundary in the model.</li> + <li><strong>Layers</strong>: resistivity layers as vertical 3D line segments.</li> +</ul> + +<p>These layers are styled with bundled QML files. The imported geometries are visible in the QGIS 3D Map viewer and Elevation Profile tool, where it is possible to draw cross-sections along any line.</p> + +<figure class="pagefigure"> + <img src="img/tem-loader2.png" + alt="tTEM data from Denmark" + class="pageimg"/> + <figcaption> + Towed TEM (tTEM) data from Denmark. + </figcaption> +</figure> + +<figure class="pagefigure"> + <img src="img/tem-loader.png" + alt="TEM Profiler and sTEM data from Kenya" + class="pageimg"/> + <figcaption> + sTEM Profiler and sTEM 40x40 data from Kenya. + </figcaption> +</figure> + +<p>If the XYZ header declares an EPSG code, it is used. Otherwise the loader falls back to the project CRS, and then to EPSG:4326. Three CSV files (filename.points.csv, filename.doi.csv, filename.layers.csv) are written next to the source file.</p> + +<h2 id="how-the-data-becomes-geometry">How the data becomes geometry</h2> + +<p>The parser is a small core.py module with no QGIS dependency, which keeps it unit-testable. TEMImage and Aarhus Workbench headers are normalised into a common schema.</p> + +<p>Geometry is written as <a href="https://www.ogc.org/standard/sfa/">WKT</a> strings into the CSVs and parsed by QGIS on load. For a sounding at (x, y) with surface elevation z and depth of investigation doi:</p> + +<pre><code>z_doi = z - doi +point_wkt = f'POINT Z ({x} {y} {z})' +doi_wkt = f'POINT Z ({x} {y} {z_doi})' +</code></pre> + +<p>Each resistivity layer is emitted as a vertical LINESTRING Z between the top and bottom elevations of that layer:</p> + +<pre><code>z_top = z - depth_top +z_bot = z - depth_bottom +layer_wkt = f'LINESTRING Z ({x} {y} {z_top}, {x} {y} {z_bot})' +</code></pre> + +<p>For TEMImager data the depths are accumulated from the Thick_* columns. For Aarhus Workbench data the explicit DEP_TOP_* and DEP_BOT_* columns are used when present. Rendered side by side along a survey line, the stacked line segments form a fence diagram coloured by resistivity.</p> + +<p>TEM Loader targets QGIS 3.40 or later, and works on Windows, MacOS, and Linux.</p> +<ol type="1"> + <li>Download <a href="/tmp/tem_loader.zip">tem_loader.zip</a>.</li> + <li>In QGIS: <strong>Plugins → Manage and Install Plugins → Install from ZIP</strong>.</li> + <li>Select the file and click <strong>Install Plugin</strong>.</li> + <li>The plugin appears under <strong>Plugins → TEM Loader → Load TEM XYZ files…</strong>.</li> +</ol> + +<p>Source and issue tracker: <a href="https://gitlab.com/qgeomodel/qgis-tem-loader">gitlab.com/qgeomodel/qgis-tem-loader</a>.</p> + +<p>If something does not work, or the loader rejects a file it should handle, please <a href="mailto:andam@geus.dk">send me an email</a>.</p> diff --git a/pages/018-tem-loader.txt b/pages/018-tem-loader.txt @@ -0,0 +1,101 @@ + [1]Download the current release: tem_loader.zip + +If you run into problems installing or using the plugin, please get +in touch. + +## Motivation + +The Transient Electromagnetic Method (TEM) geophysics method for +imaging subsurface electrical properties from the ground surface +or airborne instrumentaiton. The method is popular in ground-water +surveys, mineral exploration, and other geological applications +where differences in electrical resistivity of the subsurface are +of interest. + +The subsurface resistivities are calculated through numerical +inversion, where the observed decay of an induced magnetic field +is matched against subsurface properties. The inverted resistivity +models are the end goal for the geological analysis, and are typically +exported from the inversion software as XYZ text files. The files +contain one row per sounding, with a stack of resistivity layers +and a depth of investigation. Reading these data usually requires +specialized commercial software. + +TEM Loader is a QGIS plugin that does the import to QGIS. I made +it for teaching activities under the Danish Strategic Sector +Cooperation program, where we collaborate with geological surveys +and water authorities in african countries on geophysics and +geological modelling. + +## What it does + +The plugin reads inversion XYZ files exported from TEMImage and +Aarhus Workbench. For each file it creates three layers in a group: + + - Points: surface positions of each sounding. + - DOI: depth-of-investigation points, revealing the lower confidence + boundary in the model. + - Layers: resistivity layers as vertical 3D line segments. + +These layers are styled with bundled QML files. The imported +geometries are visible in the QGIS 3D Map viewer and Elevation +Profile tool, where it is possible to draw cross-sections along any +line. + +If the XYZ header declares an EPSG code, it is used. Otherwise the loader falls +back to the project CRS, and then to EPSG:4326. Three CSV files +(filename.points.csv, filename.doi.csv, filename.layers.csv) are written next +to the source file. + +## How the data becomes geometry + +The parser is a small core.py module with no QGIS dependency, which +keeps it unit-testable. TEMImage and Aarhus Workbench headers are +normalised into a common schema. + +Geometry is written as [3]WKT strings into the CSVs and parsed by +QGIS on load. For a sounding at (x, y) with surface elevation z +and depth of investigation doi: + +z_doi = z - doi +point_wkt = f'POINT Z ({x} {y} {z})' +doi_wkt = f'POINT Z ({x} {y} {z_doi})' + +Each resistivity layer is emitted as a vertical LINESTRING Z between +the top and bottom elevations of that layer: + +z_top = z - depth_top +z_bot = z - depth_bottom +layer_wkt = f'LINESTRING Z ({x} {y} {z_top}, {x} {y} {z_bot})' + +For TEMImager data the depths are accumulated from the Thick_* +columns. For Aarhus Workbench data the explicit DEP_TOP_* and +DEP_BOT_* columns are used when present. Rendered side by side along +a survey line, the stacked line segments form a fence diagram +coloured by resistivity. + +TEM Loader targets QGIS 3.40 or later, and works on Windows, MacOS, +and Linux. + + 1. Download [4]tem_loader.zip. + 2. In QGIS: Plugins → Manage and Install Plugins → Install from ZIP. + 3. Select the file and click Install Plugin. + 4. The plugin appears under Plugins → TEM Loader → Load TEM XYZ files…. + +Source and issue tracker: [5]https://gitlab.com/qgeomodel/qgis-tem-loader. + +If something does not work, or the loader rejects a file it should +handle, please [6]send me an email. + +Examples: +- sTEM data from Kenya: https://andersdamsgaard.dk/img/tem-loader.png +- tTEM data from Denmark: https://andersdamsgaard.dk/img/tem-loader2.png + +References: + +[1] file:///tmp/tem_loader.zip +[2] mailto:andam@geus.dk +[3] https://www.ogc.org/standard/sfa/ +[4] file:///tmp/tem_loader.zip +[5] https://gitlab.com/qgeomodel/qgis-tem-loader +[6] mailto:andam@geus.dk