pygmi.pfmod.pfmod_prof#
Profile display routines for 3D modelling.
Classes#
Class to call up a dialog for ranged copying. |
|
Widget class to call the main interface. |
|
Matplotlib canvas widget for the actual plot. |
|
My Slider. |
|
Class to call up a dialog for lithological boundary. |
|
Class to call up a dialog for plot axis scale. |
|
Custom Matplotlib toolbar. |
|
Gauge widget. |
|
Import Picture dialog. |
Functions#
|
Grid match. |
|
Rotate 2D. |
Module Contents#
- class pygmi.pfmod.pfmod_prof.RangedCopy(parent=None)#
Bases:
PySide6.QtWidgets.QDialogClass to call up a dialog for ranged copying.
- Parameters:
parent – Reference to the parent routine. The default is None.
- setupui()#
Set up UI.
- target_update()#
Update target.
- class pygmi.pfmod.pfmod_prof.ProfileDisplay(parent=None)#
Bases:
PySide6.QtWidgets.QWidgetWidget class to call the main interface.
- Parameters:
parent – Reference to the parent routine. The default is None.
- setupui()#
Set up UI.
- cprof_add()#
Add new custom profile.
- cprof_del()#
Delete current custom profile.
- proftype_changed()#
Profile type changed.
- custom_prof_limits(curprof=None)#
Calculate custom profile limits.
- Parameters:
curprof (int | str | None) – Current profile. The default is None.
- hcprofnum()#
Change a profile from a horizontal slider.
- scprofnum()#
Change a profile from a spinbox.
- borehole_import()#
Import borehole data.
- calculate_dip()#
Calculate dip.
- export_csv()#
Export profile to csv.
- lbound()#
Insert a lithological boundary.
- rcopy()#
Do a ranged copy on a profile.
- rcopy_layer(rcopy)#
Do a ranged copy on a layer.
- Parameters:
rcopy (RangedCopy) – Handle of ranged copy GUI.
- rcopy_prof(rcopy)#
Ranged copy on a profile.
- Parameters:
rcopy (RangedCopy) – Handle to RangedCopy GUI.
- change_defs()#
Change definitions.
- get_model()#
Get model slice.
- hprofnum()#
Change a profile from a horizontal slider.
- pic_sideview()#
Horizontal slider for picture opacity.
Change the opacity of profile and overlain picture.
- plot_scale()#
Plot scale.
- setwidth(width)#
Set the width of the edits on the profile view.
- Parameters:
width (int) – Edit width.
- sprofnum()#
Routine to change a profile from spinbox.
- hlayer()#
Horizontal slider to change the layer.
- pic_overview()#
Horizontal slider to change picture opacity.
- pic_overview2()#
Horizontal slider to change picture opacity.
- slayer()#
Change model layer.
- calc_prof_limits(curprof=None)#
Calculate profile limits.
- Parameters:
curprof (int | None) – Current profile number. The default is None.
- prof_dir(slide=True)#
Profile direction.
- Parameters:
slide (bool) – Flag to redraw entire plot, or just update. The default is True.
- sprofdir()#
Profile direction spinbox.
- update_combo_overview(curtext=None)#
Update the overview combo.
- Parameters:
curtext (str | None) – Current text in combo. Default is None.
- update_plot(slide=False)#
Update the profile on the model view.
- Parameters:
slide (bool) – Flag to redraw entire plot, or just update. The default is False.
- activate()#
Entry point.
- class pygmi.pfmod.pfmod_prof.MyMplCanvas(parent=None)#
Bases:
matplotlib.backends.backend_qtagg.FigureCanvasQTAggMatplotlib canvas widget for the actual plot.
- Parameters:
parent – Reference to the parent routine. The default is None.
- button_press(event)#
Button press event.
- Parameters:
event (matplotlib.backend_bases.MouseEvent) – Event variable.
- button_release(event)#
Button release event.
- Parameters:
event (matplotlib.backend_bases.MouseEvent) – Unused.
- move(event)#
Mouse move event.
- Parameters:
event (matplotlib.backend_bases.MouseEvent) – Event variable.
- dip(event)#
Calculate dip event.
- Parameters:
event (matplotlib.backend_bases.MouseEvent) – Event variable.
- 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.typing.NDArray) – Model array.
- luttodat(dat)#
LUT to dat grid.
- Parameters:
dat (numpy.typing.NDArray) – Input data.
- Returns:
dat grid.
- Return type:
ndarray
- on_resize(event)#
Resize event.
Used to make sure tight_layout happens on startup.
- Parameters:
event (matplotlib.backend_bases.ResizeEvent) – Unused.
- init_grid(dat, dat2=None, opac=0.0)#
Initialise grid.
- Parameters:
dat (numpy.typing.NDArray) – Raster dataset.
dat2 (pygmi.raster.datatypes.Data | None) – PyGMI raster dataset. The default is None.
opac (float) – Opacity between 0 and 100. The default is 0.0.
- init_grid_top(dat2=None, opac=100.0)#
Initialise top grid.
- Parameters:
dat2 (str | None) – Combobox text. The default is None.
opac (float) – Opacity between 0 and 100. The default is 100.0.
- slide_grid(dat, dat2=None, opac=None)#
Slide grid.
- Parameters:
dat (numpy.typing.NDArray) – Raster data array.
dat2 (numpy.typing.NDArray | None) – Raster data array. The default is None.
opac (float | None) – Opacity between 0 and 100. The default is None.
- slide_grid_top(opac=None)#
Slide top grid.
- Parameters:
opac (float | None) – Opacity between 0 and 100. The default is None.
- update_line()#
Update the line position.
- update_line_top()#
Update the top line position.
- init_plot(xdat, dat, extent, xdat2=None, dat2=None)#
Initialise profile line plot.
- Parameters:
xdat (numpy.typing.NDArray) – X coordinates.
dat (numpy.typing.NDArray) – Data values.
extent (list[float]) – Extent list.
xdat2 (numpy.typing.NDArray | None) – X coordinates. The default is None.
dat2 (numpy.typing.NDArray | None) – Data values. The default is None.
- slide_plot(xdat, dat, xdat2=None, dat2=None)#
Slide plot.
- Parameters:
xdat (numpy.typing.NDArray) – X coordinates.
dat (numpy.typing.NDArray) – Data values.
xdat2 (numpy.typing.NDArray | None) – X coordinates. The default is None.
dat2 (numpy.typing.NDArray | None) – Data values. The default is None.
- class pygmi.pfmod.pfmod_prof.MySlider(parent=None)#
Bases:
PySide6.QtWidgets.QSliderMy Slider.
Custom class which allows clicking on a horizontal slider bar with slider moving to click in a single step.
- Parameters:
parent – Reference to the parent routine. The default is None.
- mousePressEvent(event)#
Mouse press event.
- Parameters:
event (PySide6.QtWidgets.QGraphicsSceneMouseEvent) – Event variable.
- mouseMoveEvent(event)#
Mouse move event.
Jump to pointer position while moving.
- Parameters:
event (PySide6.QtWidgets.QGraphicsSceneMouseEvent) – Event variable.
- class pygmi.pfmod.pfmod_prof.LithBound(parent, lmod)#
Bases:
PySide6.QtWidgets.QDialogClass to call up a dialog for lithological boundary.
- Parameters:
parent – Reference to parent.
lmod (pygmi.pfmod.datatypes.LithModel) – Reference to the lithology model.
- setupui()#
Set up UI.
- get_lith()#
Get lithology.
- Returns:
lithlower (
int) – Lower lithology index.lithupper (
int) – Upper lithology index.
- Return type:
tuple[int, int]
- class pygmi.pfmod.pfmod_prof.PlotScale(parent, lmod)#
Bases:
PySide6.QtWidgets.QDialogClass to call up a dialog for plot axis scale.
- Parameters:
parent – Reference to the parent routine. The default is None.
lmod (pygmi.pfmod.datatypes.LithModel) – Reference to the lithology model.
- setupui()#
Set up UI.
- custom()#
Set custom radiobutton when limits are changed.
- class pygmi.pfmod.pfmod_prof.MyToolbar(parent=None)#
Bases:
matplotlib.backends.backend_qt.NavigationToolbar2QTCustom Matplotlib toolbar.
- Parameters:
parent – Reference to the parent routine. The default is None.
- dip()#
Calculate dip.
- axis_scale()#
Axis scale.
- b_logs()#
Borehole logs.
- mag_profile()#
View magnetic profile.
- grv_profile()#
View gravity profile.
- class pygmi.pfmod.pfmod_prof.GaugeWidget(*args, **kwargs)#
Bases:
PySide6.QtWidgets.QDialGauge widget.
- paintEvent(event)#
Paint event.
- Parameters:
event – Event variable.
- class pygmi.pfmod.pfmod_prof.ImportPicture(parent=None)#
Bases:
PySide6.QtWidgets.QDialogImport Picture dialog.
- Parameters:
parent – Reference to the parent routine. The default is None.
- setupui()#
Set up UI.
- get_filename()#
Get filename of picture.
- getcoords()#
Get coordinates.
- settings(nodialog=False)#
Entry point into item.
- Parameters:
nodialog (bool) – Run settings without a dialog. The default is False.
- Returns:
Current line if successful, None, otherwise.
- Return type:
intorNone
- saveproj()#
Save project data from class.
- pygmi.pfmod.pfmod_prof.gridmatch2(cgrv, rgrv)#
Grid match.
Matches the rows and columns of the second grid to the first grid.
- Parameters:
cgrv (
pygmi.raster.datatypes.Data.) – Raster dataset.rgrv (
pygmi.raster.datatypes.Data) – Raster dataset.
- Returns:
Output data.
- Return type:
numpy array
- pygmi.pfmod.pfmod_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.typing.NDArray) – Points to rotate.
cntr (numpy.typing.NDArray) – Center of rotation.
ang (float) – Angle to rotate in radians. The default is np.pi/4.
- Returns:
Rotated points.
- Return type:
ndarray