mtpy.modeling.simpeg.recipes package

Submodules

mtpy.modeling.simpeg.recipes.inversion_1d module

Created on Wed Nov 1 11:58:59 2023

@author: jpeacock

class mtpy.modeling.simpeg.recipes.inversion_1d.Simpeg1D(mt_dataframe=None, **kwargs)[source]

Bases: object

Run a 1D simpeg inversion.

cull_from_difference(sub_df, max_diff_res=1.0, max_diff_phase=10)[source]

Remove points based on a simple difference between neighboring points

uses np.diff

res difference is in log space. :param sub_df: :param max_diff_res: DESCRIPTION, defaults to 1.0. :type max_diff_res: TYPE, optional :param max_diff_phase: DESCRIPTION, defaults to 10. :type max_diff_phase: TYPE, optional :return: DESCRIPTION. :rtype: TYPE

cull_from_interpolated(sub_df, tolerance=0.1, s_factor=2)[source]

create a cubic spline as a smooth version of the data and then find points a certain distance away to remove.

:param : DESCRIPTION :type : TYPE :return: DESCRIPTION :rtype: TYPE

cull_from_model(iteration)[source]

Remove bad point based on initial run. :param iteration: DESCRIPTION. :type iteration: TYPE :return: DESCRIPTION. :rtype: TYPE

property data

Data function.

property data_error

Data error.

property frequencies

Frequencies function.

property mesh

Mesh function.

property mode

Mode function.

property periods

Periods function.

plot_model_fitting(scale='log', fig_num=1)[source]

Plot predicted vs model. :return: DESCRIPTION. :rtype: TYPE

plot_response(iteration=None, fig_num=1, **kwargs)[source]

Plot response. :param fig_num:

Defaults to 2.

Parameters:

iteration (TYPE, optional) – DESCRIPTION, defaults to None.

Returns:

DESCRIPTION.

Return type:

TYPE

run_fixed_layer_inversion(cull_from_difference=False, maxIter=40, maxIterCG=30, alpha_s=1e-10, alpha_z=1, beta0_ratio=1, coolingFactor=2, coolingRate=1, chi_factor=1, use_irls=False, p_s=2, p_z=2, **kwargs)[source]

Run fixed layer inversion.

property thicknesses

Thicknesses function.

mtpy.modeling.simpeg.recipes.inversion_2d module

Created on Tue Aug 20 17:17:41 2024

@author: jpeacock

A vanilla recipe to invert 2D MT data.

  • For now the default is a quad tree mesh

  • Optimization: Inexact Gauss Newton

class mtpy.modeling.simpeg.recipes.inversion_2d.Simpeg2D(dataframe, data_kwargs={}, mesh_kwargs={}, mesh_type='tensor', **kwargs)[source]

Bases: object

A vanilla recipe to invert 2D MT data.

  • For now the default is a quad tree mesh

  • Optimization: Inexact Gauss Newton

  • Regularization: Sparse

# change mesh to tensor mesh.

property active_map

Active cells mapping

Returns:

DESCRIPTION

Return type:

TYPE

property beta_schedule

how quickly beta is reduced

Returns:

DESCRIPTION

Return type:

TYPE

property conductivity_map

conductivity mapping

Returns:

DESCRIPTION

Return type:

TYPE

property data_misfit

data misfit of all components TE + TM

property directives

list of directives to supply to the inversion

Returns:

DESCRIPTION

Return type:

TYPE

property exponent_map

compute fields on an exponential mapping :return: DESCRIPTION :rtype: TYPE

property inverse_problem

setup the inverse problem

Returns:

DESCRIPTION

Return type:

TYPE

property iterations

return dictionary of model outputs

make_mesh(**kwargs)[source]

make QuadTree Mesh

property optimization

optimization algorithm

default is InexactGaussNewton

plot_iteration(iteration_number, resistivity=True, **kwargs)[source]
plot_responses(iteration_number, **kwargs)[source]

Plot responses all together

Parameters:
  • iteration (TYPE) – DESCRIPTION

  • **kwargs

    DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

plot_tikhonov_curve()[source]

plot L-like curve

Returns:

DESCRIPTION

Return type:

TYPE

property reference_model

reference model

Returns:

DESCRIPTION

Return type:

TYPE

property regularization

Create sparse regularization using paramaters

  • alpha_s = smallness parameter

  • alpha_y = smoothing in y direction

  • alpha_z = smoothing in z direction

Returns:

DESCRIPTION

Return type:

TYPE

run_inversion()[source]

run the inversion using the attributes as input.

property starting_beta

set up the starting beta value

Returns:

DESCRIPTION

Return type:

TYPE

property target_misfit

target misfit

Returns:

DESCRIPTION

Return type:

TYPE

property te_data_misfit

data misfit of TE mode

property te_simulation

Simulation for TE Mode

property tm_data_misfit

data misfit of TM mode

property tm_simulation

Simulation for TE Mode

Module contents

Created on Wed Nov 1 11:58:39 2023

@author: jpeacock

class mtpy.modeling.simpeg.recipes.Simpeg1D(mt_dataframe=None, **kwargs)[source]

Bases: object

Run a 1D simpeg inversion.

cull_from_difference(sub_df, max_diff_res=1.0, max_diff_phase=10)[source]

Remove points based on a simple difference between neighboring points

uses np.diff

res difference is in log space. :param sub_df: :param max_diff_res: DESCRIPTION, defaults to 1.0. :type max_diff_res: TYPE, optional :param max_diff_phase: DESCRIPTION, defaults to 10. :type max_diff_phase: TYPE, optional :return: DESCRIPTION. :rtype: TYPE

cull_from_interpolated(sub_df, tolerance=0.1, s_factor=2)[source]

create a cubic spline as a smooth version of the data and then find points a certain distance away to remove.

:param : DESCRIPTION :type : TYPE :return: DESCRIPTION :rtype: TYPE

cull_from_model(iteration)[source]

Remove bad point based on initial run. :param iteration: DESCRIPTION. :type iteration: TYPE :return: DESCRIPTION. :rtype: TYPE

property data

Data function.

property data_error

Data error.

property frequencies

Frequencies function.

property mesh

Mesh function.

property mode

Mode function.

property periods

Periods function.

plot_model_fitting(scale='log', fig_num=1)[source]

Plot predicted vs model. :return: DESCRIPTION. :rtype: TYPE

plot_response(iteration=None, fig_num=1, **kwargs)[source]

Plot response. :param fig_num:

Defaults to 2.

Parameters:

iteration (TYPE, optional) – DESCRIPTION, defaults to None.

Returns:

DESCRIPTION.

Return type:

TYPE

run_fixed_layer_inversion(cull_from_difference=False, maxIter=40, maxIterCG=30, alpha_s=1e-10, alpha_z=1, beta0_ratio=1, coolingFactor=2, coolingRate=1, chi_factor=1, use_irls=False, p_s=2, p_z=2, **kwargs)[source]

Run fixed layer inversion.

property thicknesses

Thicknesses function.

class mtpy.modeling.simpeg.recipes.Simpeg2D(dataframe, data_kwargs={}, mesh_kwargs={}, mesh_type='tensor', **kwargs)[source]

Bases: object

A vanilla recipe to invert 2D MT data.

  • For now the default is a quad tree mesh

  • Optimization: Inexact Gauss Newton

  • Regularization: Sparse

# change mesh to tensor mesh.

property active_map

Active cells mapping

Returns:

DESCRIPTION

Return type:

TYPE

property beta_schedule

how quickly beta is reduced

Returns:

DESCRIPTION

Return type:

TYPE

property conductivity_map

conductivity mapping

Returns:

DESCRIPTION

Return type:

TYPE

property data_misfit

data misfit of all components TE + TM

property directives

list of directives to supply to the inversion

Returns:

DESCRIPTION

Return type:

TYPE

property exponent_map

compute fields on an exponential mapping :return: DESCRIPTION :rtype: TYPE

property inverse_problem

setup the inverse problem

Returns:

DESCRIPTION

Return type:

TYPE

property iterations

return dictionary of model outputs

make_mesh(**kwargs)[source]

make QuadTree Mesh

property optimization

optimization algorithm

default is InexactGaussNewton

plot_iteration(iteration_number, resistivity=True, **kwargs)[source]
plot_responses(iteration_number, **kwargs)[source]

Plot responses all together

Parameters:
  • iteration (TYPE) – DESCRIPTION

  • **kwargs

    DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE

plot_tikhonov_curve()[source]

plot L-like curve

Returns:

DESCRIPTION

Return type:

TYPE

property reference_model

reference model

Returns:

DESCRIPTION

Return type:

TYPE

property regularization

Create sparse regularization using paramaters

  • alpha_s = smallness parameter

  • alpha_y = smoothing in y direction

  • alpha_z = smoothing in z direction

Returns:

DESCRIPTION

Return type:

TYPE

run_inversion()[source]

run the inversion using the attributes as input.

property starting_beta

set up the starting beta value

Returns:

DESCRIPTION

Return type:

TYPE

property target_misfit

target misfit

Returns:

DESCRIPTION

Return type:

TYPE

property te_data_misfit

data misfit of TE mode

property te_simulation

Simulation for TE Mode

property tm_data_misfit

data misfit of TM mode

property tm_simulation

Simulation for TE Mode