pygmi.mt package

Submodules

pygmi.mt.birrp module

BIRRP -Bounded Influence Remote Reference Processing.

BIRRP is developed by: Dr Alan D. Chave Woods Hole Oceanographic Institution achave@whoi.edu

It requires an executable which must be obtained directly from Dr Chave. Details can be found at: https://www.whoi.edu/science/AOPE/people/achave/Site/Next1.html

Conditions for the use of the BIRRP bounded influence remote reference magnetotelluric processing program:

  1. The robust bounded influence magnetotelluric analysis program, hereinafter called BIRRP, is provided on a caveat emptor basis. The author of BIRRP is not responsible for or culpable in the event of errors in processing or interpretation resulting from use of this code.

  2. No payment will be accepted by any user for data processing with BIRRP.

  3. BIRRP will not be distributed to anyone. Interested persons should be referred to this website.

  4. The author will be notified of any possible coding errors that are encountered.

  5. The author will be informed of any improvements or additions that are made to BIRRP.

  6. The use of BIRRP will be acknowledged in any publications and presentations that ensue.

If these conditions are acceptable, send e-mail to achave@whoi.edu. The body of the message should state “I accept the conditions under which BIRRP is distributed” and copy the above six conditions. A gzipped tar file containing the source code will be distributed by return e-mail.

Note, it will still be necessary for the end-user to compile the code.

class pygmi.mt.birrp.BIRRP(parent=None)

Bases: BasicModule

Class to export config file for BIRRP.

get_filename(widget)

Get filename for a component.

Parameters:

widget (widget) – widget whose text is set to filename..

Return type:

None.

imode_changed(indx)

Value of imode changed.

Parameters:

indx (int) – Index.

Return type:

None.

importbirrp()

Import a BIRRP config file.

Return type:

None.

jmode_changed()

Value of jmode changed.

Return type:

None.

nar_changed()

Value of nar changed.

Return type:

None.

nfil_changed()

Value of nfil changed.

Return type:

None.

nout_changed()

Value of nout changed.

Return type:

None.

removerow(widget, lay)

Remove a row.

Parameters:
  • widget (Qt widget.) – Qt widget.

  • lay (QtWidgets.QFormLayout) – Form Layout.

Return type:

None.

runbirrp()

Save and runs a birrp config file.

Return type:

None.

saveproj()

Save project data from class.

Return type:

None.

settings(nodialog=False)

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

setupui()

Set up UI.

Return type:

None.

showrow(row, label, widget, lay)

Show a row within a widget.

Parameters:
  • row (int) – Row number.

  • label (str) – Row label.

  • widget (Qt widget.) – Qt widget.

  • lay (QtWidgets.QFormLayout) – Form Layout.

Return type:

None.

pygmi.mt.dataprep module

A set of Data Preparation routines.

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

Bases: BasicModule

Edit EDI Class.

acceptall()

Accept option.

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

Return type:

None.

apply()

Apply edited data.

Return type:

None.

change_band()

Combo to choose band.

Return type:

None.

reset_data()

Reset data.

Return type:

None.

saveproj()

Save project data from class.

Return type:

None.

settings(nodialog=False)

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

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

Bases: ContextModule

Edit Metadata.

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

banddata

band data

Type:

dictionary

bandid

dictionary of strings containing band names.

Type:

dictionary

acceptall()

Accept option. Updates self.indata.

Return type:

None.

rename_id()

Rename station name.

Return type:

None.

run()

Run.

Returns:

True if successful, False otherwise.

Return type:

bool.

setupui()

Set up UI.

Return type:

None.

update_vals()

Update the values on the interface.

Return type:

None.

class pygmi.mt.dataprep.MyMplCanvas(parent=None)

Bases: FigureCanvasQTAgg

MPL Canvas class.

update_line(data, ival, itype)

Update the plot from point data.

Parameters:
  • data (EDI data object) – EDI data.

  • ival (str) – dictionary key.

  • itype (str) – dictionary key.

Return type:

None.

class pygmi.mt.dataprep.MyMplCanvas2(parent=None)

Bases: FigureCanvasQTAgg

MPL Canvas class.

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.

Return type:

None.

class pygmi.mt.dataprep.MyMplCanvasPick(parent=None)

Bases: FigureCanvasQTAgg

MPL Canvas class.

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

button_press_callback(event)

Mouse button release callback.

Parameters:

event (event) – event variable.

Return type:

None.

button_release_callback(event)

Mouse button release callback.

Parameters:

event (event) – event variable.

Return type:

None.

motion_notify_callback(event)

Move mouse callback.

Parameters:

event (event) – event variable.

Return type:

None.

onpick(event)

Picker event.

Parameters:

event (event) – event variable.

Returns:

True if successful, False otherwise.

Return type:

bool

revent(width)

Resize event.

Parameters:

width (event) – unused.

Return type:

None.

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

Update the plot from point data.

Parameters:
  • data (EDI data object) – EDI data.

  • ival (str) – dictionary key.

  • itype (str) – dictionary key.

Return type:

None.

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

Bases: QSlider

My Slider.

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

mouseMoveEvent(event)

Jump to pointer position while moving.

Parameters:

event (event) – event variable.

Return type:

None.

mousePressEvent(event)

Mouse press event.

Parameters:

event (event) – event variable.

Return type:

None.

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

Bases: BasicModule

Occam 1D inversion.

acceptall()

Accept option.

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

Return type:

None.

apply()

Apply.

Return type:

None.

change_band()

Combo to change band.

Return type:

None.

get_occfile(filename='')

Get Occam executable filename.

Parameters:

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

Return type:

None.

reset_data()

Reset data.

Return type:

None.

saveproj()

Save project data from class.

Return type:

None.

settings(nodialog=False)

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

snum()

Change solution graph.

Return type:

None.

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

Bases: BasicModule

Rotate EDI data.

acceptall()

Accept option.

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

Return type:

None.

apply()

Apply rotation to data.

Return type:

None.

change_band()

Combo to change band.

Return type:

None.

reset_data()

Reset data.

Return type:

None.

saveproj()

Save project data from class.

Return type:

None.

settings(nodialog=False)

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

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

Bases: BasicModule

Static shift EDI data.

acceptall()

Accept option.

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

Return type:

None.

apply()

Apply static shift.

Return type:

None.

change_band()

Combo to change band.

Return type:

None.

reset_data()

Reset data.

Return type:

None.

saveproj()

Save project data from class.

Return type:

None.

settings(nodialog=False)

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

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

Check if something is a number or matches alttext.

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

  • alttext (str, optional) – 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

pygmi.mt.graphs module

Plot Data using Matplotlib.

class pygmi.mt.graphs.GraphWindow(parent=None)

Bases: ContextModule

Graph Window - Main QT Dialog class for graphs.

change_band()

Combo box to choose band.

class pygmi.mt.graphs.MyMplCanvas(parent=None)

Bases: FigureCanvasQTAgg

MPL Canvas class.

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

button_release_callback(event)

Mouse button release callback.

Parameters:

event (event) – event variable.

Return type:

None.

motion_notify_callback(event)

Move mouse callback.

Parameters:

event (event) – event variable.

Return type:

None.

onpick(event)

Picker event.

Parameters:

event (event) – event variable.

Returns:

True if successful, False otherwise.

Return type:

bool

update_line(data, ival, itype)

Update the plot from point data.

Parameters:
  • data (EDI data object) – EDI data.

  • ival (str) – dictionary key.

  • itype (str) – dictionary key.

Return type:

None.

class pygmi.mt.graphs.PlotPoints(parent=None)

Bases: GraphWindow

Plot points class.

change_band()

Combo to choose band.

Return type:

None.

run()

Run.

Return type:

None.

pygmi.mt.iodefs module

Import and export EDI data.

class pygmi.mt.iodefs.ExportEDI(parent=None)

Bases: ContextModule

Export Data.

ofile

output file name.

Type:

str

export_edi(dat)

Export to EDI format.

Parameters:

dat (EDI Data) – dataset to export

Return type:

None.

run()

Run.

Returns:

True if successful, False otherwise.

Return type:

bool

class pygmi.mt.iodefs.ImportEDI(parent=None)

Bases: BasicModule

Import Data.

ifilelist

list of input file names.

Type:

list

saveproj()

Save project data from class.

Return type:

None.

settings(nodialog=False)

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

pygmi.mt.iodefs.get_EDI(ifiles)

EDI Import.

Parameters:

ifiles (list) – filenames to import

Returns:

dat – Dataset imported

Return type:

EDI data.

pygmi.mt.menu module

EM Menu Routines.

class pygmi.mt.menu.MenuWidget(parent=None)

Bases: object

Widget class to call the main interface.

This widget class creates menus to be found on the main interface. Normal as well as context menus are defined here.

parent

Reference to MainWidget class found in main.py

Type:

pygmi.main.MainWidget

birrp()

BIRRP.

export_data()

Export data.

import_data()

Import data.

metadata()

Metadata.

mi_data()

Mask and interpolate data.

occam1d()

Occam 1D inversion.

rotate_data()

Rotate data.

show_graphs()

Show graphs.

sshift_data()

Calculate Static Shift.

Module contents

MT Routines