<< GeoXDraw : Software tools for processing geochemical data
GeoXDraw (alias GeoXDraw) is a Windows95+ (95/98/2000...) program for geochemical data processing. Its main purpose is to help the interpretation of bullk and mineral chemistry data through graphic representations.
Yo may download the program from http://www.emse.fr/~moutte/geoxdraw_.zip (or geoxdraw _.exe , 'self-extractable').
Installation: Download the file geoxdraw_.zip (395 K) and decompress into a given directory (e.g. c:\geodraw) . That will create the program geodraw.exe, and the text files needed for configuration (_log.txt, _spiders.txt), test (_colsym.txt and _xy.txt) and postscript exportation
Obective: to implement tasks that are specific to geochemical data (e.g. ternary diagrams, switching from weight to atomic coordinates, ...). GeoXDraw includes most basic tools specific to geochemical data handling ; on the other hand the user will rely, for more general tasks (edit, sort, select,...), on more common softwares (one for spreadsheet and one for drawing). GeoXDraw is not so complete as other softwares specially designed for geochemical data (for example it does not include ready-made geochemical diagrams with already defined fields for reference series); as a consequence, it is compact : about 600 kbytes, in a single .EXE file, without calls to external DLL files; it is thus easy to install (simply decompress the zip file into a directory) and uninstall (simply delete this directory).
Structure of the input data files : GeoXDraw has a very direct 'interface' with the data files produced by widely used spreadsheets : it is working directly by copy / paste from a spreadsheet, without import/export to a specific format; in order to allow many different 'projections' from different points of view, the input file can include up to eight descriptive fields which will be used to define the selections (to plot or not), and the colors and shapes of the symbols. GeoXDraw can work on one single input file for X-Y-(Z), or with two input files, one for X (- Z), the other for Y, or with two input files, one for sample list and the other for data.
GeoXDraw: detailed description
Compared with graphing tools generally included in standard spreadsheet software, our program's drawback is that it is not integrated to the spreadsheet itself, but, as it reads and writes a format readily supported by spreadsheets, the time spent in switching applications should be short compared to the time saved in using tools specially designed for geochemical data.
< Configuration, Launching the program
The program is directly downloadable from our web site. Downloading the file GeoXDraw.zip (about 300 K) and decompressing into a given directory (e.g. c:\GeoXDraw) will create the program GeoXDraw.exe, and related text files for configuration (_log.txt, _spiders.txt), for test (_colsym.sav and _xy.sav ), and the text file GeoXDraw.ps, a postscript file necessary for exporting the diagrams as postscript files.
GeoXDraw, developed with the Delphi 5 IDE, is running under Windows95 or higher. [A Linux version will soon become available, as Kylix (Delphi for Linux) is now available as Open Edition]. Any configuration that can run Win95/98 should run GeoXDraw.
It has been developed for a 800x600 display or higher resolution. It can be used under a lower resolution, but the interface will not be displayed entirely with the diagram on a single screen. The default size of the diagram is 530 by 530 pixels. It can be enlarged by passing a higher resolution as a parameter in the _log.txt file: this file contains the line RES=530, just replace the 530 by the resolution you want.
As the program is relatively small, it is possible to have several instances of the program running at the same time, for example for comparative work on different databases: to do so, you need to make copies of the whole GeoXDraw directory and rename this new directory. You would have for example GeoXDraw1, GeoXDraw2, etc. and the plot files will be saved in the respective sub-directories GeoXDraw1\PS, GeoXDraw2\PS, etc.
Launching the program
The only menu item available on start deals with the input file(s).
File / Input file(s)
In this new version, data are input directly from the Windows clipboard.
The strategy is as follows:
open your data file with your favorite spreadsheet program (e.g. OpenOffice, Quattro, Excel, ...),
select a block of data that includes, as the first line of the block, the descriptive fields;
copy to the clipboard;
switch to GeoXDraw, choose 'Input Data' and the input mode you want;
that will open a window where you can Paste the clipboard into and save as Single File, or Data File or List File.
The first step is thus within your spreadsheet:

and the second:step within GeoXDraw:

The program can work with
either one single input file for X-Y-Z, ('Choose Input' > 'Single X-Y File')
or with two input files,
one for the sample description and data for X-axis, (and Z data of ternary diagrams),
the other for the Y-axis (convenient for comparison of data obtained from different methods, e.g. XRF and ICP)
or with two input files,
one for the sample descriptions,
the other for X-Y-(Z) data.
|
In the case of two input files, the program must find where a given sample is located in each file : the two input files must have the sample identifier as the first field (first column) of each file. This is generally easily done with any spreadsheet program. |
|
The distribution includes two sample data files that can be used to test the program and help the user get acquainted with the input format and the different features of the program. These files (_colsym.sav containing a sample list, _xy.sav corresponding analytical data) are loaded by the File / Test instruction. |
File / Reload: this will open again, as input, the files that you were working on the last time you used GeoXDraw.
File / Test: load the two test files (_colsym.sav containing a sample list, _xy.sav corresponding analytical data).
Once the input files have been read, other menu items become available: Diagrams, and Conversion.
< Structure of the data files
GeoXDraw reads text files of the so-called TAB delimited format (Tab characters are normally 'automatically' implemented by the 'Copy and Paste' procedure of the operating system).
each 'record' (= one whole rock sample, or one microprobe point) is written on one line;
the different fields of a record are separated by Tabulation characters;
N.B.1 One field entry cannot contain blank characters, because they would be considered as field separator. !!! [to have more than one word in one field, you may use the underline character '_' ]
N.B.2 For character string, only the first 7 characters are significant; notice also that GeoXDraw is not case sensitive
Each record (e.g. each analysis) consists of two types of variables :
string values describing the sample (name, lithology, location, magmatic unit, point number for a probe analysis, etc.),
numeric values giving the chemical compositions, or any quantifiable parameter.
The basic principle of our input format is that all the descriptive string parameters must be placed ahead (i.e. on the left side of the spreadsheet) of the numeric parameters.
Then, the program must be able to know what is what: the first line of the input block must contain the informations that define the structure of the data set. It contains the names of the variables, and their types, as defined by a simple rule : the name of a descriptive string parameter (not the values themselves) must have a point '.' as leading character .
A typical head line will thus appear as follows :
|
.SAMP |
.CS |
.LITHO |
TiO2 |
Al2O3 |
Fe2O3 |
MnO |
MgO |
CaO |
Na2O |
K2O |
P2O5 |
|
x70 |
BCF |
GNEISS |
0.601 |
14.8 |
4.49 |
0.038 |
1.06 |
0.713 |
2.4 |
3.96 |
0.211 |
|
x71 |
BCF |
GNEISS |
0.598 |
15.4 |
.33 |
0.048 |
1.12 |
0.627 |
2.51 |
4.02 |
0.207 |
In this example, the first four fields contain string values (sample name, lithology, etc.), and the following fields numeric values (contents in TiO2, Al2O3, etc.). The labels of the latter have thus no '.' as leading character .
It is possible, not necessary, to have a title line : just add it as a single line at the top of the the file, and take care that it has no '.' character at the beginning : this will 'tell ' the program that it is a title and that the label line will come in second.
< Graphic functions
The following types of graphic output are available : binary diagrams, multielement profiles, ternary diagrams, spidergrams , histograms.
Atomic mode: In all cases except spidergrams, the user can switch to the 'atomic mode' : the input data, supposed to be originally in oxide weight % or ppm of metal, are converted to numbers of atom grams for 1000 g of rock. To switch/ unswitch a given axis or apex for atomic, check/ uncheck the corresponding 'Atom' check box.
Expressions of the form (aX+bY+...)/(cM+dN+...), [where X,Y,M,N are oxides, metals, or atom numbers, and a,b,c,d,.. are coefficients] can be constructed checking the 'Complex' check box, and using the 'Reset', 'Plus' and 'Minus' buttons, combined with the 'Numerator/Denominator' switch. To begin enter an expression, check the Reset button and choose the element in the lists for X, Y (Z), then check the Plus or Minus to add or subtract other elements. To reset an expression, check the Complex button to off.
At the moment, only simple expressions can be entered: the coefficients a, b, c, ... can be only 1 or -1 (for example, to enter Al - 2Ca, enter Al - Ca - Ca ; for more complex expressions, like Ca - 5/3 P, write the image of the input file in atomic numbers, calculate the expression with your spreadsheet, and reread the modified atomic file).
Hint: An alternative, for rocks with excess apatite, to convert CaO wt% directly to CaO* = 'excess CaO' (i.e. CaO in other minerals), is to calculate, directly in the oxide wt% sheet, a new column with CaO* = CaO - P2O5 * 568/432.
However, when working with single term expressions on ternary diagrams, it is possible to affect coefficients to the apices of ternary diagrams .
Profile diagram : choose one element as X-axis, and plot the variations of several elements along Y-axis. It is possible 1/ to connect the points of each series of Y-variables (check the Profile check box), and 2/ to norm to 100 the maximum value of each series (check the Max = 100 check box).
Histograms : used to visualize the distribution of a given parameter (e.g. SiO2 content) ; you can draw a single histogram for the complete data set, or compare the distributions in different rock types, using several histograms. The field, according to which the different populations are distinguished, is selected by the Select Series instruction of the Selection menu. The distribution of the selected parameter can be computed in normal or in logarithmic scale: checking the Log check box means the distribution of the logarithmic values is represented in normal scale, not the normal distribution on a logarithmic scale ....
Spidergrams : the parameters of the spidergram (element list and corresponding normalisation parameters) are read from a text file, named spiders.txt, which is (must be) in the same directory as the program iself. This file contains a number of 'standard' spidergrams (e.g. REE list / chondrite normalisation). By editing this file in a simple ascci editor (e.g. notepad, editpad), the user can modify the sample list and parameters, and add or delete some of the normalisations, using the same format as used for the existing normalisations. This format is similar to that of other input files; each normalisation is defined by 3 lines:
1st: name of normalisation> (e.g. authors, reference)
2nd: field name <tab> element list (element names separated by <tab>'s);
3rd: name of normalizing material (e.g. Chondrite, Shale, ...) <tab> normalisation factors (separated by <tab>'s ).
< Selections : Colors, Symbols, Labels, Series ...
According to the type of diagram selected in the Diagrams menu, different types of selections become available in the Selection menu:
for X-Y and X-Y-Z diagrams: Color - Symbol - Label - Series,
for Spidergrams: Label - Series,
for Profiles and Histograms: Series.
Each time you select an item in the Selection menu, a box showing a list of the names of the different descriptive fields of the input file is activated. You will select in this list which field is used to define the value of the corresponding item (Color/ Symbol/ Label/ Series).
Label : sélectionne quel champ sera utilisé comme label. Si cette option n'est pas activée, c'est le premier champ de l'analyse (= la première colonne) qui est utilisé comme label du point ou de l'arac'nogramme.
Select Series: when Select Series is selected in the Selection menu, you can choose, in the list that appears under 'SELECTION', one of the available desciptive fields. Upon selecting one of these, a list of the possible values will be displayed, where you can check/ uncheck the different groups of points that you want to be taken into account in the currently active drawing task.
When drawing binary or ternary diagrams, 'Select Series' can be used to draw separate diagrams for different sample groups from a large database.
When drawing histograms, 'Select Series' is used to draw one histogram for each Series (up to eight series).
For the definition of Symbols, Colors, or Color/Symbol combination, a specific column must have been inserted beforehand in the input file (i.e. in the descriptive part). For example, given a column containing lithologic data, it will be a quick and simple task to insert (on its left side) a new column, and, using the sorting, filling or pasting functions that most spreadsheet include, to fill it with Color and/or Symbol codes corresponding to the different lithologies encountered in the data file. Do not forget to give to this new column a name (on the first line, for example .Symbol).
Although this edition of the input file takes some time, this approach has the major advantage: the 'stabilization' of the symbolics of the data set, for the same correspondance between sample characteristics and Colors/ Symbols will be found from one drawing session to the other.
Caption: it is useful that the diagram (and its HPGL image) is able to display a caption with the 'meaning' of the different colors / symbols. GeoXDraw considers that these are contained in the field (= column) just next to the field containing the encoding itself. This is the reason why the column with symbolics encoding should be inserted on the left side of the column it is constructed from.
Color definition syntax: the color is defined by one letter ; 8 colors are available; the letters B, R, G, Y, L, V, T, O corresponds to Black, Red, Green, Yellow, bLue, V iolet, Turquoise, Orange.
Symbol definition syntax: a symbol is defined by two letters , the first giving the shape (Square, Circle, Plus, Diamond, Xross), the second the 'character'; each shape can be affected by five different 'characters' (Plus, Empty, Filled, Circle, Xross). For example, a filled square is encoded as SF (Square / Filled), an empty circle as CE (Circle / Empty), etc. However, as this mnemomic way of coding could not applied to all symbols, the best way to know the 'legal' 2-lettres combinations is to look at the first screen of GeoXDraw.
Color/Symbol combination: it is possible also to have inserted in the input file a single field (i.e. a column within the 'descriptive' part of the input file) that defines the color + symbol; a colored symbol is defined by a chain of 3 letters, the color code being the first letter, and the symbol the two others. Example: a sample having RCF as the value of the corresponding '.ColSym' field will plot as a Red Circle Filled ...
< Other functions
Besides graphic tools,
GeoXDraw can operate basic operation of unit conversions.
Nota Bene: the program 'understands' that the input data are
in weight percent of oxide if the field label is written as an oxide (e.g. SiO2)
in ppm of metal if the field label is written as an element, e.g. Sr.
from ppm to oxides (useful for unusual rocks, such as ores, where solaced trace elements become major elements);
from oxides to ppm (e.g. for mixing EPMA data [of accessory minerals], generally given as oxides, with whole rock data) ;
from oxides and ppm to numbers of atoms for 1000 gram of rock.
The conversion will produce an 'image' of the input file, i.e. a file with the same structure and the same name, that will be written in a specific subdirectory of the default data directory. The default data directory is defined in the first line of the 'GeoXDraw.log' file. Suppose this directory being C:\DAT, the 'image' file will be written respectively in the directories C:\DAT\OXY, C:\DAT\PPM, C:\DAT\ATM.
Calculation of structural formulas
GeoXDraw also includes,
as one of the conversion tools, a module for the computation of
structural formulas from weight % data. In order to keep the program
as compact as possible, this tool will do relatively basic
operations, based on the classical calculation scheme on a given
total number of valencies : more specific calculations (e.g.
calculate a mica without taking K-Na-Ca in account) can be done with
a spreadsheet on the output file produced by the program.
This tool will appear in the Conversion menu
only if the input file has a descriptive field, named .MINERAL,
which contains the name of the mineral. This name will be used to
select the number of oxygen for formula calculation of each
analysis. This allows an input file to contain several types of
minerals with different calculation schemes.
Mineral names recognized by the programs are generally full names, with the first five letters recognized as significant, such as bioti te, muscovite, olivine, pyrochlore, pyroxene, hornblende, etc. Minerals not recognized by the program will be calculated with the default value of the number of oxygen, i.e. 24.
The following minerals are currently implemented
(underlined are the significant letters):
biotite,
muscovite, chlorite, amphibole, hbl ,
hornblende, cordierite, felspar, felds
par, plagioclase, kfelspar, pxn, cpx, opx
, pyroxene, olivine, garnet, grenat,
sphen e, apatite, epidote, sillimanite,
andalusite , spinel, magnetit, aegyrine,
humite, perovskite , pyrochlore.
The numbers of oxygen are as follows :
Micas,
Chlorite : 11; Amphibole : 23; Cordierite : 18; Felspars : 8;
Pyroxene : 6; Olivine, Spinels : 4; Sphene, Humite : 5; Garnet : 12;
Apatite : 24; Epidote : 25; sillimanite et al : 5;
The results are saved in the same manner as other files produced by the conversion tools, i.e. in a specific directory named \DAT\STC. All minerals contained in the input file are saved in a single file, with number of cations recalculated according to the number of valencies corresponding to each type of mineral. In the case of an input file containing analyses of micas, garnets, pyroxenes, amphiboles, or pyrochlore the program will also produce special files which have a format specific to these minerals. These specific files will be saved, under the same directory \DAT\STC, with a specific suffix (.MIC, .GAR, .PXN, .AMP, .PYR). For example, input from an EPMA input file called \DAT\GRANIT\lozere1.epm will produce the file \DAT\STC\lozere1.epm, and, eventually, files \DAT\STC\lozere1.mic, \DAT\STC\lozere1.amp, etc.
< Save/Export the diagrams
On clicking on the SAVE box, which becomes visible when a diagram has been displayed, the current diagram is saved as a PostScript file (when the diagram has been saved, the SAVE box becomes invisible).
Text files written in PostScript (a Page Description Language, with strong graphic capabilities, developed by Adobe to drive laser printers) are more convenient than bitmap. This language is recognized by most word processing and graphing software. The files are much more compact (20 to 30 kb for a diagram with 100-150 points) and the language is vectorial , which means that the diagram is 'described' by the PostScript text as a sequence of geometric objects corresponding to the axes, labels, symbols, etc.
|
N.B. In order to build the PostScript 'image' of the diagram, GeoXDraw looks for a PostScript file, named _GeoXDraw.ps, that should be in the same directory as the GeoXDraw.exe file. This file contains a 'header', that is copied at the beginning of each PostScript 'image file', and that contains the 'implementations' of symbols and colors. It is thus possible for the user, with only basic notions of the postscript language, to modify permanently the colors and the 'look' of the symbols by modifying this GeoXDraw.ps file |
The PostScript text file is saved, in a subdirectory of the directory selected (in GeoXDraw.log) for PostScript output; the name of the subdirectory is that of the input file, and the file name consists of a number, incremented from 01 to 99, followed by the names of the X, Y (and Z) elements : for example, a diagram of TiO2 vs. MgO, drawn from a file named santorin.txt, if it is the first one saved in the current GeoXDraw session, open on an input file named santorin.txt, will be saved as santorin\01TiMg.ps; it will be distinguished from another TiO2-MgO diagram through the order number.
For each diagram saved, two files are created (in the case you have chosen a layout of 1 diagram per page !!! otherwise, all diagrams are mute) :
the main file, for example *.ps, is the image of the diagram on the screen, i.e. with scales, symbols, colors, but without the labels of the points,
a file named lab_*.ps contains only the labels,
To process the diagrams, it is very useful to use a graphic software that can draw on multiple layers: the different files of a given diagram will be imported into different layers of the same page. For example, the file 01TIMG.ps is imported, then lab_01TIMG.ps is imported on a distinct layer, and only selected labels can be cut and pasted from this layer to the main layer. The different diagrams comprise small line segments, on lower left and upper right corners, that will be used for exact superposition of the layers.
Viewing PostScript Files:
Ghostscript, Ghostview and GSview are Freely
available from http://www.cs.wisc.edu/~ghost/
Editing PostScript Files:
Detailed description of the PostScipt language can be found at
many sites on the web:
>> For an introduction:
http://www.cs.indiana.edu/docproject/programming/postscript/postscript.html
>> For more complete data:
http://cdfsga.fnal.gov/offline/PostScript/AdobePS.html#PostScript
which gives links to electronic versions of Adobe reference manuals
(e.g. http://cdfsga.fnal.gov/offline/PostScript/PLRM2.pdf
also known as Red Book)
< J.Moutte, Ecole des Mines de Saint Etienne