pygmi.mag.dataprep#

A set of Magnetic Data routines.

Classes#

Tilt1

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

RTP

Perform Reduction to the Pole on Magnetic data.

Functions#

tilt1(data, azi, s[, k])

Tilt angle calculations.

nextpow2(n)

Next power of 2.

vertical(data[, npts, xint, order])

Vertical derivative.

fftprep(data)

FFT Preparation.

fft_getkxy(fftmod, xdim, ydim)

Get KX and KY.

rtp(data, I_deg, D_deg)

Reduction to the pole.

Module Contents#

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

Bases: pygmi.misc.BasicModule

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

Parameters:

parent (parent, 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(data, azi, s, k=2)#

Tilt angle calculations.

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

Witwatersrand, Johannesburg, South Africa)

Parameters:
  • data (numpy masked array) – 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.

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

pygmi.mag.dataprep.vertical(data, npts=None, xint=1, order=1)#

Vertical derivative.

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

Witwatersrand, Johannesburg, South Africa).

Parameters:
  • data (numpy array) – Input data.

  • npts (int, optional) – Number of points. The default is None.

  • xint (float, optional) – X interval. The default is 1.

  • order (int) – Order of derivative. The default is 1.

Returns:

dz – Output data

Return type:

numpy array

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

Bases: pygmi.misc.BasicModule

Perform Reduction to the Pole on Magnetic data.

Parameters:

parent (parent, 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.fftprep(data)#

FFT Preparation.

Parameters:

data (numpy array) – Input dataset.

Returns:

  • zfin (numpy array.) – Output prepared data.

  • rdiff (int) – rows divided by 2.

  • cdiff (int) – columns divided by 2.

  • datamedian (float) – Median of data.

pygmi.mag.dataprep.fft_getkxy(fftmod, xdim, ydim)#

Get KX and KY.

Parameters:
  • fftmod (numpy array) – FFT data.

  • xdim (float) – cell x dimension.

  • ydim (float) – cell y dimension.

Returns:

  • KX (numpy array) – x sample frequencies.

  • KY (numpy array) – y sample frequencies.

pygmi.mag.dataprep.rtp(data, I_deg, D_deg)#

Reduction to the pole.

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

  • I_deg (float) – Magnetic inclination.

  • D_deg (float) – Magnetic declination.

Returns:

dat – PyGMI raster data.

Return type:

pygmi.raster.datatypes.Data