pygmi.pfmod.tab_prof

Contents

pygmi.pfmod.tab_prof#

Profile Display Tab Routines.

Classes#

ProfileDisplay

Widget class to call the main interface.

MyMplCanvas

Matplotlib canvas widget for the actual plot.

MySlider

My Slider.

LithBound

Class to call up a dialog for lithological boundary.

PlotScale

Class to call up a dialog for plot axis scale.

RangedCopy

Class to call up a dialog for ranged copying.

MyToolbar

Custom Matplotlib toolbar.

GaugeWidget

Gauge widget.

ImportPicture

Import Picture dialog.

Functions#

gridmatch2(cgrv, rgrv)

Grid match.

rotate2d(pts, cntr[, ang])

Rotate 2D.

Module Contents#

class pygmi.pfmod.tab_prof.ProfileDisplay(parent=None)#

Bases: PyQt6.QtWidgets.QWidget

Widget class to call the main interface.

Parameters:

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

setupui()#

Set up UI.

Return type:

None.

cprof_add()#

Add new custom profile.

Return type:

None.

cprof_del()#

Delete current custom profile.

Return type:

None.

proftype_changed()#

Profile type changed.

Return type:

None.

custom_prof_limits(curprof=None)#

Calculate custom profile limits.

Parameters:

curprof (int or str, optional) – Current profile. The default is None.

Return type:

None.

hcprofnum()#

Change a profile from a horizontal slider.

Return type:

None.

scprofnum()#

Change a profile from a spinbox.

Return type:

None.

borehole_import()#

Import borehole data.

Return type:

None.

export_csv()#

Export profile to csv.

Return type:

None.

lbound()#

Insert a lithological boundary.

Return type:

None.

rcopy()#

Do a ranged copy on a profile.

Return type:

None.

rcopy_layer(rcopy)#

Do a ranged copy on a layer.

Parameters:

rcopy (RangedCopy) – Handle of ranged copy GUI.

Return type:

None.

rcopy_prof(rcopy)#

Ranged copy on a profile.

Parameters:

rcopy (RangedCopy) – Handle to RangedCopy GUI.

Return type:

None.

change_defs()#

Change definitions.

Return type:

None.

get_model()#

Get model slice.

Return type:

None.

hprofnum()#

Change a profile from a horizontal slider.

Return type:

None.

pic_sideview()#

Horizontal slider for picture opacity.

Change the opacity of profile and overlain picture.

Return type:

None.

plot_scale()#

Plot scale.

Return type:

None.

setwidth(width)#

Set the width of the edits on the profile view.

Parameters:

width (int) – Edit width.

Return type:

None.

sprofnum()#

Routine to change a profile from spinbox.

Return type:

None.

hlayer()#

Horizontal slider to change the layer.

Return type:

None.

pic_overview()#

Horizontal slider to change picture opacity.

Return type:

None.

pic_overview2()#

Horizontal slider to change picture opacity.

Return type:

None.

slayer()#

Change model layer.

Return type:

None.

calc_prof_limits(curprof=None)#

Calculate profile limits.

Parameters:

curprof (int or None, optional) – Current profile. The default is None.

Return type:

None.

prof_dir(slide=True)#

Profile direction.

Parameters:

slide (bool, optional) – Flag to redraw entire plot, or just update. The default is True.

Return type:

None.

sprofdir()#

Profile direction spinbox.

Return type:

None.

update_combo_overview(curtext=None)#

Update the overview combo.

Parameters:

curtext (str, optional) – Current text in combo. Default is None.

Return type:

None.

update_plot(slide=False)#

Update the profile on the model view.

Parameters:

slide (bool, optional) – Flag to redraw entire plot, or just update. The default is False.

Return type:

None.

tab_activate()#

Entry point.

Return type:

None.

class pygmi.pfmod.tab_prof.MyMplCanvas(parent=None)#

Bases: matplotlib.backends.backend_qtagg.FigureCanvasQTAgg

Matplotlib canvas widget for the actual plot.

Parameters:

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

button_press(event)#

Button press event.

Parameters:

event (event) – Event variable.

Return type:

None.

button_release(event)#

Button release event.

Parameters:

event (event) – Unused.

Return type:

None.

move(event)#

Mouse move event.

Parameters:

event (event) – Event variable.

Return type:

None.

set_mdata(xdata, ydata, mdata)#

Routine to ‘draw’ the line on mdata.

xdata and ydata are the cursor centre coordinates.

Parameters:
  • xdata (float) – X data.

  • ydata (float) – Y data.

  • mdata (numpy array) – Model array.

Return type:

None.

luttodat(dat)#

LUT to dat grid.

Parameters:

dat (numpy array) – Input data.

Returns:

tmp – dat grid.

Return type:

numpy array

on_resize(event)#

Resize event.

Used to make sure tight_layout happens on startup.

Parameters:

event (event) – Unused.

Return type:

None.

init_grid(dat, dat2=None, opac=0.0)#

Initialise grid.

Parameters:
  • dat (numpy array) – Raster dataset.

  • dat2 (pygmi.raster.datatypes.Data, optional) – PyGMI raster dataset. The default is None.

  • opac (float, optional) – Opacity between 0 and 100. The default is 0.0.

Return type:

None.

init_grid_top(dat2=None, opac=100.0)#

Initialise top grid.

Parameters:
  • dat2 (str, optional) – Combobox text. The default is None.

  • opac (float, optional) – Opacity between 0 and 100. The default is 100.0.

Return type:

None.

slide_grid(dat, dat2=None, opac=None)#

Slide grid.

Parameters:
  • dat (numpy array.) – Raster data array.

  • dat2 (numpy array, optional) – Raster data array. The default is None.

  • opac (float, optional) – Opacity between 0 and 100. The default is None.

Return type:

None.

slide_grid_top(opac=None)#

Slide top grid.

Parameters:

opac (float, optional) – Opacity between 0 and 100. The default is None.

Return type:

None.

update_line()#

Update the line position.

Return type:

None.

update_line_top()#

Update the top line position.

Return type:

None.

init_plot(xdat, dat, extent, xdat2=None, dat2=None)#

Initialise plot.

Parameters:
  • xdat (numpy array) – X coordinates.

  • dat (numpy array) – Data values.

  • extent (list) – Extent list.

  • xdat2 (numpy array, optional) – X coordinates. The default is None.

  • dat2 (numpy array, optional) – Data values. The default is None.

Return type:

None.

slide_plot(xdat, dat, xdat2=None, dat2=None)#

Slide plot.

Parameters:
  • xdat (numpy array) – X coordinates.

  • dat (numpy array) – Data values.

  • xdat2 (numpy array, optional) – X coordinates. The default is None.

  • dat2 (numpy array, optional) – Data values. The default is None.

Return type:

None.

class pygmi.pfmod.tab_prof.MySlider(parent=None)#

Bases: PyQt6.QtWidgets.QSlider

My Slider.

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

Parameters:

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

mousePressEvent(event)#

Mouse press event.

Parameters:

event (event) – Event variable.

Return type:

None.

mouseMoveEvent(event)#

Mouse move event.

Jump to pointer position while moving.

Parameters:

event (event) – Event variable.

Return type:

None.

class pygmi.pfmod.tab_prof.LithBound(lmod)#

Bases: PyQt6.QtWidgets.QDialog

Class to call up a dialog for lithological boundary.

Parameters:

lmod (pygmi.pfmod.datatypes.LithModel) – Reference to the lithology model.

setupui()#

Set up UI.

Return type:

None.

get_lith()#

Get lithology.

Returns:

  • lithlower (int) – Lower lithology index.

  • lithupper (int) – Upper lithology index.

class pygmi.pfmod.tab_prof.PlotScale(parent, lmod)#

Bases: PyQt6.QtWidgets.QDialog

Class to call up a dialog for plot axis scale.

Parameters:
  • parent (parent, optional) – Reference to the parent routine. The default is None.

  • lmod (pygmi.pfmod.datatypes.LithModel) – Reference to the lithology model.

setupui()#

Set up UI.

Return type:

None.

custom()#

Set custom radiobutton when limits are changed.

Return type:

None.

class pygmi.pfmod.tab_prof.RangedCopy(parent=None)#

Bases: PyQt6.QtWidgets.QDialog

Class to call up a dialog for ranged copying.

Parameters:

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

setupui()#

Set up UI.

Return type:

None.

target_update()#

Update target.

Return type:

None.

class pygmi.pfmod.tab_prof.MyToolbar(parent=None)#

Bases: matplotlib.backends.backend_qt.NavigationToolbar2QT

Custom Matplotlib toolbar.

Parameters:

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

axis_scale()#

Axis scale.

Return type:

None.

b_logs()#

Borehole logs.

Return type:

None.

mag_profile()#

View magnetic profile.

Return type:

None.

grv_profile()#

View gravity profile.

Return type:

None.

class pygmi.pfmod.tab_prof.GaugeWidget(*args, **kwargs)#

Bases: PyQt6.QtWidgets.QDial

Gauge widget.

paintEvent(event)#

Paint event.

Parameters:

event (event) – Event variable.

Return type:

None.

class pygmi.pfmod.tab_prof.ImportPicture(parent=None)#

Bases: pygmi.misc.BasicModule

Import Picture dialog.

Parameters:

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

setupui()#

Set up UI.

Return type:

None.

get_filename()#

Get filename of picture.

Return type:

None.

getcoords()#

Get coordinates.

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.pfmod.tab_prof.gridmatch2(cgrv, rgrv)#

Grid match.

Matches the rows and columns of the second grid to the first grid.

Parameters:
Returns:

Output data.

Return type:

numpy array

pygmi.pfmod.tab_prof.rotate2d(pts, cntr, ang=np.pi / 4)#

Rotate 2D.

Rotates points(nx2) about center cntr(2) by angle ang(1) in radians.

Parameters:
  • pts (numpy array) – Points to rotate.

  • cntr (numpy array) – Center of rotation.

  • ang (float, optional) – Angle to rotate in radians. The default is np.pi/4.

Returns:

pts2 – Rotated points.

Return type:

numpy array