diff --git a/simpeg_drivers-assets/uijson/tdem1d_forward.ui.json b/simpeg_drivers-assets/uijson/tdem1d_forward.ui.json index ec596baf..a030eec2 100644 --- a/simpeg_drivers-assets/uijson/tdem1d_forward.ui.json +++ b/simpeg_drivers-assets/uijson/tdem1d_forward.ui.json @@ -39,7 +39,8 @@ "z_channel_bool": { "group": "Survey", "main": true, - "label": "Z component", + "label": "Vertical", + "tooltip": "Vertical (w) component of the magnetic data", "value": true }, "u_cell_size": { diff --git a/simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json b/simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json index 72c09b74..2bffd167 100644 --- a/simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json +++ b/simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json @@ -45,7 +45,8 @@ "group": "Data", "dataGroupType": "Multi-element", "main": true, - "label": "z-component", + "label": "Vertical", + "tooltip": "Vertical (w) component of the magnetic data", "parent": "data_object", "optional": true, "enabled": true, diff --git a/simpeg_drivers-assets/uijson/tdem_forward.ui.json b/simpeg_drivers-assets/uijson/tdem_forward.ui.json index 287391f8..5b85136e 100644 --- a/simpeg_drivers-assets/uijson/tdem_forward.ui.json +++ b/simpeg_drivers-assets/uijson/tdem_forward.ui.json @@ -58,22 +58,25 @@ ], "value": "dB/dt (T/s)" }, - "z_channel_bool": { + "vertical_channel_bool": { "group": "Survey", "main": true, - "label": "Z component", + "label": "Vertical", + "tooltip": "Vertical (w) component of the magnetic data.\nPositive up along the z-axis if no receiver orientation provided", "value": true }, - "x_channel_bool": { + "inline_channel_bool": { "group": "Survey", "main": true, - "label": "X component", + "label": "In-line", + "tooltip": "In-line (u) component of the magnetic data.\nPositive towards North if no receiver orientation provided", "value": true }, - "y_channel_bool": { + "crossline_channel_bool": { "group": "Survey", "main": true, - "label": "Y component", + "label": "Cross-line", + "tooltip": "Cross-line (v) component of the magnetic data.\nPositive towards East if no receiver orientation provided", "value": true }, "mesh": { diff --git a/simpeg_drivers-assets/uijson/tdem_inversion.ui.json b/simpeg_drivers-assets/uijson/tdem_inversion.ui.json index 18e93a52..4cf11ccc 100644 --- a/simpeg_drivers-assets/uijson/tdem_inversion.ui.json +++ b/simpeg_drivers-assets/uijson/tdem_inversion.ui.json @@ -58,7 +58,7 @@ ], "value": "dB/dt (T/s)" }, - "z_channel": { + "vertical_channel": { "association": [ "Cell", "Vertex" @@ -67,13 +67,14 @@ "group": "Data", "dataGroupType": "Multi-element", "main": true, - "label": "z-component", + "label": "Vertical", "parent": "data_object", + "tooltip": "Vertical (w) component of the magnetic data.\nPositive up along the z-axis if no receiver orientation provided", "optional": true, "enabled": true, "value": "" }, - "z_uncertainty": { + "vertical_uncertainty": { "association": [ "Cell", "Vertex" @@ -84,11 +85,11 @@ "main": true, "label": "Uncertainty", "parent": "data_object", - "dependency": "z_channel", + "dependency": "vertical_channel", "dependencyType": "enabled", "value": "" }, - "x_channel": { + "inline_channel": { "association": [ "Cell", "Vertex" @@ -97,13 +98,14 @@ "group": "Data", "dataGroupType": "Multi-element", "main": true, - "label": "x-component", + "label": "In-line", "parent": "data_object", + "tooltip": "In-line (u) component of the magnetic data.\nPositive towards North if no receiver orientation provided", "optional": true, "enabled": false, "value": "" }, - "x_uncertainty": { + "inline_uncertainty": { "association": [ "Cell", "Vertex" @@ -114,11 +116,11 @@ "main": true, "label": "Uncertainty", "parent": "data_object", - "dependency": "x_channel", + "dependency": "inline_channel", "dependencyType": "enabled", "value": "" }, - "y_channel": { + "crossline_channel": { "association": [ "Cell", "Vertex" @@ -127,13 +129,14 @@ "group": "Data", "dataGroupType": "Multi-element", "main": true, - "label": "y-component", + "label": "Cross-line", + "tooltip": "Cross-line (v) component of the magnetic data.\nPositive towards East if no receiver orientation provided", "parent": "data_object", "optional": true, "enabled": false, "value": "" }, - "y_uncertainty": { + "crossline_uncertainty": { "association": [ "Cell", "Vertex" @@ -144,7 +147,7 @@ "main": true, "label": "Uncertainty", "parent": "data_object", - "dependency": "y_channel", + "dependency": "crossline_channel", "dependencyType": "enabled", "value": "" }, diff --git a/simpeg_drivers/components/data.py b/simpeg_drivers/components/data.py index f18785a2..9b26c014 100644 --- a/simpeg_drivers/components/data.py +++ b/simpeg_drivers/components/data.py @@ -309,9 +309,7 @@ def get_normalizations(self): "tdem" in self.params.inversion_type and "dB/dt" in self.params.data_units ): - if comp in ["x", "y", "z"]: - normalizations[chan][comp] = -1 - normalizations[chan][comp] *= np.ones(self.mask.sum()) + normalizations[chan][comp] = np.full(self.mask.sum(), -1) return normalizations diff --git a/simpeg_drivers/components/factories/receiver_factory.py b/simpeg_drivers/components/factories/receiver_factory.py index 3ad7f208..6b8409d8 100644 --- a/simpeg_drivers/components/factories/receiver_factory.py +++ b/simpeg_drivers/components/factories/receiver_factory.py @@ -30,6 +30,13 @@ from simpeg_drivers.utils.regularization import direction_and_dip, get_cell_normals +ORIENTATION_MAP = { + "vertical": "z", + "inline": "y", + "crossline": "x", +} + + class ReceiversFactory(SimPEGFactory): """Build SimPEG receivers objects based on factory type.""" @@ -150,14 +157,16 @@ def assemble_keyword_arguments( if self.factory_type in ["fdem", "fdem 1d", "magnetotellurics", "tipper"]: comp = component.split("_")[0] - kwargs["orientation"] = comp[0] if "fdem" in self.factory_type else comp[1:] + kwargs["orientation"] = ( + ORIENTATION_MAP[comp] if "fdem" in self.factory_type else comp[1:] + ) kwargs["component"] = component.split("_")[1] if self.factory_type in ["tipper"]: kwargs["orientation"] = kwargs["orientation"][::-1] if "tdem" in self.factory_type: - kwargs["orientation"] = component + kwargs["orientation"] = ORIENTATION_MAP[component] if self.factory_type == "fdem 1d": kwargs["data_type"] = "ppm" diff --git a/simpeg_drivers/electromagnetics/frequency_domain/options.py b/simpeg_drivers/electromagnetics/frequency_domain/options.py index f420d8aa..b8cdaa15 100644 --- a/simpeg_drivers/electromagnetics/frequency_domain/options.py +++ b/simpeg_drivers/electromagnetics/frequency_domain/options.py @@ -22,7 +22,7 @@ LargeLoopGroundFEMReceivers, MovingLoopGroundFEMReceivers, ) -from pydantic import field_validator +from pydantic import AliasChoices, Field, field_validator from simpeg_drivers import assets_path from simpeg_drivers.options import ( @@ -86,12 +86,12 @@ class FDEMForwardOptions(BaseForwardOptions, BaseFDEMOptions): Frequency Domain Electromagnetic Forward options. :param receivers_orientation: Orientation of the receivers provided as a group. - :param z_real_channel_bool: Vertical (real) component of impedance channel boolean. - :param z_imag_channel_bool: Vertical (imaginary) component of impedance channel boolean. - :param y_real_channel_bool: In-line (real) component of impedance channel boolean. - :param y_imag_channel_bool: In-line (imaginary) component of impedance channel boolean. - :param x_real_channel_bool: Cross-line (real) component of impedance channel boolean. - :param x_imag_channel_bool: Cross-line (imaginary) component of impedance channel + :param vertical_real_channel_bool: Vertical (real) component of impedance channel boolean. + :param vertical_imag_channel_bool: Vertical (imaginary) component of impedance channel boolean. + :param inline_real_channel_bool: In-line (real) component of impedance channel boolean. + :param inline_imag_channel_bool: In-line (imaginary) component of impedance channel boolean. + :param crossline_real_channel_bool: Cross-line (real) component of impedance channel boolean. + :param crossline_imag_channel_bool: Cross-line (imaginary) component of impedance channel :param models: ConductivityModelOptions parameter. """ @@ -108,12 +108,42 @@ class FDEMForwardOptions(BaseForwardOptions, BaseFDEMOptions): | AirborneFEMReceivers ) receivers_orientation: PropertyGroup | None = None - z_real_channel_bool: bool = False - z_imag_channel_bool: bool = False - y_real_channel_bool: bool = False - y_imag_channel_bool: bool = False - x_real_channel_bool: bool = False - x_imag_channel_bool: bool = False + vertical_real_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "z_real_channel_bool", "vertical_real_channel_bool" + ), + ) + vertical_imag_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "z_imag_channel_bool", "vertical_imag_channel_bool" + ), + ) + inline_real_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "y_real_channel_bool", "inline_real_channel_bool" + ), + ) + inline_imag_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "y_imag_channel_bool", "inline_imag_channel_bool" + ), + ) + crossline_real_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "x_real_channel_bool", "crossline_real_channel_bool" + ), + ) + crossline_imag_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "x_imag_channel_bool", "crossline_imag_channel_bool" + ), + ) models: ConductivityModelOptions @@ -121,18 +151,18 @@ class FDEMInversionOptions(BaseFDEMOptions, BaseInversionOptions): """ Frequency Domain Electromagnetic Inversion options. - :param z_real_channel: Vertical (real) impedance channel. - :param z_real_uncertainty: Vertical (real) impedance uncertainty channel. - :param z_imag_channel: Vertical (imaginary) impedance channel. - :param z_imag_uncertainty: Vertical (imaginary) impedance uncertainty channel. - :param y_real_channel: In-line (real) impedance channel. - :param y_real_uncertainty: In-line (real) impedance uncertainty channel. - :param y_imag_channel: In-line (imaginary) impedance channel. - :param y_imag_uncertainty: In-line (imaginary) impedance uncertainty channel - :param x_real_channel: Cross-line (real) impedance channel. - :param x_real_uncertainty: Cross-line (real) impedance uncertainty channel. - :param x_imag_channel: Cross-line (imaginary) impedance channel. - :param x_imag_uncertainty: Cross-line (imaginary) impedance uncertainty channel + :param vertical_real_channel: Vertical (real) impedance channel. + :param vertical_real_uncertainty: Vertical (real) impedance uncertainty channel. + :param vertical_imag_channel: Vertical (imaginary) impedance channel. + :param vertical_imag_uncertainty: Vertical (imaginary) impedance uncertainty channel. + :param inline_real_channel: In-line (real) impedance channel. + :param inline_real_uncertainty: In-line (real) impedance uncertainty channel. + :param inline_imag_channel: In-line (imaginary) impedance channel. + :param inline_imag_uncertainty: In-line (imaginary) impedance uncertainty channel + :param crossline_real_channel: Cross-line (real) impedance channel. + :param crossline_real_uncertainty: Cross-line (real) impedance uncertainty channel. + :param crossline_imag_channel: Cross-line (imaginary) impedance channel. + :param crossline_imag_uncertainty: Cross-line (imaginary) impedance uncertainty channel :param models: ConductivityModelOptions parameter. """ @@ -149,18 +179,56 @@ class FDEMInversionOptions(BaseFDEMOptions, BaseInversionOptions): | AirborneFEMReceivers ) receivers_orientation: PropertyGroup | None = None - z_real_channel: PropertyGroup | None = None - z_real_uncertainty: PropertyGroup | None = None - z_imag_channel: PropertyGroup | None = None - z_imag_uncertainty: PropertyGroup | None = None - y_real_channel: PropertyGroup | None = None - y_real_uncertainty: PropertyGroup | None = None - y_imag_channel: PropertyGroup | None = None - y_imag_uncertainty: PropertyGroup | None = None - x_real_channel: PropertyGroup | None = None - x_real_uncertainty: PropertyGroup | None = None - x_imag_channel: PropertyGroup | None = None - x_imag_uncertainty: PropertyGroup | None = None + vertical_real_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_real_channel", "vertical_real_channel") + ) + vertical_real_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices( + "z_real_uncertainty", "vertical_real_uncertainty" + ), + ) + vertical_imag_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_imag_channel", "vertical_imag_channel") + ) + vertical_imag_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices( + "z_imag_uncertainty", "vertical_imag_uncertainty" + ), + ) + inline_real_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("y_real_channel", "inline_real_channel") + ) + inline_real_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices("y_real_uncertainty", "inline_real_uncertainty"), + ) + inline_imag_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("y_imag_channel", "inline_imag_channel") + ) + inline_imag_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices("y_imag_uncertainty", "inline_imag_uncertainty"), + ) + crossline_real_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("x_real_channel", "crossline_real_channel") + ) + crossline_real_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices( + "x_real_uncertainty", "crossline_real_uncertainty" + ), + ) + crossline_imag_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("x_imag_channel", "crossline_imag_channel") + ) + crossline_imag_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices( + "x_imag_uncertainty", "crossline_imag_uncertainty" + ), + ) models: ConductivityModelOptions diff --git a/simpeg_drivers/electromagnetics/frequency_domain_1d/options.py b/simpeg_drivers/electromagnetics/frequency_domain_1d/options.py index e9544370..c8ecc957 100644 --- a/simpeg_drivers/electromagnetics/frequency_domain_1d/options.py +++ b/simpeg_drivers/electromagnetics/frequency_domain_1d/options.py @@ -16,6 +16,7 @@ from geoh5py.groups import PropertyGroup from geoh5py.objects import AirborneFEMReceivers +from pydantic import AliasChoices, Field from simpeg_drivers import assets_path from simpeg_drivers.electromagnetics.base_1d_options import Base1DOptions @@ -32,8 +33,8 @@ class FDEM1DForwardOptions(BaseForwardOptions, BaseFDEMOptions, Base1DOptions): """ Frequency Domain Electromagnetic forward options. - :param z_real_channel_bool: Z-component data channel boolean. - :param z_imag_channel_bool: Imaginary Z-component data channel boolean. + :param vertical_real_channel_bool: Z-component data channel boolean. + :param vertical_imag_channel_bool: Imaginary Z-component data channel boolean. :param drape_model: Drape model options. """ @@ -44,8 +45,18 @@ class FDEM1DForwardOptions(BaseForwardOptions, BaseFDEMOptions, Base1DOptions): physical_property: str = "conductivity" inversion_type: str = "fdem 1d" data_object: AirborneFEMReceivers - z_real_channel_bool: bool - z_imag_channel_bool: bool + vertical_real_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "z_real_channel_bool", "vertical_real_channel_bool" + ), + ) + vertical_imag_channel_bool: bool = Field( + False, + validation_alias=AliasChoices( + "z_imag_channel_bool", "vertical_imag_channel_bool" + ), + ) models: ConductivityModelOptions @@ -53,10 +64,10 @@ class FDEM1DInversionOptions(BaseFDEMOptions, BaseInversionOptions, Base1DOption """ Frequency Domain Electromagnetic Inversion options. - :param z_real_channel: Real Z-component data channel. - :param z_real_uncertainty: Real Z-component data channel uncertainty. - :param z_imag_channel: Imaginary Z-component data channel. - :param z_imag_uncertainty: Imaginary Z-component data channel uncertainty. + :param vertical_real_channel: Real Z-component data channel. + :param vertical_real_uncertainty: Real Z-component data channel uncertainty. + :param vertical_imag_channel: Imaginary Z-component data channel. + :param vertical_imag_uncertainty: Imaginary Z-component data channel uncertainty. :param drape_model: Drape model options. """ @@ -71,8 +82,22 @@ class FDEM1DInversionOptions(BaseFDEMOptions, BaseInversionOptions, Base1DOption directives: DirectiveOptions = DirectiveOptions( sens_wts_threshold=100.0, ) - z_real_channel: PropertyGroup | None = None - z_real_uncertainty: PropertyGroup | None = None - z_imag_channel: PropertyGroup | None = None - z_imag_uncertainty: PropertyGroup | None = None + vertical_real_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_real_channel", "vertical_real_channel") + ) + vertical_real_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices( + "z_real_uncertainty", "vertical_real_uncertainty" + ), + ) + vertical_imag_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_imag_channel", "vertical_imag_channel") + ) + vertical_imag_uncertainty: PropertyGroup | None = Field( + None, + validation_alias=AliasChoices( + "z_imag_uncertainty", "vertical_imag_uncertainty" + ), + ) models: ConductivityModelOptions diff --git a/simpeg_drivers/electromagnetics/time_domain/options.py b/simpeg_drivers/electromagnetics/time_domain/options.py index 62295127..17776658 100644 --- a/simpeg_drivers/electromagnetics/time_domain/options.py +++ b/simpeg_drivers/electromagnetics/time_domain/options.py @@ -21,6 +21,7 @@ LargeLoopGroundTEMReceivers, MovingLoopGroundTEMReceivers, ) +from pydantic import AliasChoices, Field from simpeg_drivers import assets_path from simpeg_drivers.options import ( @@ -76,9 +77,9 @@ class TDEMForwardOptions(BaseTDEMOptions, BaseForwardOptions): """ Time Domain Electromagnetic forward options. - :param z_channel_bool: Vertical data channel boolean. - :param y_channel_bool: In-line data channel boolean. - :param x_channel_bool: Cross-line data channel boolean. + :param vertical_channel_bool: Vertical data channel boolean. + :param inline_channel_bool: In-line data channel boolean. + :param crossline_channel_bool: Cross-line data channel boolean. """ name: ClassVar[str] = "Time Domain Electromagnetics Forward" @@ -95,9 +96,15 @@ class TDEMForwardOptions(BaseTDEMOptions, BaseForwardOptions): | AirborneTEMReceivers ) receivers_orientation: PropertyGroup | None = None - z_channel_bool: bool | None = None - x_channel_bool: bool | None = None - y_channel_bool: bool | None = None + vertical_channel_bool: bool = Field( + False, validation_alias=AliasChoices("z_channel_bool", "vertical_channel_bool") + ) + inline_channel_bool: bool = Field( + False, validation_alias=AliasChoices("y_channel_bool", "inline_channel_bool") + ) + crossline_channel_bool: bool = Field( + False, validation_alias=AliasChoices("x_channel_bool", "crossline_channel_bool") + ) models: ConductivityModelOptions @@ -105,12 +112,12 @@ class TDEMInversionOptions(BaseTDEMOptions, BaseInversionOptions): """ Time Domain Electromagnetic Inversion options. - :param z_channel: Z-component data channel. - :param z_uncertainty: Z-component data channel uncertainty. - :param y_channel: In-line data channel. - :param y_uncertainty: In-line data channel uncertainty. - :param x_channel: Cross-line data channel. - :param x_uncertainty: Cross-line data channel uncertainty. + :param vertical_channel: Vertical component data channel. + :param vertical_uncertainty: Vertical component data channel uncertainty. + :param inline_channel: In-line data channel. + :param inline_uncertainty: In-line data channel uncertainty. + :param crossline_channel: Cross-line data channel. + :param crossline_uncertainty: Cross-line data channel uncertainty. """ name: ClassVar[str] = "Time Domain Electromagnetics Inversion" @@ -126,11 +133,23 @@ class TDEMInversionOptions(BaseTDEMOptions, BaseInversionOptions): | AirborneTEMReceivers ) receivers_orientation: PropertyGroup | None = None - z_channel: PropertyGroup | None = None - z_uncertainty: PropertyGroup | None = None - y_channel: PropertyGroup | None = None - y_uncertainty: PropertyGroup | None = None - x_channel: PropertyGroup | None = None - x_uncertainty: PropertyGroup | None = None + vertical_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_channel", "vertical_channel") + ) + vertical_uncertainty: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_uncertainty", "vertical_uncertainty") + ) + inline_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("y_channel", "inline_channel") + ) + inline_uncertainty: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("y_uncertainty", "inline_uncertainty") + ) + crossline_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("x_channel", "crossline_channel") + ) + crossline_uncertainty: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("x_uncertainty", "crossline_uncertainty") + ) models: ConductivityModelOptions diff --git a/simpeg_drivers/electromagnetics/time_domain_1d/options.py b/simpeg_drivers/electromagnetics/time_domain_1d/options.py index 9d8348ef..f934ab83 100644 --- a/simpeg_drivers/electromagnetics/time_domain_1d/options.py +++ b/simpeg_drivers/electromagnetics/time_domain_1d/options.py @@ -15,6 +15,7 @@ from typing import ClassVar from geoh5py.groups import PropertyGroup +from pydantic import AliasChoices, Field from simpeg_drivers import assets_path from simpeg_drivers.electromagnetics.base_1d_options import Base1DOptions @@ -31,7 +32,7 @@ class TDEM1DForwardOptions(TDEMForwardOptions, Base1DOptions): """ Time Domain Electromagnetic forward options. - :param z_channel_bool: Z-component data channel boolean. + :param vertical_channel_bool: Z-component data channel boolean. :param drape_model: Options for drape mesh. """ @@ -41,15 +42,17 @@ class TDEM1DForwardOptions(TDEMForwardOptions, Base1DOptions): title: str = "Time-domain EM-1D (TEM-1D) Forward" inversion_type: str = "tdem 1d" - z_channel_bool: bool = True + vertical_channel_bool: bool = Field( + True, validation_alias=AliasChoices("z_channel_bool", "vertical_channel_bool") + ) class TDEM1DInversionOptions(TDEMInversionOptions, Base1DOptions): """ Time Domain Electromagnetic Inversion options. - :param z_channel: Z-component data channel. - :param z_uncertainty: Z-component data channel uncertainty. + :param vertical_channel: Z-component data channel. + :param vertical_uncertainty: Z-component data channel uncertainty. :param drape_model: Options for drape mesh. """ @@ -59,8 +62,12 @@ class TDEM1DInversionOptions(TDEMInversionOptions, Base1DOptions): title: str = "Time-domain EM-1D (TEM-1D) Inversion" inversion_type: str = "tdem 1d" - z_channel: PropertyGroup | None = None - z_uncertainty: PropertyGroup | None = None + vertical_channel: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_channel", "vertical_channel") + ) + vertical_uncertainty: PropertyGroup | None = Field( + None, validation_alias=AliasChoices("z_uncertainty", "vertical_uncertainty") + ) directives: DirectiveOptions = DirectiveOptions( sens_wts_threshold=100.0, diff --git a/simpeg_drivers/plate_simulation/match/driver.py b/simpeg_drivers/plate_simulation/match/driver.py index 03b27248..07e678f7 100644 --- a/simpeg_drivers/plate_simulation/match/driver.py +++ b/simpeg_drivers/plate_simulation/match/driver.py @@ -485,7 +485,13 @@ def batch_files_score( logger.warning("No survey found in %s, skipping.", sim_file) continue - simulated = get_data_array(survey.get_entity("Iteration_0_z")[0]) + data_entity = survey.get_entity("Iteration_0_vertical")[0] + + if data_entity is None: + data_entity = survey.get_entity("Iteration_0_z")[0] + + simulated = get_data_array(data_entity) + pred = time_projection @ (spatial_projection @ simulated.T).T scale = max_late_val / np.max(np.abs(pred[-1, :])) pred = normalized_data(pred, scale=scale, threshold=max_late_val) diff --git a/tests/plate_simulation/runtest/match_test.py b/tests/plate_simulation/runtest/match_test.py index d122ebce..d91dab69 100644 --- a/tests/plate_simulation/runtest/match_test.py +++ b/tests/plate_simulation/runtest/match_test.py @@ -159,7 +159,7 @@ def test_matching_driver(tmp_path: Path): # Modify the data slightly with Workspace(new_file) as sim_geoh5: survey = fetch_survey(sim_geoh5) - prop_group = survey.get_entity("Iteration_0_z")[0] + prop_group = survey.get_entity("Iteration_0_vertical")[0] # Alter the signal to simulate different plate models scale = signal.windows.gaussian(survey.n_vertices, 2**ii) @@ -183,7 +183,7 @@ def test_matching_driver(tmp_path: Path): survey.vertices = rotate_xyz(survey.vertices, [0, 0, 0], 215.0) # Flip the data to simulate up-dip measurements - prop_group = survey.get_entity("Iteration_0_z")[0] + prop_group = survey.get_entity("Iteration_0_vertical")[0] for uid in prop_group.properties: child = survey.get_entity(uid)[0] child.values = child.values[::-1] diff --git a/tests/run_tests/driver_airborne_fem_1d_test.py b/tests/run_tests/driver_airborne_fem_1d_test.py index e3515b54..2a9559df 100644 --- a/tests/run_tests/driver_airborne_fem_1d_test.py +++ b/tests/run_tests/driver_airborne_fem_1d_test.py @@ -84,8 +84,8 @@ def test_fem_1d_run(tmp_path: Path, max_iterations=1, pytest=True): data = {} uncertainties = {} channels = { - "z_real": "z_real", - "z_imag": "z_imag", + "vertical_real": "vertical_real", + "vertical_imag": "vertical_imag", } for chan, cname in channels.items(): @@ -120,7 +120,7 @@ def test_fem_1d_run(tmp_path: Path, max_iterations=1, pytest=True): data_kwargs[f"{chan}_channel"] = data_group data_kwargs[f"{chan}_uncertainty"] = uncert_group - orig_z_real_1 = geoh5.get_entity("Iteration_0_z_real_[0]")[0].values + orig_z_real_1 = geoh5.get_entity("Iteration_0_vertical_real_[0]")[0].values # Run the inverse params = FDEM1DInversionOptions.build( @@ -153,8 +153,8 @@ def test_fem_1d_run(tmp_path: Path, max_iterations=1, pytest=True): output["data"] = orig_z_real_1 assert ( - run_ws.get_entity("Iteration_1_z_imag_[1]")[0].entity_type.uid - == run_ws.get_entity("Observed_z_imag_[1]")[0].entity_type.uid + run_ws.get_entity("Iteration_1_vertical_imag_[1]")[0].entity_type.uid + == run_ws.get_entity("Observed_vertical_imag_[1]")[0].entity_type.uid ) if pytest: diff --git a/tests/run_tests/driver_airborne_fem_test.py b/tests/run_tests/driver_airborne_fem_test.py index 174a1357..63c3efd1 100644 --- a/tests/run_tests/driver_airborne_fem_test.py +++ b/tests/run_tests/driver_airborne_fem_test.py @@ -121,8 +121,8 @@ def test_fem_run(tmp_path: Path, max_iterations=1, pytest=True): data = {} uncertainties = {} channels = { - "z_real": "z_real", - "z_imag": "z_imag", + "vertical_real": "vertical_real", + "vertical_imag": "vertical_imag", } for chan, cname in channels.items(): @@ -157,7 +157,7 @@ def test_fem_run(tmp_path: Path, max_iterations=1, pytest=True): data_kwargs[f"{chan}_channel"] = data_group data_kwargs[f"{chan}_uncertainty"] = uncert_group - orig_z_real_1 = geoh5.get_entity("Iteration_0_z_real_[0]")[0].values + orig_z_real_1 = geoh5.get_entity("Iteration_0_vertical_real_[0]")[0].values # Run the inverse params = FDEMInversionOptions.build( @@ -200,8 +200,8 @@ def test_fem_run(tmp_path: Path, max_iterations=1, pytest=True): output["data"] = orig_z_real_1 assert ( - run_ws.get_entity("Iteration_1_z_imag_[1]")[0].entity_type.uid - == run_ws.get_entity("Observed_z_imag_[1]")[0].entity_type.uid + run_ws.get_entity("Iteration_1_vertical_imag_[1]")[0].entity_type.uid + == run_ws.get_entity("Observed_vertical_imag_[1]")[0].entity_type.uid ) if pytest: diff --git a/tests/run_tests/driver_airborne_tem_1d_test.py b/tests/run_tests/driver_airborne_tem_1d_test.py index a907966a..6ddabda3 100644 --- a/tests/run_tests/driver_airborne_tem_1d_test.py +++ b/tests/run_tests/driver_airborne_tem_1d_test.py @@ -89,7 +89,7 @@ def test_airborne_tem_1d_run(tmp_path: Path, max_iterations=1, pytest=True): data = {} uncertainties = {} channels = { - "z": "dBzdt", + "vertical": "vertical", } for chan, cname in channels.items(): @@ -117,13 +117,13 @@ def test_airborne_tem_1d_run(tmp_path: Path, max_iterations=1, pytest=True): data_kwargs = {} for chan in channels: data_kwargs[f"{chan}_channel"] = components.survey.fetch_property_group( - name=f"dB{chan}dt" + name="vertical" ) data_kwargs[f"{chan}_uncertainty"] = components.survey.fetch_property_group( - name=f"dB{chan}dt uncertainties" + name="vertical uncertainties" ) - orig_dBzdt = geoh5.get_entity("Iteration_0_z_[0]")[0].values + orig_dBzdt = geoh5.get_entity("Iteration_0_vertical_[0]")[0].values # Run the inverse params = TDEM1DInversionOptions.build( diff --git a/tests/run_tests/driver_airborne_tem_test.py b/tests/run_tests/driver_airborne_tem_test.py index 64e74406..b57b1f51 100644 --- a/tests/run_tests/driver_airborne_tem_test.py +++ b/tests/run_tests/driver_airborne_tem_test.py @@ -127,7 +127,7 @@ def test_airborne_tem_run(tmp_path: Path, max_iterations=1, pytest=True): data = {} uncertainties = {} channels = { - "z": "dBzdt", + "vertical": "vertical", } for chan, cname in channels.items(): @@ -155,13 +155,13 @@ def test_airborne_tem_run(tmp_path: Path, max_iterations=1, pytest=True): data_kwargs = {} for chan in channels: data_kwargs[f"{chan}_channel"] = components.survey.fetch_property_group( - name=f"dB{chan}dt" + name="vertical" ) data_kwargs[f"{chan}_uncertainty"] = components.survey.fetch_property_group( - name=f"dB{chan}dt uncertainties" + name="vertical uncertainties" ) - orig_dBzdt = geoh5.get_entity("Iteration_0_z_[0]")[0].values + orig_dBzdt = geoh5.get_entity("Iteration_0_vertical_[0]")[0].values # Run the inverse params = TDEMInversionOptions.build( diff --git a/tests/run_tests/driver_ground_tem_test.py b/tests/run_tests/driver_ground_tem_test.py index c70fcaaa..15ba888c 100644 --- a/tests/run_tests/driver_ground_tem_test.py +++ b/tests/run_tests/driver_ground_tem_test.py @@ -180,7 +180,7 @@ def test_ground_tem_run(tmp_path: Path, max_iterations=1, pytest=True): data = {} uncertainties = {} channels = { - "z": "dBzdt", + "vertical": "vertical", } for chan, cname in channels.items(): @@ -209,13 +209,13 @@ def test_ground_tem_run(tmp_path: Path, max_iterations=1, pytest=True): data_kwargs = {} for chan in channels: data_kwargs[f"{chan}_channel"] = components.survey.fetch_property_group( - name=f"dB{chan}dt" + name="vertical" ) data_kwargs[f"{chan}_uncertainty"] = components.survey.fetch_property_group( - name=f"dB{chan}dt uncertainties" + name="vertical uncertainties" ) - orig_dBzdt = geoh5.get_entity("Iteration_0_z_[0]")[0].values + orig_dBzdt = geoh5.get_entity("Iteration_0_vertical_[0]")[0].values # Run the inverse params = TDEMInversionOptions.build( diff --git a/tests/run_tests/driver_joint_surveys_test.py b/tests/run_tests/driver_joint_surveys_test.py index 1ab0ca60..fddf2d36 100644 --- a/tests/run_tests/driver_joint_surveys_test.py +++ b/tests/run_tests/driver_joint_surveys_test.py @@ -364,7 +364,7 @@ def test_joint_surveys_tem_run( data = {} uncertainties = {} channels = { - "z": "dBzdt", + "vertical": "vertical", } survey = components.survey for cname in channels.values(): @@ -390,10 +390,10 @@ def test_joint_surveys_tem_run( data_kwargs = {} for chan in channels: data_kwargs[f"{chan}_channel"] = components.survey.fetch_property_group( - name=f"dB{chan}dt" + name="vertical" ) data_kwargs[f"{chan}_uncertainty"] = components.survey.fetch_property_group( - name=f"dB{chan}dt uncertainties" + name="vertical uncertainties" ) # Run the inverse diff --git a/tests/run_tests/oriented_airborne_fem_receiver_test.py b/tests/run_tests/oriented_airborne_fem_receiver_test.py index b2d4b794..47858a9d 100644 --- a/tests/run_tests/oriented_airborne_fem_receiver_test.py +++ b/tests/run_tests/oriented_airborne_fem_receiver_test.py @@ -52,7 +52,7 @@ def collect_real_components(geoh5): survey = next( child for child in group.children if isinstance(child, AirborneFEMReceivers) ) - for comp in "xyz": + for comp in ["vertical", "inline", "crossline"]: data_group = survey.get_entity(f"Iteration_0_{comp}_real")[0] data_list[comp] = np.vstack( [survey.get_data(uid)[0].values for uid in data_group.properties] @@ -146,7 +146,7 @@ def test_validate_orientations(tmp_path: Path): sim_45_0 = collect_real_components(geoh5) # Components almost the same at 45 - assert np.mean((sim_90_0["y"] - sim_45_0["y"]) / sim_90_0["y"]) < 0.2 + assert np.mean((sim_90_0["inline"] - sim_45_0["inline"]) / sim_90_0["inline"]) < 0.2 with Workspace( tmp_path / "../test_fem_fwr_run_90_90_0/inversion_test.ui.geoh5" @@ -154,5 +154,10 @@ def test_validate_orientations(tmp_path: Path): sim_90_90 = collect_real_components(geoh5) # 90 dip makes Y point down and Z east, so Y should be -Z, and Z should be Y - assert np.mean((sim_90_0["y"] - sim_90_90["z"]) / sim_90_0["y"]) < 0.2 - assert np.mean((sim_90_0["z"] + sim_90_90["y"]) / sim_90_0["z"]) < 0.2 + assert ( + np.mean((sim_90_0["inline"] - sim_90_90["vertical"]) / sim_90_0["inline"]) < 0.2 + ) + assert ( + np.mean((sim_90_0["vertical"] + sim_90_90["inline"]) / sim_90_0["vertical"]) + < 0.2 + ) diff --git a/tests/run_tests/oriented_airborne_tem_receiver_test.py b/tests/run_tests/oriented_airborne_tem_receiver_test.py index a5f328e3..574a42ef 100644 --- a/tests/run_tests/oriented_airborne_tem_receiver_test.py +++ b/tests/run_tests/oriented_airborne_tem_receiver_test.py @@ -46,7 +46,7 @@ def collect_components(geoh5): survey = next( child for child in group.children if isinstance(child, AirborneTEMReceivers) ) - for comp in "xyz": + for comp in ["vertical", "inline", "crossline"]: data_group = survey.get_entity(f"Iteration_0_{comp}")[0] data_list[comp] = np.vstack( [survey.get_data(uid)[0].values for uid in data_group.properties] @@ -137,7 +137,7 @@ def test_validate_orientations(tmp_path: Path): sim_45_0 = collect_components(geoh5) # Components almost the same at 45 - assert np.mean((sim_90_0["y"] - sim_45_0["y"]) / sim_90_0["y"]) < 0.3 + assert np.mean((sim_90_0["inline"] - sim_45_0["inline"]) / sim_90_0["inline"]) < 0.3 with Workspace( tmp_path / "../test_tem_fwr_run_90_90_0/inversion_test.ui.geoh5" @@ -145,5 +145,10 @@ def test_validate_orientations(tmp_path: Path): sim_90_90 = collect_components(geoh5) # 90 dip makes Y point down and Z east, so Y should be -Z, and Z should be Y - assert np.mean((sim_90_0["y"] - sim_90_90["z"]) / sim_90_0["y"]) < 0.1 - assert np.mean((sim_90_0["z"] + sim_90_90["y"]) / sim_90_0["z"]) < 0.1 + assert ( + np.mean((sim_90_0["inline"] - sim_90_90["vertical"]) / sim_90_0["inline"]) < 0.1 + ) + assert ( + np.mean((sim_90_0["vertical"] + sim_90_90["inline"]) / sim_90_0["vertical"]) + < 0.1 + )