Skip to content

Commit 0b4c98e

Browse files
authored
Merge pull request #368 from MiraGeoscience/GEOPY-2776
GEOPY-2776: Relabel uijson for TEM using Vertical, inLine, cross-line
2 parents 781475a + 8c0bf74 commit 0b4c98e

20 files changed

Lines changed: 284 additions & 134 deletions

simpeg_drivers-assets/uijson/tdem1d_forward.ui.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"z_channel_bool": {
4040
"group": "Survey",
4141
"main": true,
42-
"label": "Z component",
42+
"label": "Vertical",
43+
"tooltip": "Vertical (w) component of the magnetic data",
4344
"value": true
4445
},
4546
"u_cell_size": {

simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"group": "Data",
4646
"dataGroupType": "Multi-element",
4747
"main": true,
48-
"label": "z-component",
48+
"label": "Vertical",
49+
"tooltip": "Vertical (w) component of the magnetic data",
4950
"parent": "data_object",
5051
"optional": true,
5152
"enabled": true,

simpeg_drivers-assets/uijson/tdem_forward.ui.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,25 @@
5858
],
5959
"value": "dB/dt (T/s)"
6060
},
61-
"z_channel_bool": {
61+
"vertical_channel_bool": {
6262
"group": "Survey",
6363
"main": true,
64-
"label": "Z component",
64+
"label": "Vertical",
65+
"tooltip": "Vertical (w) component of the magnetic data.\nPositive up along the z-axis if no receiver orientation provided",
6566
"value": true
6667
},
67-
"x_channel_bool": {
68+
"inline_channel_bool": {
6869
"group": "Survey",
6970
"main": true,
70-
"label": "X component",
71+
"label": "In-line",
72+
"tooltip": "In-line (u) component of the magnetic data.\nPositive towards North if no receiver orientation provided",
7173
"value": true
7274
},
73-
"y_channel_bool": {
75+
"crossline_channel_bool": {
7476
"group": "Survey",
7577
"main": true,
76-
"label": "Y component",
78+
"label": "Cross-line",
79+
"tooltip": "Cross-line (v) component of the magnetic data.\nPositive towards East if no receiver orientation provided",
7780
"value": true
7881
},
7982
"mesh": {

simpeg_drivers-assets/uijson/tdem_inversion.ui.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
],
5959
"value": "dB/dt (T/s)"
6060
},
61-
"z_channel": {
61+
"vertical_channel": {
6262
"association": [
6363
"Cell",
6464
"Vertex"
@@ -67,13 +67,14 @@
6767
"group": "Data",
6868
"dataGroupType": "Multi-element",
6969
"main": true,
70-
"label": "z-component",
70+
"label": "Vertical",
7171
"parent": "data_object",
72+
"tooltip": "Vertical (w) component of the magnetic data.\nPositive up along the z-axis if no receiver orientation provided",
7273
"optional": true,
7374
"enabled": true,
7475
"value": ""
7576
},
76-
"z_uncertainty": {
77+
"vertical_uncertainty": {
7778
"association": [
7879
"Cell",
7980
"Vertex"
@@ -84,11 +85,11 @@
8485
"main": true,
8586
"label": "Uncertainty",
8687
"parent": "data_object",
87-
"dependency": "z_channel",
88+
"dependency": "vertical_channel",
8889
"dependencyType": "enabled",
8990
"value": ""
9091
},
91-
"x_channel": {
92+
"inline_channel": {
9293
"association": [
9394
"Cell",
9495
"Vertex"
@@ -97,13 +98,14 @@
9798
"group": "Data",
9899
"dataGroupType": "Multi-element",
99100
"main": true,
100-
"label": "x-component",
101+
"label": "In-line",
101102
"parent": "data_object",
103+
"tooltip": "In-line (u) component of the magnetic data.\nPositive towards North if no receiver orientation provided",
102104
"optional": true,
103105
"enabled": false,
104106
"value": ""
105107
},
106-
"x_uncertainty": {
108+
"inline_uncertainty": {
107109
"association": [
108110
"Cell",
109111
"Vertex"
@@ -114,11 +116,11 @@
114116
"main": true,
115117
"label": "Uncertainty",
116118
"parent": "data_object",
117-
"dependency": "x_channel",
119+
"dependency": "inline_channel",
118120
"dependencyType": "enabled",
119121
"value": ""
120122
},
121-
"y_channel": {
123+
"crossline_channel": {
122124
"association": [
123125
"Cell",
124126
"Vertex"
@@ -127,13 +129,14 @@
127129
"group": "Data",
128130
"dataGroupType": "Multi-element",
129131
"main": true,
130-
"label": "y-component",
132+
"label": "Cross-line",
133+
"tooltip": "Cross-line (v) component of the magnetic data.\nPositive towards East if no receiver orientation provided",
131134
"parent": "data_object",
132135
"optional": true,
133136
"enabled": false,
134137
"value": ""
135138
},
136-
"y_uncertainty": {
139+
"crossline_uncertainty": {
137140
"association": [
138141
"Cell",
139142
"Vertex"
@@ -144,7 +147,7 @@
144147
"main": true,
145148
"label": "Uncertainty",
146149
"parent": "data_object",
147-
"dependency": "y_channel",
150+
"dependency": "crossline_channel",
148151
"dependencyType": "enabled",
149152
"value": ""
150153
},

simpeg_drivers/components/data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,7 @@ def get_normalizations(self):
309309
"tdem" in self.params.inversion_type
310310
and "dB/dt" in self.params.data_units
311311
):
312-
if comp in ["x", "y", "z"]:
313-
normalizations[chan][comp] = -1
314-
normalizations[chan][comp] *= np.ones(self.mask.sum())
312+
normalizations[chan][comp] = np.full(self.mask.sum(), -1)
315313

316314
return normalizations
317315

simpeg_drivers/components/factories/receiver_factory.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
from simpeg_drivers.utils.regularization import direction_and_dip, get_cell_normals
3131

3232

33+
ORIENTATION_MAP = {
34+
"vertical": "z",
35+
"inline": "y",
36+
"crossline": "x",
37+
}
38+
39+
3340
class ReceiversFactory(SimPEGFactory):
3441
"""Build SimPEG receivers objects based on factory type."""
3542

@@ -150,14 +157,16 @@ def assemble_keyword_arguments(
150157

151158
if self.factory_type in ["fdem", "fdem 1d", "magnetotellurics", "tipper"]:
152159
comp = component.split("_")[0]
153-
kwargs["orientation"] = comp[0] if "fdem" in self.factory_type else comp[1:]
160+
kwargs["orientation"] = (
161+
ORIENTATION_MAP[comp] if "fdem" in self.factory_type else comp[1:]
162+
)
154163
kwargs["component"] = component.split("_")[1]
155164

156165
if self.factory_type in ["tipper"]:
157166
kwargs["orientation"] = kwargs["orientation"][::-1]
158167

159168
if "tdem" in self.factory_type:
160-
kwargs["orientation"] = component
169+
kwargs["orientation"] = ORIENTATION_MAP[component]
161170

162171
if self.factory_type == "fdem 1d":
163172
kwargs["data_type"] = "ppm"

simpeg_drivers/electromagnetics/frequency_domain/options.py

Lines changed: 105 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
LargeLoopGroundFEMReceivers,
2323
MovingLoopGroundFEMReceivers,
2424
)
25-
from pydantic import field_validator
25+
from pydantic import AliasChoices, Field, field_validator
2626

2727
from simpeg_drivers import assets_path
2828
from simpeg_drivers.options import (
@@ -86,12 +86,12 @@ class FDEMForwardOptions(BaseForwardOptions, BaseFDEMOptions):
8686
Frequency Domain Electromagnetic Forward options.
8787
8888
:param receivers_orientation: Orientation of the receivers provided as a group.
89-
:param z_real_channel_bool: Vertical (real) component of impedance channel boolean.
90-
:param z_imag_channel_bool: Vertical (imaginary) component of impedance channel boolean.
91-
:param y_real_channel_bool: In-line (real) component of impedance channel boolean.
92-
:param y_imag_channel_bool: In-line (imaginary) component of impedance channel boolean.
93-
:param x_real_channel_bool: Cross-line (real) component of impedance channel boolean.
94-
:param x_imag_channel_bool: Cross-line (imaginary) component of impedance channel
89+
:param vertical_real_channel_bool: Vertical (real) component of impedance channel boolean.
90+
:param vertical_imag_channel_bool: Vertical (imaginary) component of impedance channel boolean.
91+
:param inline_real_channel_bool: In-line (real) component of impedance channel boolean.
92+
:param inline_imag_channel_bool: In-line (imaginary) component of impedance channel boolean.
93+
:param crossline_real_channel_bool: Cross-line (real) component of impedance channel boolean.
94+
:param crossline_imag_channel_bool: Cross-line (imaginary) component of impedance channel
9595
:param models: ConductivityModelOptions parameter.
9696
"""
9797

@@ -108,31 +108,61 @@ class FDEMForwardOptions(BaseForwardOptions, BaseFDEMOptions):
108108
| AirborneFEMReceivers
109109
)
110110
receivers_orientation: PropertyGroup | None = None
111-
z_real_channel_bool: bool = False
112-
z_imag_channel_bool: bool = False
113-
y_real_channel_bool: bool = False
114-
y_imag_channel_bool: bool = False
115-
x_real_channel_bool: bool = False
116-
x_imag_channel_bool: bool = False
111+
vertical_real_channel_bool: bool = Field(
112+
False,
113+
validation_alias=AliasChoices(
114+
"z_real_channel_bool", "vertical_real_channel_bool"
115+
),
116+
)
117+
vertical_imag_channel_bool: bool = Field(
118+
False,
119+
validation_alias=AliasChoices(
120+
"z_imag_channel_bool", "vertical_imag_channel_bool"
121+
),
122+
)
123+
inline_real_channel_bool: bool = Field(
124+
False,
125+
validation_alias=AliasChoices(
126+
"y_real_channel_bool", "inline_real_channel_bool"
127+
),
128+
)
129+
inline_imag_channel_bool: bool = Field(
130+
False,
131+
validation_alias=AliasChoices(
132+
"y_imag_channel_bool", "inline_imag_channel_bool"
133+
),
134+
)
135+
crossline_real_channel_bool: bool = Field(
136+
False,
137+
validation_alias=AliasChoices(
138+
"x_real_channel_bool", "crossline_real_channel_bool"
139+
),
140+
)
141+
crossline_imag_channel_bool: bool = Field(
142+
False,
143+
validation_alias=AliasChoices(
144+
"x_imag_channel_bool", "crossline_imag_channel_bool"
145+
),
146+
)
117147
models: ConductivityModelOptions
118148

119149

120150
class FDEMInversionOptions(BaseFDEMOptions, BaseInversionOptions):
121151
"""
122152
Frequency Domain Electromagnetic Inversion options.
123153
124-
:param z_real_channel: Vertical (real) impedance channel.
125-
:param z_real_uncertainty: Vertical (real) impedance uncertainty channel.
126-
:param z_imag_channel: Vertical (imaginary) impedance channel.
127-
:param z_imag_uncertainty: Vertical (imaginary) impedance uncertainty channel.
128-
:param y_real_channel: In-line (real) impedance channel.
129-
:param y_real_uncertainty: In-line (real) impedance uncertainty channel.
130-
:param y_imag_channel: In-line (imaginary) impedance channel.
131-
:param y_imag_uncertainty: In-line (imaginary) impedance uncertainty channel
132-
:param x_real_channel: Cross-line (real) impedance channel.
133-
:param x_real_uncertainty: Cross-line (real) impedance uncertainty channel.
134-
:param x_imag_channel: Cross-line (imaginary) impedance channel.
135-
:param x_imag_uncertainty: Cross-line (imaginary) impedance uncertainty channel
154+
:param vertical_real_channel: Vertical (real) impedance channel.
155+
:param vertical_real_uncertainty: Vertical (real) impedance uncertainty channel.
156+
:param vertical_imag_channel: Vertical (imaginary) impedance channel.
157+
:param vertical_imag_uncertainty: Vertical (imaginary) impedance uncertainty channel.
158+
:param inline_real_channel: In-line (real) impedance channel.
159+
:param inline_real_uncertainty: In-line (real) impedance uncertainty channel.
160+
:param inline_imag_channel: In-line (imaginary) impedance channel.
161+
:param inline_imag_uncertainty: In-line (imaginary) impedance uncertainty channel
162+
:param crossline_real_channel: Cross-line (real) impedance channel.
163+
:param crossline_real_uncertainty: Cross-line (real) impedance uncertainty channel.
164+
:param crossline_imag_channel: Cross-line (imaginary) impedance channel.
165+
:param crossline_imag_uncertainty: Cross-line (imaginary) impedance uncertainty channel
136166
:param models: ConductivityModelOptions parameter.
137167
"""
138168

@@ -149,18 +179,56 @@ class FDEMInversionOptions(BaseFDEMOptions, BaseInversionOptions):
149179
| AirborneFEMReceivers
150180
)
151181
receivers_orientation: PropertyGroup | None = None
152-
z_real_channel: PropertyGroup | None = None
153-
z_real_uncertainty: PropertyGroup | None = None
154-
z_imag_channel: PropertyGroup | None = None
155-
z_imag_uncertainty: PropertyGroup | None = None
156-
y_real_channel: PropertyGroup | None = None
157-
y_real_uncertainty: PropertyGroup | None = None
158-
y_imag_channel: PropertyGroup | None = None
159-
y_imag_uncertainty: PropertyGroup | None = None
160-
x_real_channel: PropertyGroup | None = None
161-
x_real_uncertainty: PropertyGroup | None = None
162-
x_imag_channel: PropertyGroup | None = None
163-
x_imag_uncertainty: PropertyGroup | None = None
182+
vertical_real_channel: PropertyGroup | None = Field(
183+
None, validation_alias=AliasChoices("z_real_channel", "vertical_real_channel")
184+
)
185+
vertical_real_uncertainty: PropertyGroup | None = Field(
186+
None,
187+
validation_alias=AliasChoices(
188+
"z_real_uncertainty", "vertical_real_uncertainty"
189+
),
190+
)
191+
vertical_imag_channel: PropertyGroup | None = Field(
192+
None, validation_alias=AliasChoices("z_imag_channel", "vertical_imag_channel")
193+
)
194+
vertical_imag_uncertainty: PropertyGroup | None = Field(
195+
None,
196+
validation_alias=AliasChoices(
197+
"z_imag_uncertainty", "vertical_imag_uncertainty"
198+
),
199+
)
200+
inline_real_channel: PropertyGroup | None = Field(
201+
None, validation_alias=AliasChoices("y_real_channel", "inline_real_channel")
202+
)
203+
inline_real_uncertainty: PropertyGroup | None = Field(
204+
None,
205+
validation_alias=AliasChoices("y_real_uncertainty", "inline_real_uncertainty"),
206+
)
207+
inline_imag_channel: PropertyGroup | None = Field(
208+
None, validation_alias=AliasChoices("y_imag_channel", "inline_imag_channel")
209+
)
210+
inline_imag_uncertainty: PropertyGroup | None = Field(
211+
None,
212+
validation_alias=AliasChoices("y_imag_uncertainty", "inline_imag_uncertainty"),
213+
)
214+
crossline_real_channel: PropertyGroup | None = Field(
215+
None, validation_alias=AliasChoices("x_real_channel", "crossline_real_channel")
216+
)
217+
crossline_real_uncertainty: PropertyGroup | None = Field(
218+
None,
219+
validation_alias=AliasChoices(
220+
"x_real_uncertainty", "crossline_real_uncertainty"
221+
),
222+
)
223+
crossline_imag_channel: PropertyGroup | None = Field(
224+
None, validation_alias=AliasChoices("x_imag_channel", "crossline_imag_channel")
225+
)
226+
crossline_imag_uncertainty: PropertyGroup | None = Field(
227+
None,
228+
validation_alias=AliasChoices(
229+
"x_imag_uncertainty", "crossline_imag_uncertainty"
230+
),
231+
)
164232

165233
models: ConductivityModelOptions
166234

0 commit comments

Comments
 (0)