GXSEMPLOT class¶
- class GXSEMPLOT(handle=0)[source]¶
GXSEMPLOT class.
Oasis montaj implementation of RTE
GXSEMPLOT
- classmethod apply_filter_to_mask(db, filter, mask_ch, mineral_ch, mineral, mode)[source]¶
Apply the filter to the mask channel
- Parameters:
db (GXDB) – Database handle
filter (str) – Filter name
mask_ch (str) – Mask channel name
mineral_ch (str) – Mineral channel name
mineral (str) – Mineral to use (“All” or “” for all)
mode (int) – Mask mode (0: Append, 1: New)
New in version 6.2.
License: Geosoft Extended End-User License
Note: The mask channel is updated for the current data to reflect the actions of the filter. Those values passing get 1, those failing get 0.
- classmethod convert_dummies(db, line)[source]¶
Convert dummies to zero values for assay channels.
- Parameters:
db (GXDB) – Database handle
line (int) – Input line to convert
New in version 6.2.
License: Geosoft Extended End-User License
Note: The is operation is controlled by the Preferences “Use dummies to indicate no data?” By default, this option is “yes” so this function will return with no changes. However, if “no”, then all ASSAY class channels will have dummy values converted to 0.0.
- classmethod create_ascii_template(name, temp)[source]¶
: Generate ASCII import template automatically
- Parameters:
name (str) – Data file name
temp (str) – Template to make
- Returns:
1 if it succeeds in creating a Template. 0 if it fails.
- Return type:
int
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod create_database_template(name, temp)[source]¶
Generate database import template automatically
- Parameters:
name (str) – Data file name
temp (str) – Template to make
- Returns:
1 if it succeeds in creating a Template. 0 if it fails.
- Return type:
int
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod create_groups(db, mask_ch)[source]¶
Group data by anomaly or string channel - Interactive.
- Parameters:
db (GXDB) – Database handle
mask_ch (str) – Mask channel
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod default_groups(db)[source]¶
Group data by selected anomalies.
- Parameters:
db (GXDB) – Database handle
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod edit_filter(db, filter, mask_ch, mineral_ch, mineral)[source]¶
Edit and create filter on channel values
- Parameters:
db (GXDB) – Database handle
filter (str) – Name of filter
mask_ch (str) – Mask channel name
mineral_ch (str) – Mineral channel name
mineral (str) – Mineral to restrict filter to.
- Returns:
-1 - Cancel - Edits to filter discarded.
0 - Normal Return. Edits saved to filter file.
1 - Apply filter to current data only
- 2 - Remove filter - If removing filtered data, just
restore the data to the Min/Pos data otherwise set the mask channel to 1.
Re-entry code. If not
iDUMMY
, what to do inside the filter after going back in. Returned on exit, used on next input.0 - Nothing. Don’t need to go back into this function again. 1 - Edit the filter.
- Notes New and edited filters are stored in useretc in files with
the file extension “.semfilter” If a file for the specified filter does not exist, then a new filter by that name will be created.
- Return type:
int
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod edit_map_plot_parameters(db, mask_ch, mineral_ch, map, view)[source]¶
Alter parameters in an XYplot Triplot map.
- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
Note: The Parameters
GXGUI
is loaded based on settings stored in the map. The map is then re-plotted, overwriting the old one, based on the new settings. Note that the selection of data in the currentGXDB
is used to replot the map.
- classmethod edit_plot_components(db, templ)[source]¶
Set group names and channels to plot in a template.
- Parameters:
db (GXDB) – Database handle
templ (str) – Template name
New in version 6.2.
License: Geosoft Extended End-User License
Note: The “Components” group in the INI file is edited.
Looks first in useretc, then in etc. Looks first for file prefix “semtemplate” then “xyt” or “tri” The altered template will be output to the useretc directory with the file extension “semtemplate”.
- classmethod edit_plot_parameters(db, templ)[source]¶
Set TriPlot parameters in a template.
- Parameters:
db (GXDB) – Database handle
templ (str) – Template name
New in version 6.2.
License: Geosoft Extended End-User License
Note: The “Parameters” group in the INI file is edited.
Looks first in useretc, then in etc. Looks first for file prefix “semtemplate” then “xyt” or “tri” The altered template will be output to the useretc directory with the file extension “semtemplate”.
- classmethod export_overlay(overlay, map, mview, group, plot_type, x_stage, x_oxide, y_stage, y_oxide, z_stage, z_oxide, extension)[source]¶
Create overlay map and file from a group.
- Parameters:
overlay (str) – Overlay file name
map (str) – Associated map
mview (GXMVIEW) – View with group
group (str) – Group name
plot_type (int) – SEMPLOT_PLOT constants
x_stage (str) – XStage
x_oxide (str) – XOxide
y_stage (str) – YStage
y_oxide (str) – YOxide
z_stage (str) – ZStage
z_oxide (str) – ZOxide
extension (int) – SEMPLOT_EXT constants
New in version 6.2.
License: Geosoft Extended End-User License
Note: The group is written to a new map, and an overlay file is created which points to this map.
- classmethod export_view(db, lst, new_db, view, mask_ch, mineral_ch, mineral)[source]¶
Create a “View” database
- Parameters:
db (GXDB) – Original raw data database
lst (GXLST) – List of lines (anomlies) to export
new_db (GXDB) – Destination database
view (int) – View to export - One of SEMPLOT_XXX_STAGE
mask_ch (str) – Mask channel (”” for None)
mineral_ch (str) – Mineral channel
mineral (str) – Mineral to export (”” for all)
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod export_view2(db, lst, new_db, view, mask_ch, mineral_ch, mineral, export_extra)[source]¶
Create a “View” database, with channel selection
- Parameters:
db (GXDB) – Original raw data database
lst (GXLST) – List of lines (anomlies) to export
new_db (GXDB) – Destination database
view (int) – View to export - One of SEMPLOT_XXX_STAGE
mask_ch (str) – Mask channel (”” for None)
mineral_ch (str) – Mineral channel
mineral (str) – Mineral to export (”” for all)
export_extra (int) – SEMPLOT_EXPORT constants Channel selection
New in version 7.1.
License: Geosoft Extended End-User License
- classmethod filter_lst(lst)[source]¶
Fill a
GXLST
with existingGXSEMPLOT
filtersNew in version 6.2.
License: Geosoft Extended End-User License
Note: “Supplied” filters are stored in etc, while user-edited and new filters are stored in useretc. This function finds all files with the extension “.semfilter”, first in useretc, then in etc, and adds the file names (without the extension) to the
GXLST
. The name with the extension is stored as the value. TheGXLST
is cleared first.
- classmethod filter_mineral_pos_data(db, mask_ch, mineral_ch, mineral, pos)[source]¶
Filter raw data by position and mineral values
- Parameters:
db (GXDB) – Database handle
mask_ch (str) – Mask channel
mineral_ch (str) – Mineral channel
mineral (str) – Mineral (string) - “C”, “I” etc.
pos (int) – Grain position
New in version 6.2.
License: Geosoft Extended End-User License
Note: The Mask channel will be updated so that those data values which “pass” get “1” and those that “fail” get dummy “*” NO DATA IS REMOVED. Works on all selected lines of data.
- classmethod get_associated_lst(db, group, lst)[source]¶
Get the associated channels for this group in a
GXLST
- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod get_current_mineral_lst(db, mineral_ch, lst)[source]¶
Retrieve
GXLST
of minerals in selected lines.- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
Note: If the mineral channel name is not specified, it returns just the “X” (Unknown) item.
- classmethod get_current_position_lst(db, lst)[source]¶
Retrieve
GXLST
of positions in selected lines.New in version 6.2.
License: Geosoft Extended End-User License
- classmethod get_full_mineral_lst(lst)[source]¶
Retrieve
GXLST
of all minerals in Semplot_Minerals.csvNew in version 6.2.
License: Geosoft Extended End-User License
- classmethod get_full_position_lst(lst)[source]¶
Retrieve
GXLST
of all possible mineral positions.New in version 6.2.
License: Geosoft Extended End-User License
- classmethod get_grouping_lst(db, lst)[source]¶
Get list of items to group symbols by.
New in version 6.2.
License: Geosoft Extended End-User License
Note: The first item is “Anomaly”, which gives the line names, The second item (if the channel exists in the database) is the Sample Number. After this are included all string channels which are NOT oxides or elements. (The list can include the mineral). Channel symbol is the
GXLST
value (except for the first item - “Anomaly”)
- classmethod get_mineral_channel_name(db, mineral_ch)[source]¶
Retrieve the mineral channel name.
New in version 6.3.
License: Geosoft Extended End-User License
Note: First looks at the
GXSEMPLOT
.MINERAL_CHANNEL value. If not found, returns the first MINERAL class channel found. If still not found, returns a blank string.
- classmethod import_ascii_wizard(name, temp, anomaly)[source]¶
Generate a
GXSEMPLOT
ASCII import template.- Parameters:
name (str) – Data file name
temp (str) – Template to make
anomaly (str_ref) – Anomaly name (can be “”)
New in version 6.3.
License: Geosoft Extended End-User License
Note: If the anomaly name is not included, then the input data must have an “Anom_Name” field.
- classmethod import_bin(db, data, templ, line, flight, date)[source]¶
Import blocked binary or archive ASCII data
- Parameters:
db (GXDB) – Database
data (str) – Import data file name
templ (str) – Import template name
line (str) – Optional Line name (see note 3.)
flight (int) – Optional Flight number
date (float) – Optional date
New in version 6.2.
License: Geosoft Extended End-User License
Note: This wrapper is for
GXSEMPLOT
, and does not require the import licence.Binary import templates have extension .I2 by convention. See BINARY.I2 for a description of the template format. Archive import templates have extension .I3 by convention. See ARCHIVE.I3 for a description of the template format.
Both the import template and data file must exist.
If a line already exists in the database, a new version is created unless a line name is passed in. In this case, the specified name is used and the imported channels on the previous line will be destroyed.
See also
GXDU.lab_template
in du.gxh
- classmethod import_database_ado(name, temp)[source]¶
Generate a template file for importing semplot databases.
- Parameters:
name (str) – Data file name
temp (str) – Template to make
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod import_database_odbc(connection, temp)[source]¶
Generate a template file for importing ODBC databases.
- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod init_group_symbols_used(db)[source]¶
Initializes memory of symbols used in plotting.
- Parameters:
db (GXDB) – Database handle
New in version 6.2.
License: Geosoft Extended End-User License
Note: Maintains a list of the symbols used in plotting. Call before Plotting one or more legends - symbols are accumulated.
plot_symbol_legend
uses this information to create a legend.
- is_null()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- classmethod mineral_id(db, resid, min_ch, res_ch)[source]¶
Identify minerals from the oxide channels.
- Parameters:
db (GXDB) – Database
resid (float) – Maximum residual value (in % of the total oxide)
min_ch (int) – Mineral channel (Locked RW)
res_ch (int) – Residual channel (Locked RW)
New in version 6.3.
License: Geosoft Extended End-User License
Note: Finds the best mineral matching the composition for each row of oxide values. Works using linear programming and the simplex method to maximize the oxides used to create each of the possible output minerals. The mineral leaving the least leftover is selected, as long as the residual (measured as a percent of the total) is less than or equal to the input value.
- classmethod new_filter(filter, model)[source]¶
Create a new selection filter.
- Parameters:
filter (str) – New filter name
model (str) – Filter to use as a model (can be “”)
New in version 6.2.
License: Geosoft Extended End-User License
Note: Creates a new, empty filter file in the useretc directory
- classmethod new_template(templ, type, model)[source]¶
Create a new XYPlot or TriPlot template.
- Parameters:
templ (str) – New template name
type (int) – Unknown
model (str) – Template to use as a model (can be “”)
New in version 6.2.
License: Geosoft Extended End-User License
Note: The new template is written to the useretc directory, with the file extension “semfilter”. The template contains a parameter identifying it as an XY or Triplot.
Model Template: Looks first in useretc, then in etc. Looks first for file prefix “semtemplate” then “xyt” or “tri”
Because there are so many shared parameters, it is possible to use an XYPlot template as a model for a TriPlot, and vica-verca, with few complications. (e.g. needing to define a “Z” component)
- classmethod overlay_lst(lst, extension, type)[source]¶
Fill a list with the available plot overlay names
- Parameters:
extension (int) – SEMPLOT_EXT constants
type (int) – SEMPLOT_PLOT constants
New in version 6.2.
License: Geosoft Extended End-User License
Note: Looks first in useretc, then in etc. See SEMPLOT_EXT constants definitions above for which files to look for.
- classmethod plot(db, templ, mask_ch, mineral_ch, map, map_mode, plot_symb)[source]¶
Plot an XYPlot or TriPlot based on the template.
- Parameters:
db (GXDB) – Database handle
templ (str) – Template file name
mask_ch (str) – Mask channel (can be “”)
mineral_ch (str) – Mineral channel (can be “” for raw data)
map (str) – Map name
map_mode (int) – Map open mode; one of MAP_WRITEXXX (see map.gxh)
plot_symb (int) – Plot symbols (O: No, 1:Yes) ?
New in version 6.2.
License: Geosoft Extended End-User License
Note: The “Components” and “Parameters” groups in the INI file are used. Only values with mask values of 1 are plotted, if the mask channel is specified.
Call “
reset_used_channel
” prior to this function in order to track the values actually plotted.Call
init_group_symbols_used
prior to this function to reset recording of the symbols used in plotting (for legends etc).
- classmethod plot_symbol_legend(db, mview, x_min, y_min, y_max, symb_size)[source]¶
Plot a symbol legend in a view.
- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
Note: This function depends on
init_group_symbols_used
before the plot for which this legend is created is made. The symbols and groups to use in the legend are stored to a database blob after the plot is made. These values are recovered by this function to make the legend at the specified location.
- classmethod prop_symb(db, map, view, chan, mask_ch, mineral_ch, log, area, base, scale, symb, wt, line_col, fill_col, legend)[source]¶
Plot a proportional symbol plot.
- Parameters:
db (GXDB) – Database handle
map (GXMAP) – Map to plot to
view (str) – View to replot
chan (str) – Channel name
mask_ch (str) – Mask channel (can be “”)
mineral_ch (str) – Mineral channel (
log (int) – Linear (0) or logarithmic (1) scaling
area (int) – Scale by diameter (0) or area (1)
base (float) – Scale base (log) data units
scale (float) – Scale factor (log) data units/mm
symb (int) – Symbol number
wt (int) – Symbol weight
line_col (int) – Symbol line color
fill_col (int) – Symbol fill color
legend (int) – Plot legend?
New in version 6.2.
License: Geosoft Extended End-User License
Note: Replots map using proportional symbols
- classmethod re_plot_symbol_legend(db, mview)[source]¶
Replot a symbol legend in a view.
New in version 6.2.
License: Geosoft Extended End-User License
Note: Searches the VIEW
GXREG
for information on a previously created legend, and if it finds that info, replots the Legend, using the current data, group key etc.
- classmethod replot(db, mask_ch, mineral_ch, map, view)[source]¶
Replot an existing
GXSEMPLOT
plot based on current data.- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
Note: Note that the selection of data in the current
GXDB
is used to replot the map.Call “
reset_used_channel
” prior to this function in order to track the values actually plotted.Call
init_group_symbols_used
prior to this function to reset recording of the symbols used in plotting (for legends etc).
- classmethod reset_groups(db, mask_ch)[source]¶
Re-group data using current settings.
- Parameters:
db (GXDB) – Database handle
mask_ch (str) – Mask channel
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod reset_used_channel(db)[source]¶
Set the “Plotted” channel to dummies
- Parameters:
db (GXDB) – Database handle
New in version 6.2.
License: Geosoft Extended End-User License
Note: This function is called before one or a series of plots to initialize the “Plotted” channel in all the selected lines to dummy values. As the plots are created, those points used in the plot are set to 1, so that at the end the database records which values have been plotted. This information can then be used to make a symbol legend. If the “Plotted” channel does not exist, it is created, associated, loaded, and filled with dummies.
- classmethod select_poly(db, mview, mask_ch, mineral_ch, pply, mode)[source]¶
Select data from a polygonal area on a map.
- Parameters:
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod set_channel_order(db, lst)[source]¶
Sets preset channel order.
New in version 6.2.
License: Geosoft Extended End-User License
Note: Sets channel order as follows:
Sample_No X and Y Locations Mineral Grain_No Position (e.g. center, edge etc.) Grain Morph Oxides (in the order they appear in Semplot_Oxides.csv) Trace Elements (Ordered as in the periodic table) Total Mask IsPlotted (flag set when a value is plotted) Other channels
Channel order is set for all “RawData” groups.
- classmethod set_channel_units(db)[source]¶
Set units for oxides (%) and elements (ppm)
- Parameters:
db (GXDB) – Database handle
New in version 6.2.
License: Geosoft Extended End-User License
Note: If the channel units are already set, then they are not changed. Oxide channels are identified from the Semplot_Oxides.csv file. Trace elements are identified from the periodic table of the elements, except for “Y”, if it is the current Y channel.
- classmethod set_itr(db, ch, itr)[source]¶
Put
GXITR
into a channel.- Parameters:
db (GXDB) – Database handle
ch (int) – Data channel handle
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod set_mask(db, mask_ch, mineral_ch, mineral, selected, val)[source]¶
Set the mask channel ON or OFF.
- Parameters:
db (GXDB) – Database handle
mask_ch (str) – Mask channel
mineral_ch (str) – Mineral channel
mineral (str) – Mineral to use (“All” or “” for all)
selected (int) – 0 for all lines, 1 for selected lines
val (int) – 0 for off, 1 for on.
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod sort_data(db, group, anomaly)[source]¶
Sort data by Sample No, Grain and Position
- Parameters:
db (GXDB) – Database handle
group (int) – Data Group handle
anomaly (int) – Use Anomaly channel as primary sort?
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod template_lst(lst, type)[source]¶
Fill a list with the available plot template names
- Parameters:
type (int) – SEMPLOT_PLOT constants
New in version 6.2.
License: Geosoft Extended End-User License
Note: Looks first in useretc, then in etc. Looks first for file prefix “semtemplate” then “xyt” or “tri” (New-style templates with the “semtemplate” extentsion have the plot type “triplot” or “xyplot” inside them.)
- classmethod template_type(templ)[source]¶
Create a new XYPlot or TriPlot template.
- Parameters:
templ (str) – Template name
- Returns:
SEMPLOT_PLOT_XYPLOT
orSEMPLOT_PLOT_TRIPLOT
Terminates if error.- Return type:
int
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod tile_windows()[source]¶
Tile currently maximimized windows.
New in version 6.2.
License: Geosoft Extended End-User License
- classmethod total_oxides(db, mineral_ch)[source]¶
Calculate the total oxides channel.
- Parameters:
db (GXDB) – Database handle
mineral_ch (str) – Mineral channel
New in version 6.2.
License: Geosoft Extended End-User License
Note: The mineral channel is needed in order to adjust the total with the Fe Corrected Ferric and Ferrous values, and these require a mineral for their identification. If none is provided, mineral “X” (unknown) is assumed.
- classmethod view_type(map, view)[source]¶
Test to see if a view is an XYPlot or Triplot view.
- Parameters:
map (GXMAP) – Input map object
view (str) – Input view name
- Returns:
- Return type:
int
New in version 6.4.2.
License: Geosoft Extended End-User License
Note: First checks the view name to see if it starts with
"XYplt_"
or"Triplt_"
. Failing that it looks in the viewGXREG
for a value for “Components.Type”, which will be either “XYPlot” or “TriPlot”. If the view does not appear to be an XYPlot or a TriPlot view, the function returnsSEMPLOT_PLOT_UNKNOWN
.
SEMPLOT_GROUP_CLASS constants¶
GXSEMPLOT
group class.
SEMPLOT_EXPORT constants¶
GXSEMPLOT
export type selection.
SEMPLOT_EXT constants¶
GXSEMPLOT
file extension selection
- SEMPLOT_EXT_ALL¶
Use for selection only. Selects both “Semplot” and “
GXCHIMERA
” type files when creating LSTs etc.- gxapi.SEMPLOT_EXT_ALL = 0¶
SEMPLOT_PLOT constants¶
GXSEMPLOT
plot type selection.