Skip to content

Commit cd685ba

Browse files
committed
Add matching content
1 parent 6737507 commit cd685ba

9 files changed

Lines changed: 356 additions & 263 deletions

File tree

227 KB
Loading
404 KB
Loading
25.2 KB
Loading
File renamed without changes.
File renamed without changes.

docs/plate-simulation/match.rst

Lines changed: 108 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,129 @@
33
Plate Matching
44
==============
55

6-
The Plate Matching module provides a user interface for querying a database of plate simulations to find the simulation that best matches a set of user-defined criteria.
6+
The plate matching algorithm searches through a library of pre-computed plate simulations to identify the best-fit conductor geometry for observed electromagnetic data at query locations. The matching process involves spatial and temporal interpolation, data normalization, and correlation-based scoring to rank candidate simulations.
7+
8+
.. figure:: /plate-simulation/images/match_landing.png
9+
:align: center
10+
:width: 80%
11+
12+
713

814
Interface
915
---------
1016

11-
.. figure:: /plate-simulation/images/sweep/sweep_uijson.png
17+
.. figure:: /plate-simulation/images/match_uijson.png
1218
:align: center
1319
:width: 80%
1420

1521
*Rendered user-interface in Geoscience ANALYST.*
1622

23+
1724
Inputs
1825
^^^^^^
1926

20-
- **A**
27+
The algorithm operates on the following inputs:
28+
29+
- **Survey**: A geophysical survey object containing the airborne TEM measurements and associated metadata
30+
- **EM data**: Airborne time-domain electromagnetic (TEM) measurements from the survey
31+
- **Query Points**: User-defined positions where plate parameters are to be estimated
32+
- **Query Max Distance**: Maximum distance from the query points along the survey line segments for consideration in the matching process
33+
- **Strike angle**: Optional angle to correct for the strike of the conductor relative to the survey line direction
34+
- **Topography**: Object representing the earth-air interface
35+
- **Elevation channel**: Optional channel containing elevation data for the topography locations. Mainly used for digital elevation models provided on Grid2D objects.
36+
- **Simulation directory**: A directory of pre-computed forward simulations representing various plate geometries and conductivities
37+
2138

2239
Methodology
2340
-----------
2441

25-
Something
42+
For each query location, the application identifies the closest survey line segment, extracts relevant observed data, and compares it against all simulations in the library using a multi-step matching process. To accommodate for variable position, time sampling, it is expected that the simulated library contains sufficient variability in plate parameters and survey geometries to capture the range of possible responses.
43+
44+
.. figure:: /plate-simulation/images/match_template.png
45+
:align: center
46+
:width: 80%
47+
48+
Template for the simulated data (black) and observed data (red) used in the matching process. The radial pattern centered on the plate allows to tighter sampling around the peak response, which is critical for accurate matching.
49+
50+
51+
The following sections describe the key steps of the matching algorithm.
52+
53+
54+
Spatial Interpolation
55+
^^^^^^^^^^^^^^^^^^^^^
56+
57+
The application performs spatial interpolation to align simulation data with observation points:
58+
59+
1. **Local coordinate transformation**: The application identifies the survey line segment nearest to each query location using a k-d tree spatial search. It transforms both the observed and simulated receiver locations into a local polar coordinate system (distance, azimuth, height) centered on the line segment.
60+
61+
2. **Strike angle correction**: If strike angles are provided, the application rotates the coordinate system to align the plate orientation with the survey geometry. This accounts for variations in conductor strike relative to the flight line direction.
62+
63+
3. **Inverse distance weighting**: The application constructs a sparse interpolation matrix using the 8 nearest simulation receivers for each observation point. The weights are computed using inverse distance weighting with a power of 2.0 and a minimum distance threshold of 0.1 to prevent singularities.
64+
65+
Temporal Interpolation
66+
^^^^^^^^^^^^^^^^^^^^^^
67+
68+
Time-domain electromagnetic data requires careful handling of the temporal sampling:
69+
70+
1. **Time channel alignment**: The application identifies the overlap between simulated and observed time channels. Only time gates within the simulated range are considered for matching.
71+
72+
2. **Interpolation matrix**: For each observation time within the valid range, the application constructs a sparse interpolation matrix using inverse distance weighting based on the temporal separation between channels. This allows for comparison even when simulated and observed time samplings differ.
73+
74+
Data Normalization
75+
^^^^^^^^^^^^^^^^^^
76+
77+
To enable robust comparison across different conductivity models and survey geometries, the application normalizes both observed and simulated data:
78+
79+
1. **Symlog transformation**: The application applies a symmetric logarithmic transformation to handle the large dynamic range of electromagnetic decay curves. The threshold is set at the 5th percentile of absolute data values.
80+
81+
2. **Median centering**: The application subtracts the median value from each time channel to remove DC offsets.
82+
83+
3. **Amplitude scaling**: The application scales each data profile to unit maximum absolute value, ensuring that shape matching dominates over amplitude matching.
84+
85+
Orientation Detection
86+
^^^^^^^^^^^^^^^^^^^^^
87+
88+
Electromagnetic anomalies are strongly dependent on the direction of approach relative to the conductor dip. Since simulations are only computed in the down-dip direction, the application automatically detects and corrects for orientation reversals:
89+
90+
1. **Spatial integration**: The application computes the integral of positive anomaly values on each half of the survey segment.
91+
92+
2. **Asymmetry test**: If more than 50% of the time channels show stronger anomalies on the left side of the segment, the application infers an up-dip approach and reverses the spatial ordering of the data.
93+
94+
Scoring and Ranking
95+
^^^^^^^^^^^^^^^^^^^
96+
97+
For each simulation file in the library, the application computes a match score:
98+
99+
1. **Cross-correlation**: For each time channel, the application computes the normalized cross-correlation between observed and simulated data. The peak correlation indicates the optimal spatial alignment.
100+
101+
2. **Alignment consistency**: The application records the index of maximum correlation for each time channel and computes the median alignment position across all channels.
102+
103+
3. **Residual norm**: The application computes the L2 norm of the difference between observed and amplitude-scaled simulated data across all time channels and spatial locations. This serves as the primary score metric, with lower values indicating better matches.
104+
105+
4. **Ranking**: The application sorts all simulations by ascending score, with the lowest-scoring simulation representing the best match.
106+
107+
Plate Parameter Extraction
108+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
109+
110+
Once the best-matching simulation is identified, the application extracts the plate parameters from the simulation metadata:
111+
112+
1. **Parameter retrieval**: The application reads the conductor geometry (strike length, dip length, width, dip angle, conductivity) from the ui.json metadata stored in the simulation file.
113+
114+
2. **Spatial positioning**: The application positions the plate at the centroid of the matched survey segment, adjusted vertically by the overburden thickness.
115+
116+
3. **Orientation correction**: The application applies strike angle corrections based on the local line azimuth and any user-specified strike angle offsets.
117+
118+
4. **Plate creation**: The application creates a new ``MaxwellPlate`` object in the output workspace with the extracted geometry and stores the full model parameters in the plate metadata.
119+
120+
Parallel Processing
121+
^^^^^^^^^^^^^^^^^^^
122+
123+
The matching algorithm leverages parallel processing to accelerate the comparison of large simulation libraries:
124+
125+
1. **File batching**: The application divides the simulation library into batches, with approximately 10 batches per worker process.
126+
127+
2. **Distributed scoring**: Each batch is submitted to a Dask worker for independent scoring. Workers compute spatial and temporal interpolations, normalize data, and calculate correlation scores without inter-process communication.
26128

129+
3. **Result aggregation**: The main process collects scores from all workers and performs the final ranking to identify the best match for each query location.
27130

28-
Tutorial
29-
--------
30-
To be added.
131+
This parallel architecture allows efficient processing of libraries containing hundreds to thousands of pre-computed simulations.

docs/plate-simulation/simulation.rst

Lines changed: 1 addition & 249 deletions
Original file line numberDiff line numberDiff line change
@@ -16,257 +16,9 @@ details are parameterized in a ui.json file that can be rendered in
1616
:width: 50%
1717

1818

19-
Interface
20-
=========
21-
22-
Simulating geophysical data from a physical property model requires three things:
23-
a computational mesh, a discretization of the model within that mesh, and a means
24-
to simulate the data. Plate simulation includes a module for generating a simple
25-
two-layer model with embedded plate anomalies within octree meshes. This section
26-
discusses all three of these components, their interface exposed by the ui.json file,
27-
and the storage of results.
28-
29-
.. figure:: /plate-simulation/images/methodology/uijson.png
30-
:align: center
31-
:width: 80%
32-
33-
*Merged images of both tabs of the ui.json rendered interface.*
34-
35-
36-
Geological Model
37-
----------------
38-
39-
Plate simulation includes a module for generating plates embedded in a two-layer
40-
Earth model within octree meshes. Many permutations of this simple geological
41-
scenario result in a complex interface. To simplify this, the discussion is
42-
organized into two sub-sections: background (basement and overburden) and plates.
43-
All model values within plate-simulation must be provided in SI units that varies depending on the chosen forward simulation (g/cc, SI or Ohm.m)
44-
45-
Background
46-
~~~~~~~~~~
47-
48-
The basement resistivity is actually closer to a halfspace in the sense that it
49-
fills the model anywhere outside of the overburden and plate. Therefore, the
50-
basement resistivity should be chosen as an effective resistivity for the whole
51-
geological section. This approach is quite reasonable for most applications
52-
where the differences in resistivity between layers are much smaller than the
53-
difference between overburden and any anomalous bodies (plates).
54-
55-
.. figure:: /plate-simulation/images/methodology/model/basement_options.png
56-
:align: center
57-
58-
*Basement resistivity option.*
59-
60-
The overburden is discretized by the resistivity and thickness of the layer.
61-
The thickness is referenced to the earth-air interface and extends into the
62-
earth by the amount specified in the thickness parameter.
63-
64-
.. figure:: /plate-simulation/images/methodology/model/overburden_options.png
65-
:align: center
66-
67-
*Overburden resistivity and thickness options.*
68-
69-
.. figure:: /plate-simulation/images/methodology/model/overburden_and_basement.png
70-
:align: center
71-
:width: 100%
72-
73-
*Model section highlighting the overburden and basement boundary.*
74-
75-
Plates
76-
~~~~~~
77-
78-
This section discusses the various plate options available through the ui.json
79-
and their impact on the resulting discretized model.
80-
81-
.. figure:: /plate-simulation/images/methodology/model/plate_options.png
82-
:align: center
83-
84-
*Plate options available in the ui.json.*
85-
86-
The first set of options allows the user to specify the number of plates and
87-
their spacing.
88-
89-
.. figure:: /plate-simulation/images/methodology/model/n_plates_options.png
90-
:align: center
91-
92-
*Number of plates and spacing options.*
93-
94-
For all choices of ``n>1``, the plates are evenly spaced at the requested spacing
95-
and share the same resistivity, size, and orientation.
96-
97-
.. figure:: /plate-simulation/images/methodology/model/three_plates.png
98-
:align: center
99-
:width: 100%
100-
101-
*Model created by choosing three plates spaced at 200m.*
102-
103-
The plate resistivity must be entered in SI units (g/cc, SI or Ohm.m).
104-
105-
.. figure:: /plate-simulation/images/methodology/model/plate_resistivity_option.png
106-
:align: center
107-
108-
*Plate resistivity option.*
109-
110-
The size of the plate is defined by three parameters: thickness, strike length,
111-
and dip length.
112-
113-
.. figure:: /plate-simulation/images/methodology/model/plate_size_options.png
114-
:align: center
115-
116-
*Plate size options.*
117-
118-
The image below shows a dipping plate with annotations indicating the size
119-
parameters for that particular plate.
120-
121-
.. figure:: /plate-simulation/images/methodology/model/plate_size.png
122-
:align: center
123-
:width: 100%
124-
125-
*A dipping plate striking northeast with annotations for its thickness,
126-
strike length and dip length.*
127-
128-
The plate orientation is defined in terms of dip and dip direction. The dip
129-
is the angle between the horizontal projection of the plate normal and the
130-
plate tangent sharing the same origin. The dip direction is measured between
131-
the horizontal projection of the plate normal and the North arrow. The image
132-
below provides a visual representation of these angles.
133-
134-
.. figure:: /plate-simulation/images/methodology/model/plate_orientation.png
135-
:align: center
136-
:width: 100%
137-
138-
*Plate orientation options. Plate orientation is given as a dip and dip direction.
139-
The dip (b) is defined as the angle between the horizontal the projection of the
140-
plate normal (n\') and the plate tangent sharing the same origin (t). The dip
141-
direction (a) is the angle measured between the horizontal projection of the plate
142-
normal (n\') and due north (N).*
143-
144-
The plate location can be specified in both relative and absolute terms. The position
145-
parameters are given as easting, northing, and elevation. If the relative locations
146-
checkbox is selected, the easting and northing are relative to the center of the
147-
survey and the elevation is relative to one of the available references. The elevation
148-
may be referenced to either the earth-air interface or the overburden via the
149-
``Depth reference`` dropdown. Either choice can be relative to the minimum, maximum,
150-
or mean of the points making up the reference surface as given by the ``Reference type``
151-
dropdown. In all these cases, the distance provided acts as a depth below the reference
152-
to the *top of plate* in the *z negative down* convention. If the relative locations
153-
checkbox is not selected, the easting, northing, and elevation specify the center
154-
location of the plate.
155-
156-
.. figure:: /plate-simulation/images/methodology/model/plate_location_options.png
157-
:align: center
158-
159-
*Plate location options in relative mode. Notice the* ``Elevation`` *is given as
160-
negative to ensure the top of the plate is below the selected min of the
161-
overburden.*
162-
163-
.. figure:: /plate-simulation/images/methodology/model/plate_location.png
164-
:align: center
165-
:width: 100%
166-
167-
*Example of a relative elevation referenced 100m below the minimum of the
168-
overburden layer.*
169-
170-
Data Simulation
171-
---------------
172-
173-
.. _simpeg_group_options:
174-
175-
The simulation parameters control the forward modeling of the plate model
176-
discretized within the octree mesh. Rather than exposing parameters within
177-
the plate simulation interface, the application allows the user to select an
178-
existing forward modelling SimPEG group. The user must ensure that the SimPEG
179-
group has been previously edited with appropriate options, includes at least a
180-
topography and survey object, and has selected one or more components to simulate.
181-
The user may also provide a name for the new SimPEG group to store the results.
182-
183-
.. figure:: /plate-simulation/images/methodology/data/simpeg_group_options.png
184-
:align: center
185-
186-
*Selecting the initialized forward modelling SimPEG group and naming the
187-
group that will store the plate simulation results.*
188-
189-
Create the required SimPEG group within Geoscience ANALYST through the
190-
``Geophysics`` menu under ``SimPEG Python Interface`` entry.
191-
192-
.. figure:: /plate-simulation/images/methodology/data/simpeg_group_creation.png
193-
:align: center
194-
:width: 100%
195-
196-
*Creating a SimPEG group to be selected within the plate simulation interface.*
197-
198-
Edit the options by right-clicking the group and selecting 'Edit Options'.
199-
200-
.. figure:: /plate-simulation/images/methodology/data/simpeg_group_edit_options.png
201-
:align: center
202-
203-
*Editing the SimPEG group options.*
204-
205-
Since plate-simulation creates its own mesh and model, the mesh and conductivity
206-
selections can be ignored. Selecting a value does not conflict with the
207-
plate-simulation objects and is simply ignored. In contrast, the survey, topography,
208-
and at least one component must be selected to run the simulation.
209-
210-
.. figure:: /plate-simulation/images/methodology/data/simulation_options.png
211-
:align: center
212-
:width: 80%
213-
214-
*Simulation options with annotations for required and not required components.*
215-
216-
Octree Mesh
217-
-----------
218-
219-
To accurately simulate the earth model, the mesh must be refined in key areas
220-
while remaining coarse enough elsewhere to efficiently simulate data. Plate
221-
simulation includes refinements at the earth-air interface, the transmitter and
222-
receiver sites, and on the surface of plates.
223-
224-
.. figure:: /plate-simulation/images/methodology/mesh/refinement.png
225-
:align: center
226-
:width: 100%
227-
228-
*Octree mesh refinement for earth-air interface, receiver sites,
229-
and within the mesh.*
230-
231-
The meshing is controlled by options exposed in the ui.json. These options are
232-
significantly reduced compared with octree creation from `grid-app <https://mirageoscience-grid-apps.readthedocs-hosted.com/>`_,
233-
as many parameters have been tailored to suit the needs of plate simulation.
234-
235-
.. figure:: /plate-simulation/images/methodology/mesh/mesh_options.png
236-
:align: center
237-
238-
*Octree mesh parameters exposed in the ui.json.*
239-
240-
Results
241-
-------
242-
243-
The results of the simulation are stored in the SimPEG group named in the
244-
:ref:`simpeg group option <simpeg_group_options>` section.
245-
246-
.. figure:: /plate-simulation/images/methodology/results.png
247-
:align: center
248-
249-
*Results group containing a survey object with all the simulated data channels
250-
stored in property groups, and an octree mesh containing the model parameterized
251-
in the interface.*
252-
253-
To iterate on the design of experiment, copy the options, edit them, and run again.
254-
255-
.. figure:: /plate-simulation/images/methodology/copy_options.png
256-
:align: center
257-
258-
*Copying the options to run a new simulation.*
259-
260-
261-
Advanced Applications
262-
---------------------
263-
264-
Two other applications are available to assist users in finding the best plate parameters to match observed data.
265-
The sweep application allows users to run a batch of simulations over a range of plate parameters, while the matching application uses an optimization algorithm to find the best fit between simulated and observed data.
266-
267-
26819
.. toctree::
26920
:maxdepth: 1
27021

22+
standalone
27123
sweep
27224
match

0 commit comments

Comments
 (0)