Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/direct_current_2d_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/direct_current_3d_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/fdem1d_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/fem_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/gravity_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,17 +581,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,7 @@
"lineEdit": false,
"enabled": false
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Regularization",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"enabled": false
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/joint_surveys_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/magnetic_scalar_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -613,17 +613,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/magnetic_vector_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,17 +678,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/magnetotellurics_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,17 +533,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,17 +313,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/tdem_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
12 changes: 1 addition & 11 deletions simpeg_drivers-assets/uijson/tipper_inversion.ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,7 @@
"enabled": true,
"tooltip": "Lp-norm used in the z-smoothness term of the objective function."
},
"gradient_type": {
"choiceList": [
"total",
"components"
],
"group": "Sparse/blocky model",
"label": "Gradient type",
"value": "total",
"verbose": 3,
"tooltip": "Choose whether the IRLS weights for regularization terms are updated using total or partial gradients."
},
"gradient_type": "total",
"max_irls_iterations": {
"min": 0,
"group": "Sparse/blocky model",
Expand Down
9 changes: 0 additions & 9 deletions simpeg_drivers/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,6 @@ def get_regularization(self):
reg_func.norms = [fun.norm for fun in functions]
reg_funcs.append(reg_func)

# TODO - To be deprcated on GEOPY-2109
if getattr(self.params, "gradient_type") is not None:
for reg in reg_funcs:
setattr(
reg,
"gradient_type",
getattr(self.params, "gradient_type"),
)

return objective_function.ComboObjectiveFunction(objfcts=reg_funcs)

def get_tiles(self):
Expand Down
1 change: 1 addition & 0 deletions simpeg_drivers/potential_fields/gravity/uijson.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class GravityInversionUIJson(SimPEGDriversUIJson):
out_group: GroupForm
generate_sweep: BoolForm
distributed_workers: str
gradient_type: Deprecated | None = None
output_tile_files: Deprecated | None = None
inversion_style: Deprecated | None = None
max_ram: Deprecated | None = None
Expand Down
18 changes: 16 additions & 2 deletions tests/run_tests/driver_mvi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from pathlib import Path

import numpy as np
from geoh5py.groups import PropertyGroup
from geoh5py.groups.property_group import GroupTypeEnum
from geoh5py.objects import Curve
from geoh5py.workspace import Workspace
Expand All @@ -34,7 +35,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_mvi_run = {"data_norm": 6.3559205278626525, "phi_d": 0.0143, "phi_m": 0.0009}
target_mvi_run = {"data_norm": 6.3559205278626525, "phi_d": 0.0091, "phi_m": 0.00603}


def test_magnetic_vector_fwr_run(
Expand Down Expand Up @@ -95,6 +96,19 @@ def test_magnetic_vector_run(
topography = geoh5.get_entity("topography")[0]
inducing_field = (50000.0, 90.0, 0.0)

dip, direction = mesh.add_data(
{
"dip": {"values": np.zeros(mesh.n_cells)},
"direction": {"values": np.zeros(mesh.n_cells)},
}
)
gradient_rotation = PropertyGroup(
name="gradient_rotations",
property_group_type=GroupTypeEnum.DIPDIR,
properties=[dip, direction],
parent=mesh,
)

# Run the inverse
active_cells = ActiveCellsOptions(topography_object=topography)
params = MVIInversionOptions(
Expand All @@ -111,10 +125,10 @@ def test_magnetic_vector_run(
x_norm=1.0,
y_norm=1.0,
z_norm=1.0,
gradient_type="components",
tmi_channel=tmi,
tmi_uncertainty=4.0,
max_global_iterations=max_iterations,
gradient_rotation=gradient_rotation,
initial_beta_ratio=1e1,
store_sensitivities="ram",
save_sensitivities=True,
Expand Down