pygmi package¶
Subpackages¶
- pygmi.clust package
- Submodules
- pygmi.clust.cluster module
- pygmi.clust.crisp_clust module
- pygmi.clust.fuzzy_clust module
- pygmi.clust.graphs module
- pygmi.clust.graphtool module
GraphHist
GraphMap
PolygonInteractor
PolygonInteractor.button_press_callback()
PolygonInteractor.button_release_callback()
PolygonInteractor.draw_callback()
PolygonInteractor.epsilon
PolygonInteractor.get_ind_under_point()
PolygonInteractor.motion_notify_callback()
PolygonInteractor.new_poly()
PolygonInteractor.polyi_changed
PolygonInteractor.showverts
PolygonInteractor.update_plots()
ScatterPlot
ScatterPlot.on_cp_combo()
ScatterPlot.on_cp_combo2()
ScatterPlot.on_cp_combo3()
ScatterPlot.on_cp_dpoly()
ScatterPlot.on_map_combo()
ScatterPlot.on_map_combo2()
ScatterPlot.on_map_dpoly()
ScatterPlot.saveproj()
ScatterPlot.settings()
ScatterPlot.setupui()
ScatterPlot.update_hist()
ScatterPlot.update_map()
dist_point_to_segment()
- pygmi.clust.menu module
MenuWidget
MenuWidget.parent
MenuWidget.cluster()
MenuWidget.cluster_stats()
MenuWidget.crisp_cluster()
MenuWidget.export_data()
MenuWidget.fuzzy_cluster()
MenuWidget.scatter_plot()
MenuWidget.segmentation()
MenuWidget.show_membership_data()
MenuWidget.show_raster_data()
MenuWidget.show_vrc_etc()
MenuWidget.super_class()
- pygmi.clust.segmentation module
- pygmi.clust.super_class module
GraphMap
PolygonInteractor
PolygonInteractor.button_press_callback()
PolygonInteractor.button_release_callback()
PolygonInteractor.draw_callback()
PolygonInteractor.epsilon
PolygonInteractor.get_ind_under_point()
PolygonInteractor.motion_notify_callback()
PolygonInteractor.new_poly()
PolygonInteractor.polyi_changed
PolygonInteractor.showverts
PolygonInteractor.update_plots()
SuperClass
SuperClass.calc_metrics()
SuperClass.class_change()
SuperClass.init_classifier()
SuperClass.load_shape()
SuperClass.on_apoly()
SuperClass.on_combo()
SuperClass.on_dpoly()
SuperClass.oncellchange()
SuperClass.onrowchange()
SuperClass.save_shape()
SuperClass.saveproj()
SuperClass.settings()
SuperClass.setupui()
SuperClass.update_class_polys()
SuperClass.updatepoly()
dist_point_to_segment()
- pygmi.clust.var_ratio module
- Module contents
- pygmi.em package
- pygmi.grav package
- pygmi.mag package
- pygmi.mt package
- pygmi.pfmod package
- Submodules
- pygmi.pfmod.datatypes module
LithModel
LithModel.mlut
LithModel.numx
LithModel.numy
LithModel.numz
LithModel.dxy
LithModel.d_z
LithModel.lith_index
LithModel.xrange
LithModel.yrange
LithModel.zrange
LithModel.griddata
LithModel.custprofx
LithModel.custprofy
LithModel.profpics
LithModel.lith_list
LithModel.lith_list_reverse
LithModel.mht
LithModel.ght
LithModel.gregional
LithModel.dtm_to_lith()
LithModel.init_calc_grids()
LithModel.init_grid()
LithModel.is_modified()
LithModel.lithold_to_lith()
LithModel.update()
LithModel.update_lith_list_reverse()
LithModel.update_lithlist()
- pygmi.pfmod.grvmag3d module
- pygmi.pfmod.iodefs module
- pygmi.pfmod.menu module
- pygmi.pfmod.misc module
- pygmi.pfmod.mvis3d module
GLWidget
GLWidget.draw_with_axis()
GLWidget.initGeometry()
GLWidget.init_object()
GLWidget.init_projection()
GLWidget.initializeGL()
GLWidget.minimumSizeHint()
GLWidget.mouseMoveEvent()
GLWidget.mousePressEvent()
GLWidget.normalizeAngle()
GLWidget.paintGL()
GLWidget.print_string()
GLWidget.readPixels()
GLWidget.resizeGL()
GLWidget.setXRotation()
GLWidget.setYRotation()
GLWidget.setZRotation()
GLWidget.setlightdir()
GLWidget.sizeHint()
GLWidget.wheelEvent()
GetTables()
InterpolateVertices()
MarchingCubes()
Mod3dDisplay
Mod3dDisplay.change_defs()
Mod3dDisplay.data_init()
Mod3dDisplay.mod3d_vs()
Mod3dDisplay.resetlight()
Mod3dDisplay.run()
Mod3dDisplay.save()
Mod3dDisplay.set_selected_liths()
Mod3dDisplay.setupui()
Mod3dDisplay.sunclick()
Mod3dDisplay.update_color()
Mod3dDisplay.update_for_kmz()
Mod3dDisplay.update_model()
Mod3dDisplay.update_model2()
Mod3dDisplay.update_plot()
MySunCanvas
bitget()
bitset()
calc_norms()
fancyindex()
ind2sub()
normalize_v3()
sub2ind()
- pygmi.pfmod.pfinvert module
MagInvert
MagInvert.acceptall()
MagInvert.apply_changes()
MagInvert.choose_combo()
MagInvert.choose_dtm()
MagInvert.choose_model()
MagInvert.extgrid()
MagInvert.get_area()
MagInvert.init()
MagInvert.saveproj()
MagInvert.settings()
MagInvert.setupui()
MagInvert.upd_layers()
MagInvert.update_combos()
MagInvert.update_model_combos()
MagInvert.update_vals()
MagInvert.xycell()
MagInvert.zcell()
- pygmi.pfmod.pfmod module
- pygmi.pfmod.show_table module
- pygmi.pfmod.tab_mext module
MextDisplay
MextDisplay.apply_changes()
MextDisplay.choose_combo()
MextDisplay.choose_dtm()
MextDisplay.choose_model()
MextDisplay.extgrid()
MextDisplay.get_area()
MextDisplay.init()
MextDisplay.setupui()
MextDisplay.tab_activate()
MextDisplay.upd_layers()
MextDisplay.update_combos()
MextDisplay.update_model_combos()
MextDisplay.update_vals()
MextDisplay.xycell()
MextDisplay.zcell()
- pygmi.pfmod.tab_param module
LithNotes
MergeLith
ParamDisplay
ParamDisplay.add_def()
ParamDisplay.add_defs()
ParamDisplay.apply_changes()
ParamDisplay.apply_lith()
ParamDisplay.change_defs()
ParamDisplay.change_magnetization()
ParamDisplay.change_qratio()
ParamDisplay.change_rmi()
ParamDisplay.connect_spin()
ParamDisplay.disconnect_spin()
ParamDisplay.get_lith()
ParamDisplay.init()
ParamDisplay.lw_color_change()
ParamDisplay.lw_index_change()
ParamDisplay.merge_defs()
ParamDisplay.rem_defs()
ParamDisplay.rename_defs()
ParamDisplay.set_lw_colors()
ParamDisplay.setupui()
ParamDisplay.tab_activate()
- pygmi.pfmod.tab_prof module
GaugeWidget
ImportPicture
LithBound
MyMplCanvas
MyMplCanvas.button_press()
MyMplCanvas.button_release()
MyMplCanvas.init_grid()
MyMplCanvas.init_grid_top()
MyMplCanvas.init_plot()
MyMplCanvas.luttodat()
MyMplCanvas.move()
MyMplCanvas.on_resize()
MyMplCanvas.set_mdata()
MyMplCanvas.slide_grid()
MyMplCanvas.slide_grid_top()
MyMplCanvas.slide_plot()
MyMplCanvas.update_line()
MyMplCanvas.update_line_top()
MySlider
MyToolbar
PlotScale
ProfileDisplay
ProfileDisplay.borehole_import()
ProfileDisplay.calc_prof_limits()
ProfileDisplay.change_defs()
ProfileDisplay.cprof_add()
ProfileDisplay.cprof_del()
ProfileDisplay.custom_prof_limits()
ProfileDisplay.export_csv()
ProfileDisplay.get_model()
ProfileDisplay.hcprofnum()
ProfileDisplay.hlayer()
ProfileDisplay.hprofnum()
ProfileDisplay.lbound()
ProfileDisplay.pic_overview()
ProfileDisplay.pic_overview2()
ProfileDisplay.pic_sideview()
ProfileDisplay.plot_scale()
ProfileDisplay.prof_dir()
ProfileDisplay.proftype_changed()
ProfileDisplay.rcopy()
ProfileDisplay.rcopy_layer()
ProfileDisplay.rcopy_prof()
ProfileDisplay.scprofnum()
ProfileDisplay.setupui()
ProfileDisplay.setwidth()
ProfileDisplay.slayer()
ProfileDisplay.sprofdir()
ProfileDisplay.sprofnum()
ProfileDisplay.tab_activate()
ProfileDisplay.update_plot()
RangedCopy
gridmatch2()
rotate2d()
- Module contents
- pygmi.raster package
- Submodules
- pygmi.raster.anaglyph module
- pygmi.raster.cooper module
- pygmi.raster.dataprep module
Continuation
DataCut
DataLayerStack
DataMerge
DataReproj
GetProf
GroupProj
Metadata
check_dataid()
cluster_to_raster()
cut_raster()
data_reproject()
fft_getkxy()
fftcont()
fftprep()
get_shape_bounds()
getepsgcodes()
lstack()
merge_max()
merge_median()
merge_min()
redistribute_vertices()
taylorcont()
trim_raster()
verticalp()
- pygmi.raster.datatypes module
- pygmi.raster.equation_editor module
- pygmi.raster.ginterp module
MyMplCanvas
MyMplCanvas.htype
MyMplCanvas.hstype
MyMplCanvas.cbar
MyMplCanvas.data
MyMplCanvas.sdata
MyMplCanvas.gmode
MyMplCanvas.argb
MyMplCanvas.hhist
MyMplCanvas.hband
MyMplCanvas.htxt
MyMplCanvas.image
MyMplCanvas.cnt
MyMplCanvas.cntf
MyMplCanvas.background
MyMplCanvas.bbox_hist_red
MyMplCanvas.bbox_hist_green
MyMplCanvas.bbox_hist_blue
MyMplCanvas.axes
MyMplCanvas.pinit
MyMplCanvas.qinit
MyMplCanvas.phi
MyMplCanvas.theta
MyMplCanvas.cell
MyMplCanvas.alpha
MyMplCanvas.kval
MyMplCanvas.init_graph()
MyMplCanvas.move()
MyMplCanvas.revent()
MyMplCanvas.update_contour()
MyMplCanvas.update_graph()
MyMplCanvas.update_hist_rgb()
MyMplCanvas.update_hist_single()
MyMplCanvas.update_hist_text()
MyMplCanvas.update_rgb()
MyMplCanvas.update_shade()
MyMplCanvas.update_shade_plot()
MyMplCanvas.update_single_color_map()
MySunCanvas
PlotInterp
PlotInterp.self.mmc
PlotInterp.self.msc
PlotInterp.change_allclip()
PlotInterp.change_blue()
PlotInterp.change_cbar()
PlotInterp.change_clipband()
PlotInterp.change_dtype()
PlotInterp.change_green()
PlotInterp.change_htype()
PlotInterp.change_kval()
PlotInterp.change_lclip()
PlotInterp.change_red()
PlotInterp.change_sun()
PlotInterp.change_sun_checkbox()
PlotInterp.change_sunsliders()
PlotInterp.data_init()
PlotInterp.move()
PlotInterp.run()
PlotInterp.save_img()
PlotInterp.saveproj()
PlotInterp.settings()
PlotInterp.setupui()
- pygmi.raster.graphs module
- pygmi.raster.iodefs module
- pygmi.raster.menu module
MenuWidget
MenuWidget.parent
MenuWidget.agc()
MenuWidget.bandselect()
MenuWidget.basic_stats()
MenuWidget.cont()
MenuWidget.cut_data()
MenuWidget.equation_editor()
MenuWidget.export_data()
MenuWidget.get_prof()
MenuWidget.gradients()
MenuWidget.import_data()
MenuWidget.import_rgb_data()
MenuWidget.lstack()
MenuWidget.merge()
MenuWidget.metadata()
MenuWidget.norm_data()
MenuWidget.raster_interp()
MenuWidget.reproj()
MenuWidget.show_anaglyph()
MenuWidget.show_ccoef()
MenuWidget.show_histogram()
MenuWidget.show_raster_data()
MenuWidget.show_raster_data2()
MenuWidget.show_scatter_plot()
MenuWidget.show_surface()
MenuWidget.smoothing()
MenuWidget.visibility()
- pygmi.raster.misc module
- pygmi.raster.modest_image module
ModestImage
ModestImage.draw()
ModestImage.draw_sunshade()
ModestImage.draw_ternary()
ModestImage.format_cursor_data()
ModestImage.get_array()
ModestImage.get_cursor_data()
ModestImage.invalidate_cache()
ModestImage.set()
ModestImage.set_clim_std()
ModestImage.set_data()
ModestImage.set_extent()
ModestImage.set_shade()
extract_matched_slices()
imshow()
- pygmi.raster.modest_ioimage module
ModestImage
ModestImage.draw()
ModestImage.draw_sunshade()
ModestImage.draw_ternary()
ModestImage.format_cursor_data()
ModestImage.get_array()
ModestImage.get_cursor_data()
ModestImage.invalidate_cache()
ModestImage.set()
ModestImage.set_clim_std()
ModestImage.set_data()
ModestImage.set_extent()
ModestImage.set_shade()
extract_matched_slices()
imshow()
- pygmi.raster.normalisation module
- pygmi.raster.show_table module
- pygmi.raster.smooth module
- Module contents
- pygmi.rsense package
- Submodules
- pygmi.rsense.change module
- pygmi.rsense.change_viewer module
- pygmi.rsense.emit module
- pygmi.rsense.features module
- pygmi.rsense.hyperspec module
- pygmi.rsense.iodefs module
ExportBatch
ImportBatch
ImportData
ImportSentinel5P
calculate_toa()
consolidate_aster_list()
convert_ll_to_utm()
etree_to_dict()
export_batch()
get_aster_ged()
get_aster_ged_bin()
get_aster_hdf()
get_aster_zip()
get_data()
get_emit()
get_from_rastermeta()
get_hyperion()
get_landsat()
get_modisv6()
get_sentinel1()
get_sentinel2()
get_spot()
get_ternary()
get_worldview()
set_export_filename()
utm_to_south()
- pygmi.rsense.landsat_composite module
- pygmi.rsense.menu module
MenuWidget
MenuWidget.parent
MenuWidget.anal_spec()
MenuWidget.batch_list()
MenuWidget.calc_change()
MenuWidget.calc_ci()
MenuWidget.calc_ratios()
MenuWidget.exportlist()
MenuWidget.import_sat()
MenuWidget.import_sentinel5p()
MenuWidget.lsat_comp()
MenuWidget.mnf()
MenuWidget.pca()
MenuWidget.proc_features()
MenuWidget.view_change()
- pygmi.rsense.ratios module
- pygmi.rsense.transforms module
- Module contents
- pygmi.seis package
- Submodules
- pygmi.seis.beachball module
- pygmi.seis.datatypes module
- pygmi.seis.del_rec module
- pygmi.seis.graphs module
- pygmi.seis.iodefs module
ExportCSV
ExportCSV.run()
ExportCSV.write_record_type_1()
ExportCSV.write_record_type_2()
ExportCSV.write_record_type_3()
ExportCSV.write_record_type_4()
ExportCSV.write_record_type_5()
ExportCSV.write_record_type_6()
ExportCSV.write_record_type_7()
ExportCSV.write_record_type_e()
ExportCSV.write_record_type_f()
ExportCSV.write_record_type_h()
ExportCSV.write_record_type_i()
ExportCSV.write_record_type_m()
ExportCSV.write_record_type_p()
ExportSeisan
ExportSeisan.run()
ExportSeisan.write_record_type_1()
ExportSeisan.write_record_type_2()
ExportSeisan.write_record_type_3()
ExportSeisan.write_record_type_4()
ExportSeisan.write_record_type_5()
ExportSeisan.write_record_type_6()
ExportSeisan.write_record_type_7()
ExportSeisan.write_record_type_e()
ExportSeisan.write_record_type_f()
ExportSeisan.write_record_type_h()
ExportSeisan.write_record_type_i()
ExportSeisan.write_record_type_m()
ExportSeisan.write_record_type_p()
ExportSeisan.write_record_type_phase()
ExportSummary
FilterSeisan
ImportGenericFPS
ImportSeisan
importmacro()
importnordic()
importseiscomp()
mercalli()
merge_m()
read_record_type_1()
read_record_type_2()
read_record_type_3()
read_record_type_4()
read_record_type_5()
read_record_type_6()
read_record_type_e()
read_record_type_f()
read_record_type_h()
read_record_type_i()
read_record_type_m()
read_record_type_p()
read_record_type_phase()
sform()
str2float()
str2int()
xlstomacro()
- pygmi.seis.menu module
MenuWidget
MenuWidget.parent
MenuWidget.beachball()
MenuWidget.correct_desc()
MenuWidget.delete_recs()
MenuWidget.export_csv()
MenuWidget.export_seisan()
MenuWidget.filter_seisan()
MenuWidget.import_genfps()
MenuWidget.import_seisan()
MenuWidget.quarry()
MenuWidget.sexport()
MenuWidget.show_QC_plots()
MenuWidget.show_iso_plots()
- pygmi.seis.utils module
- Module contents
- pygmi.test package
- Submodules
- pygmi.test.test_cluster module
- pygmi.test.test_gravity module
- pygmi.test.test_mag module
- pygmi.test.test_pfmod module
- pygmi.test.test_raster module
smalldata()
test_agc()
test_aspect()
test_check_dataid()
test_corr2d()
test_dratio()
test_equation()
test_gradients()
test_histcomp()
test_histeq()
test_hmode()
test_img2rgb()
test_io_ascii()
test_io_rasterio()
test_io_xyz()
test_norm()
test_norm255()
test_normalisation()
test_shader()
test_smooth()
test_thgrad()
test_trimraster()
test_vertical()
test_viz()
- Module contents
- pygmi.vector package
- Submodules
- pygmi.vector.dataprep module
- pygmi.vector.graphs module
GraphWindow
MyMplCanvas
MyMplCanvas.button_release_callback()
MyMplCanvas.format_coord()
MyMplCanvas.motion_notify_callback()
MyMplCanvas.onpick()
MyMplCanvas.resizeline()
MyMplCanvas.textresize()
MyMplCanvas.update_ccoef()
MyMplCanvas.update_hist()
MyMplCanvas.update_lines()
MyMplCanvas.update_lmap()
MyMplCanvas.update_rose()
MyMplCanvas.update_vector()
PlotCCoef
PlotHist
PlotLineMap
PlotLines
PlotRose
PlotVector
annotate_heatmap()
heatmap()
histogram()
rotate()
- pygmi.vector.iodefs module
- pygmi.vector.menu module
MenuWidget
MenuWidget.parent
MenuWidget.basic_stats()
MenuWidget.colselect()
MenuWidget.cut_data()
MenuWidget.export_vector()
MenuWidget.export_xyz()
MenuWidget.file_split()
MenuWidget.grid()
MenuWidget.import_vector()
MenuWidget.import_xyz()
MenuWidget.metadata()
MenuWidget.plot_ccoef()
MenuWidget.reproject()
MenuWidget.scomp()
MenuWidget.show_hist()
MenuWidget.show_line_data()
MenuWidget.show_line_map()
MenuWidget.show_rose_diagram()
MenuWidget.show_vector_data()
- pygmi.vector.minc module
- pygmi.vector.show_table module
- pygmi.vector.structure module
- Module contents
Submodules¶
pygmi.main module¶
Main module for PyGMI.
This module comprises a series of classes which are responsible for the primary interface to the software. Credit must go to PyQt’s examples, upon which some of this was originally based.
Although the main interface is controlled here, the content of the menus and routines is not. The menus and corresponding classes are found within the pygmi packages.
- class pygmi.main.Arrow(start_item, end_item, parent=None)¶
Bases:
QGraphicsLineItem
Class responsible for drawing arrows on the main interface.
- arrow_head¶
Arrow head polygon.
- Type:
QPolygonF
- my_start_item¶
Starting DiagramItem object. This will send information to my_end_item
- Type:
- my_end_item¶
End DiagramItem object. This will get information from my_start_item
- Type:
- my_color¶
Color
- Type:
QtCore colour (default is QtCore.Qt.black)
- boundingRect()¶
Bounding Rectangle.
Overloaded bounding rectangle. This is necessary to ensure that the line and arrowhead are cleaned properly when moving.
- Returns:
tmp
- Return type:
QtCore.QRectF
- paint(painter, option, widget=None)¶
Overloaded paint method.
- Parameters:
painter (QPainter)
option (QStyleOptionGraphicsItem)
widget (QWidget, optional)
- class pygmi.main.DiagramItem(diagram_type, context_menu, my_class, parent)¶
Bases:
QGraphicsPolygonItem
Diagram Item.
- arrows¶
list of Arrow objects
- Type:
list
- diagram_type¶
string denoting the diagram type. Can be ‘StartEnd’, ‘Conditional’ or ‘Step’
- Type:
str
- context_menu = context_menu
- my_class¶
Class that the diagram item is linked to.
- Type:
object
- text_item¶
- Type:
None
- my_class_name¶
Class name being referenced
- Type:
str
- contextMenuEvent(event)¶
Overloaded context menu event.
- Parameters:
event (N/A)
- mouseDoubleClickEvent(event)¶
Mouse double click event.
This event is used to activate an item. It does this by calling the settings() method of the item. The event also changes the colour of the item to reflect whether it is busy working.
- remove_arrows()¶
Remove Arrows. Uses the remove_arrow method.
- settings(nodialog=False)¶
Routine Settings.
- Parameters:
nodialog (bool, optional) – Run settings without a dialog. The default is False.
- Returns:
iflag – Returns a boolean reflecting success of the my_class.settings() method.
- Return type:
bool
- update_indata()¶
Routine to add datasets.
- class pygmi.main.DiagramScene(item_menu, parent=None)¶
Bases:
QGraphicsScene
Diagram Scene.
- mouseMoveEvent(mouse_event)¶
Overloaded Mouse Move Event.
- Parameters:
mouse_event (QGraphicsSceneMouseEvent) – mouse event.
- mousePressEvent(mouse_event)¶
Overloaded Mouse Press Event.
- Parameters:
mouse_event (QGraphicsSceneMouseEvent) – mouse event.
- mouseReleaseEvent(mouse_event)¶
Overloaded Mouse Release Event.
- Parameters:
mouse_event (QGraphicsSceneMouseEvent) – mouse event.
- selected_item_info()¶
Display info about selected item.
- class pygmi.main.MainWidget(parent=None, nocgs=True)¶
Bases:
QMainWindow
Widget class to call the main interface.
- pdlg¶
- Type:
list
- Type:
dictionary
- add_to_context(txt)¶
Add to a context menu.
Each dataset type which PyGMI uses can have its own context menu. This method allows for the definition of each group of context menu items under a user defined text label.
- Parameters:
txt (str) – Label for a group of context menu items
- bring_to_front()¶
Bring the selected item to front.
- clearprocesslog()¶
Clear the process log.
- delete_item()¶
Delete the selected item from main interface.
- get_indata()¶
Get input data from the selected item on the main interface.
- Returns:
idata – Input list of PyGMI Data
- Return type:
list of PyGMI Data
- get_outdata()¶
Get output data from the selected item on the main interface.
- Returns:
odata – Output list of PyGMI Data
- Return type:
list of PyGMI Data
- help_docs()¶
Help Routine.
- item_insert(item_type, item_name, class_name, projimport=False, **kwargs)¶
Item insert.
Insert an item on the main interface. The item is an object passed by one of the menu.py routines and is one of the algorithms chosen on the main PyGMI menu.
- Parameters:
item_type (str) – str describing the shape of the graphic used to describe the item.
item_name (str) – str describing the name of the item to be displayed.
class_name (object) – class to be called when double clicking on the item.
- Returns:
item – Return a DiagramItem object
- Return type:
- keyPressEvent(event)¶
Intercept key press for custom key presses.
- Parameters:
event (QKeyEvent) – Key press event object.
- Return type:
None.
- launch_context_item(newitem)¶
Launch a context menu item, using output data.
- Parameters:
newitem (custom class) – newitem is the class to be called by the context menu item
- launch_context_item_indata(newitem)¶
Launch a context menu item, using input data.
- Parameters:
newitem (custom class) – newitem is the class to be called by the context menu item
- linepointer()¶
Select line pointer.
- load()¶
Load project state from JSON file.
- Return type:
None.
- pointer()¶
Select pointer.
- process_is_active(isactive=True)¶
Change process log colour when a process is active.
- Parameters:
isactive (bool, optional) – boolean variable indicating if a process is active.
- run()¶
Run entire script.
- Return type:
None.
- save()¶
Save project state to a JSON file.
- Return type:
None.
- send_to_back()¶
Send the selected item to the back.
- setupui()¶
Set up UI.
- Return type:
None.
- showdatainfo(txt)¶
Show text in the dataset information panel.
- Parameters:
txt (str) – Message to be displayed in the datainfo panel
- showlog(txt, replacelast=False)¶
Show text on the process log.
- Parameters:
txt (str) – Message to be displayed in the process log
replacelast (bool, optional) – flag to indicate whether the last row on the log should be overwritten.
- update_pdlg(dlg)¶
Clean deleted objects in self.pdlg and appends a new object.
self.pdlg allows for modeless dialogues to remain in existence until they are closed
- Parameters:
dlg (object) – Object to be appended to self.pdlg
- class pygmi.main.Startup(pbarmax, parent=None)¶
Bases:
QDialog
Class to provide a startup display while PyGMI loads into memory.
- update()¶
Update the text on the dialog.
- pygmi.main.main(nocgs=False)¶
Entry point for the PyGMI software.
pygmi.misc module¶
Misc is a collection of routines which can be used in PyGMI in general.
- class pygmi.misc.BasicModule(parent=None)¶
Bases:
QDialog
Basic Module.
- parent¶
reference to the parent routine
- Type:
parent
- indata¶
dictionary of input datasets
- Type:
dictionary
- outdata¶
dictionary of output datasets
- Type:
dictionary
- ifile¶
input file, used in IO routines and to pass filename back to main.py
- Type:
str
- piter¶
reference to a progress bar iterator.
- Type:
function
- pbar¶
reference to a progress bar.
- Type:
function
- showlog¶
reference to a way to view messages, normally stdout or a Qt text box.
- Type:
stdout or alternative
- is_import¶
used to indicate whether a routine contains an import within.
- Type:
bool
- projdata¶
Project data.
- Type:
dictionary
- data_init()¶
Initialise Data.
Entry point into routine. This entry point exists for the case where data must be initialised before entering at the standard ‘settings’ sub module.
- Return type:
None.
- loadproj(projdata)¶
Load project data into class.
- Parameters:
projdata (dictionary) – Project data loaded from JSON project file.
- Returns:
chk – A check to see if settings was successfully run.
- Return type:
bool
- saveobj(obj)¶
Save an object to a dictionary.
This is a convenience function for saving project information.
- Parameters:
obj (variable) – A variable to be saved.
- 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.misc.ContextModule(parent=None)¶
Bases:
QDialog
Context Module.
- parent¶
reference to the parent routine
- Type:
parent
- indata¶
dictionary of input datasets
- Type:
dictionary
- outdata¶
dictionary of output datasets
- Type:
dictionary
- piter¶
reference to a progress bar iterator.
- Type:
function
- pbar¶
reference to a progress bar.
- Type:
function
- showlog¶
reference to a way to view messages, normally stdout or a Qt text box.
- Type:
stdout or alternative
- run()¶
Run context menu item.
- Return type:
None.
- class pygmi.misc.EmittingStream(textWritten)¶
Bases:
QObject
Class to intercept stdout for later use in a textbox.
- fileno()¶
File number.
- Returns:
Returns -1.
- Return type:
int
- flush()¶
Flush.
- Return type:
None.
- write(text)¶
Write text.
- Parameters:
text (str) – Text to write.
- Return type:
None.
- class pygmi.misc.PTime¶
Bases:
object
PTime class.
Main class in the ptimer module. Once activated, this class keeps track of all time since activation. Times are stored whenever its methods are called.
- tchk¶
List of times generated by the time.perf_counter routine.
- Type:
list
- since_first_call(msg='since first call', show=True)¶
Time lapsed since first call.
This function prints out a message and lets you know the time passed since the first call.
- Parameters:
msg (str) – Optional message
- since_last_call(msg='since last call', show=True)¶
Time lapsed since last call.
This function prints out a message and lets you know the time passed since the last call.
- Parameters:
msg (str) – Optional message
- class pygmi.misc.ProgressBar(parent=None)¶
Bases:
QProgressBar
Progress bar.
Progress Bar routine which expands the QProgressBar class slightly so that there is a time function as well as a convenient of calling it via an iterable.
- otime¶
This is the original time recorded when the progress bar starts.
- Type:
integer
- iter(iterable)¶
Iterate Routine.
- to_max()¶
Set the progress to maximum.
- class pygmi.misc.ProgressBarText¶
Bases:
object
Text Progress bar.
- iter(iterable)¶
Iterate Routine.
- printprogressbar(iteration, suffix='')¶
Call in a loop to create terminal progress bar.
Code by Alexander Veysov. (https://gist.github.com/snakers4).
- Parameters:
iteration (int) – current iteration
suffix (str, optional) – Suffix string. The default is ‘’.
- Return type:
None.
- to_max()¶
Set the progress to maximum.
- class pygmi.misc.QVStack2Layout(parent=None)¶
Bases:
QGridLayout
QVStack2Layout.
This works like VBoxLayout, except each row takes two widgets.
- addWidget(widget1, widget2)¶
Add two widgets on a row, widget can also be text.
- Parameters:
widget1 (str or QWidget) – First Widget or Label on the row.
widget2 (QWidget) – Last Widget.
- Return type:
None.
- addWidgetOld(*args, **kwargs)¶
Original Add Widget.
- pygmi.misc.discrete_colorbar(axes, csp, cdat, lbls=None)¶
Plot colour bar using discrete colours for a small range of values.
- Parameters:
axes (Matplotlib axes) – Current axes.
csp (Plot routine) – Handle to Matplotlib plotting routine.
cdat (numpy array) – Array of values.
lbls (y tick labels (optional))
- Return type:
None.
- pygmi.misc.getinfo(txt=None, reset=False)¶
Get time and memory info.
- Parameters:
txt (str/int/float, optional) – Descriptor used for headings. The default is None.
reset (bool) – Flag used to reset the time difference to zero.
- Return type:
None.
- pygmi.misc.textwrap2(text, width, placeholder='...', max_lines=None)¶
Provide slightly different placeholder functionality to textwrap.
Placeholders will be a part of last line, instead of replacing it.
- Parameters:
text (str) – Text to wrap.
width (int) – Maximum line length.
placeholder (sre, optional) – Placeholder when lines exceed max_lines. The default is ‘…’.
max_lines (int, optional) – Maximum number of lines. The default is None.
- Returns:
text2 – Output wrapped text.
- Return type:
str
- pygmi.misc.tick_formatter(x, pos)¶
Format thousands separator in ticks for plots.
- Parameters:
x (float/int) – Number to be formatted.
pos (int) – Position of tick.
- Returns:
newx – Formatted coordinate.
- Return type:
str
pygmi.version module¶
Module contents¶
PyGMI stands for Python Geoscience Modelling and Interpretation.
It is a modelling and interpretation suite aimed at magnetic, gravity and other datasets. It includes:
Magnetic and Gravity 3D forward modelling
Remote sensing tools.
Cluster Analysis
Routines for cutting, reprojecting and doing simple modifications to data
Convenient display of data using pseudo-color, ternary and sunshading
It is released under the Gnu General Public License version 3.0