pygmi.mag.dataprep#

A set of Magnetic Data routines.

Classes#

ASig

Calculate analytic signal via a GUI.

Tilt1

Class used to gather information via a GUI, for function tilt1.

RTP

Perform Reduction to the Pole on Magnetic data.

Functions#

asig(data1[, showlog, piter])

Tilt angle calculations.

tilt1(data1, azi, s[, k, showlog, piter])

Tilt angle calculations.

nextpow2(n)

Next power of 2.

rtp(data, I_deg, D_deg[, Ia, showlog, piter])

Reduction to the pole.

gradient2D(daty, datx)

Perform 2D gradient where spacing is inconsistent in 2D.

Module Contents#

class pygmi.mag.dataprep.ASig(parent=None)#

Bases: pygmi.misc.BasicModule

Calculate analytic signal via a GUI.

Parameters:

parent (pygmi.main.MainWidget, optional) – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

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

saveproj()#

Save project data from class.

Return type:

None.

pygmi.mag.dataprep.asig(data1, showlog=print, piter=iter)#

Tilt angle calculations.

Based on work by Gordon Cooper (School of Geosciences, University of the

Witwatersrand, Johannesburg, South Africa)

Parameters:
  • data1 (pygmi.raster.datatypes.Data) – data with matrix of double to be filtered

  • showlog (function, optional) – Show information using a function. The default is print.

  • piter (function, optional) – Progress bar iterator. The default is iter.

Returns:

asig1 – Analytic signal

Return type:

numpy masked array

class pygmi.mag.dataprep.Tilt1(parent=None)#

Bases: pygmi.misc.BasicModule

Class used to gather information via a GUI, for function tilt1.

Parameters:

parent (pygmi.main.MainWidget, optional) – Reference to the parent routine. The default is None.

azi#

directional filter azimuth in degrees from East

Type:

float

smooth#

size of smoothing matrix to use - must be odd input 0 for no smoothing

Type:

int

setupui()#

Set up UI.

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

saveproj()#

Save project data from class.

Return type:

None.

pygmi.mag.dataprep.tilt1(data1, azi, s, k=2, showlog=print, piter=iter)#

Tilt angle calculations.

Based on work by Gordon Cooper (School of Geosciences, University of the

Witwatersrand, Johannesburg, South Africa)

Parameters:
  • data1 (pygmi.raster.datatypes.Data) – data with matrix of double to be filtered

  • azi (float) – directional filter azimuth in degrees from East

  • s (int) – size of smoothing matrix to use - must be odd input 0 for no smoothing

  • k (int) – Factor for EHGA filter. Must be > 0. Optional.

  • showlog (function, optional) – Show information using a function. The default is print.

  • piter (function, optional) – Progress bar iterator. The default is iter.

Returns:

  • t1 (numpy masked array) – Standard tilt angle

  • th (numpy masked array) – Hyperbolic tilt angle

  • t2 (numpy masked array) – Second order tilt angle

  • ta (numpy masked array) – Tilt Based Directional Derivative

  • tdx (numpy masked array) – Total Derivative

  • tahg (numpy masked array) – Tilt Angle of the Horizontal Gradient

  • ehga (numpy masked array) – Enhanced Horizontal Gradient Amplitude

pygmi.mag.dataprep.nextpow2(n)#

Next power of 2.

Based on work by Gordon Cooper (School of Geosciences, University of the

Witwatersrand, Johannesburg, South Africa).

Parameters:

n (float or numpy array) – Current value.

Returns:

m_i – Output.

Return type:

float or numpy array

class pygmi.mag.dataprep.RTP(parent=None)#

Bases: pygmi.misc.BasicModule

Perform Reduction to the Pole on Magnetic data.

Parameters:

parent (pygmi.main.MainWidget, optional) – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

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

saveproj()#

Save project data from class.

Return type:

None.

acceptall()#

Accept option.

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

Return type:

None.

pygmi.mag.dataprep.rtp(data, I_deg, D_deg, Ia=20, showlog=print, piter=iter)#

Reduction to the pole.

Parameters:
  • data (pygmi.raster.datatypes.Data) – PyGMI raster data.

  • I_deg (float) – Magnetic inclination.

  • D_deg (float) – Magnetic declination.

  • Ia (float) – Amplitude correction inclination Ia in degree. The default is 20.

  • showlog (function, optional) – Show information using a function. The default is print.

  • piter (function, optional) – Progress bar iterator. The default is iter.

Returns:

dat – PyGMI raster data.

Return type:

pygmi.raster.datatypes.Data

pygmi.mag.dataprep.gradient2D(daty, datx)#

Perform 2D gradient where spacing is inconsistent in 2D.

Parameters:
  • daty (numpy array) – _description_

  • datx (numpy array) – _description_

Returns:

dx – output gradient array

Return type:

numpy array