pygmi.mt.dataprep#

A set of data preparation routines for MT data.

Classes#

Metadata

Edit Metadata.

MyMplCanvas

Matplotlib canvas widget for the actual plot.

StaticShiftEDI

Static shift EDI data.

RotateEDI

Rotate EDI data.

MyMplCanvasPick

Matplotlib canvas widget for the actual plot.

EditEDI

Edit EDI Class.

MySlider

My Slider.

MyMplCanvas2

Matplotlib canvas widget for the actual plot.

Occam1D

Occam 1D inversion.

Functions#

tonumber(test[, alttext])

Check if something is a number or matches alttext.

Module Contents#

class pygmi.mt.dataprep.Metadata(parent=None)#

Bases: pygmi.misc.ContextModule

Edit Metadata.

This class allows the editing of the metadata for MT data using a GUI.

Parameters:

parent – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

acceptall()#

Accept option. Updates self.indata.

rename_id()#

Rename station name.

update_vals()#

Update the values on the interface.

run()#

Entry point into the routine, used to run context menu item.

Returns:

True if successful, False otherwise.

Return type:

bool.

class pygmi.mt.dataprep.MyMplCanvas#

Bases: matplotlib.backends.backend_qtagg.FigureCanvasQTAgg

Matplotlib canvas widget for the actual plot.

update_line(data, ival, itype)#

Update the plot from point data.

Parameters:
  • data (dict) – Dictionary of EDI data.

  • ival (str) – EDI data dictionary key.

  • itype (str) – Graph type.

class pygmi.mt.dataprep.StaticShiftEDI(parent=None)#

Bases: pygmi.misc.BasicModule

Static shift EDI data.

Parameters:

parent – Reference to the parent routine. The default is None.

acceptall()#

Accept option.

Updates self.outdata, which is used as input to other modules.

apply()#

Apply static shift.

reset_data()#

Reset data.

change_band()#

Combo to change band.

settings(nodialog=False)#

Entry point into item.

Parameters:

nodialog (bool) – Run settings without a dialog. The default is False.

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

class pygmi.mt.dataprep.RotateEDI(parent=None)#

Bases: pygmi.misc.BasicModule

Rotate EDI data.

Parameters:

parent – Reference to the parent routine. The default is None.

acceptall()#

Accept option.

Updates self.outdata, which is used as input to other modules.

apply()#

Apply rotation to data.

reset_data()#

Reset data.

change_band()#

Combo to change band.

settings(nodialog=False)#

Entry point into item.

Parameters:

nodialog (bool) – Run settings without a dialog. The default is False.

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

class pygmi.mt.dataprep.MyMplCanvasPick#

Bases: matplotlib.backends.backend_qtagg.FigureCanvasQTAgg

Matplotlib canvas widget for the actual plot.

This routine will also allow the picking and movement of nodes of data.

button_press_callback(event)#

Mouse button release callback.

Parameters:

event (matplotlib.backend_bases.MouseEvent) – event variable.

button_release_callback(event)#

Mouse button release callback.

Parameters:

event (matplotlib.backend_bases.MouseEvent) – event variable.

motion_notify_callback(event)#

Move mouse callback.

Parameters:

event (matplotlib.backend_bases.MouseEvent) – event variable.

onpick(event)#

Picker event.

Parameters:

event (matplotlib.backend_bases.PickEvent) – event variable.

Returns:

True if successful, False otherwise.

Return type:

bool

revent(event)#

Resize event.

Parameters:

event (matplotlib.backend_bases.ResizeEvent) – unused.

update_line(data, ival=None, itype=None)#

Update the plot from point data.

Parameters:
  • data (dict) – Dictionary of EDI data.

  • ival (str | None) – EDI data dictionary key.

  • itype (str | None) – Graph type.

class pygmi.mt.dataprep.EditEDI(parent=None)#

Bases: pygmi.misc.BasicModule

Edit EDI Class.

Parameters:

parent – Reference to the parent routine. The default is None.

acceptall()#

Accept option.

Updates self.outdata, which is used as input to other modules.

apply()#

Apply edited data.

reset_data()#

Reset data.

change_band()#

Combo to choose band.

settings(nodialog=False)#

Entry point into item.

Parameters:

nodialog (bool) – Run settings without a dialog. The default is False.

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

class pygmi.mt.dataprep.MySlider(parent=None)#

Bases: PySide6.QtWidgets.QSlider

My Slider.

Custom class which allows clicking on a horizontal slider bar with slider moving to click in a single step.

mousePressEvent(event)#

Mouse press event.

Parameters:

event (matplotlib.backend_bases.MouseEvent) – event variable.

mouseMoveEvent(event)#

Jump to pointer position while moving.

Parameters:

event (matplotlib.backend_bases.MouseEvent) – event variable.

class pygmi.mt.dataprep.MyMplCanvas2#

Bases: matplotlib.backends.backend_qtagg.FigureCanvasQTAgg

Matplotlib canvas widget for the actual plot.

update_line(x, pdata, rdata, *, depths=None, res=None, title=None)#

Update the plot from data.

Parameters:
  • x (numpy array) – X coordinates (period).

  • pdata (numpy array) – Phase data.

  • rdata (numpy array) – Apparent resistivity data.

  • depths (numpy array, optional) – Model depths. The default is None.

  • res (numpy array, optional) – Resistivities. The default is None.

  • title (str or None, optional) – Title text. The default is None.

class pygmi.mt.dataprep.Occam1D(parent=None)#

Bases: pygmi.misc.BasicModule

Occam 1D inversion.

Parameters:

parent – Reference to the parent routine. The default is None.

snum()#

Change solution graph.

acceptall()#

Accept option.

Updates self.outdata, which is used as input to other modules.

apply()#

Invert the data.

get_occfile(filename='')#

Get Occam executable filename.

Parameters:

filename (str) – Occam executable filename. The default is ‘’.

reset_data()#

Reset data.

change_band()#

Combo to change band.

settings(nodialog=False)#

Entry point into item.

Parameters:

nodialog (bool) – Run settings without a dialog. The default is False.

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

pygmi.mt.dataprep.tonumber(test, alttext=None)#

Check if something is a number or matches alttext.

Parameters:
  • test (str) – Text to test.

  • alttext (str | None) – Alternate text to test. The default is None.

Returns:

Returns a lower case version of alttext, or a number.

Return type:

str or int or float