FastGAPP – A MATLAB-Based Program Supports Earth Scientists Interpreting Geochemical , Petrological and Sedimentological Data

FastGAPP (Fast Geoscientific Analyses Plotting Program) is a MATLAB-based graphical user interface. It is developed to quickly explore and interpret geochemical major and trace element analyses of igneous rocks in over 100 published classification and discrimination plots, variation diagrams and normalised rare-earth element and multi-elements plots. All plots can be modified (fonts, lines, frame etc.) to produce publication-ready and high-quality raster or vector graphics. Among geochemical analyses of magmatic rocks, several other sub-programs are integrated to display petrographic analyses of igneous rocks, composition and grain size analyses of sedimentary rocks, and grain size analyses of soils. FastGAPP also provides several tools to support data handling, to extend the integrated geochemical databases and/or even create new sub-programs for different fields of geosciences. FastGAPP v2.0 is available on GitHub and Zenodo. CORRESPONDING AUTHOR: Florian Riefstahl University of Bremen, Department 5 Geosciences, Bremen, Germany; Alfred Wegener Institute Helmholtz Centre for Polar and Marine Research, Bremerhaven, Germany; Now at: Landesamt für Geologie und Bergwesen Sachsen-Anhalt, Halle, Germany f.riefstahl@outlook.com


(1) OVERVIEW INTRODUCTION
Geochemical studies of igneous rocks are fundamental to classify rock types in terms of main-, minor-, and trace element whole-rock chemistry. Together with petrographic thin section observations Earth scientists classify igneous rocks and draw conclusions about: • the petrogenesis and evolution of igneous rocks; • the thermal and barometric conditions in which primary magmas have formed; • the magmatic processes involved in the evolution of igneous rocks; • and the geotectonic environment in which igneous rocks might have formed.
The creation of publication-ready geochemical plots and comparison of own data with published are often extremely time-consuming, and therefore, inefficient and expensive tasks. Specific software to perform these tasks are mostly based on VBA and Excel like the programs Petrograph [1], PetroPlot [2], GeoPlot [3], GCDK [4], GCDPlot [5], or Geokit [6]. Other software approaches are developed in Python (GeoPyTool [7]) or R (GCDKit [8,9]). Here, we present the program FastGAPP v2.0 (Fast Geoscientific Analysis Plotting Program), which is a MATLAB-based graphical user interface. FastGAPP v2.0 allows cross-platform, interactive and simultaneous exploration, comparison, and interpretation of up to 9 datasets. The principles of FastGAPP's data handling are also suitable for other fields of geosciences and can increase teachability of geoscientific data visualisation and interpretation. Complete lists of all valid header entries and supported units for all sub-programs are listed in FastGAPP's documentation. Among MS Excel spreadsheets, all subprograms can also read data from MAT-files, which significantly decreases file import times during start-up. These MAT-files can be created from spreadsheets by using the integrated tools.

IMPLEMENTATION AND ARCHITECTURE
After the input datasets have been selected, it is possible to start the specific sub-program. This initiates a complex data processing flow (Figure 1): First, the previously-selected input files are parsed and sorted. Second, essential variables and structures are created. This includes a control structure in which headers (including units) and plot datasets for the selected sub-program are loaded. Additionally, a data structure is created by loading the default setup for markers and labels (Figure 1). Third, the datasets are imported dependent on their file type by using the corresponding MATLAB-commands ("load" for MAT-files and "xlsread" for spreadsheets). A simple loop, which uses the program-specific headers, parses through the imported input files and writes the information into new variables of the data structure. If a header value was not found in the imported data, these variables will be present as NaN's (Not-a-Number). Fourth, the defaults for the appearance of plots lines and labels are loaded into the control structure. Finally, a special function performs a program-specific processing of the data. The special function of FastGAPP for example performs a volatilefree normalisation to 100 wt. % (including all trace elements given in ppm or ppb), a conversion of all major element oxides and trace elements to molar weights, and calculation of commonly used indices such as the ASI (alumina saturation index) or AI (agpaitic index). Additionally, statistics such as minimum, maximum, mean, and median for each element are calculated and stored in the data structure.
After data processing and initialisation of all fundamental structures, the main window opens and handles the processed and calculated data (Figure 1). The main window (Figure 2) is mostly similar for all subprograms. It allows to explore, display, and plot the imported data:

FUNCTIONALITY
FastGAPP allows to import up to 9 datasets into a single session of any sub-program. If 9 datasets are not enough, FastGAPP can also read information about marker and marker labels from the input data so that multiple datasets can be present in a single input file. The major improvements compared to the initial version of FastGAPP (v1.0) published on digital-geography.com are (I) the automatic import of the data by program-specific headers from the input, (II) the support of MAT-files, (III) simplified export of raster and vector graphics, (III) full control of plot and marker appearance, (IV) improved data overview. FastGAPP supports multiple instances of the main windows at the time, which allows to work on more sessions at the same time. Furthermore, sessions can be saved and loaded as MAT-files. This simplifies sharing of specific sessions with other scientists and researchers. The four sub-programs cover different fields of geosciences from examination of (I) geochemical analyses of major, minor and trace elements of igneous rocks ("FastGAPP"), (II) petrographic classification of igneous rocks ("PetroPlot"), (III) petrographic classification and provenance analyses of sedimentary rocks ("SediPlot"), to (IV) soil classification based on grain size analyses ("SoilPlot"). FastGAPP includes over 100 petrographic and geochemical classification, magma-series and geotectonic discrimination diagrams from over one century of petrological and geochemical research. Additionally, several integrated functions like the "MULTIPLotter" and the "PLOT-O-MAT" allow users to create rare-earth element (REE), multi-element plots and geochemical variation diagrams.
Furthermore, FastGAPP is extendable. The digitised plot datasets are stored as two-point line segments and field labels in separate MATLAB scripts. These can be created from Excel spreadsheets by using the development tools integrated in FastGAPP (Figure 1). The same possibilities for database extension apply for normalisation values necessary for REE and multi-element plots. Moreover, it is even possible to create new sub-programs for different fields of geosciences by using the development tools (Figure 1).

QUALITY CONTROL
FastGAPP has undergone extensive functional testing and debugging by F.R. during development. This included also tests with real, synthetic and nonsensical datasets. The majority of the functions contain logical if-else statements, which e.g. also allows import of datasets with incorrect header or unit information without any conflicts with main data processing flow.
First plots with a stable version of FastGAPP are already presented in Geissler et al. [10]. The download package contains sample data for all sub-programs and software documentation provide sufficient details that other scientists can quickly understand and step-by-step work with FastGAPP v2.0.

OPERATING SYSTEM
The software has been tested on Windows 7, 8 and 10 and Mac OS X.

PROGRAMMING LANGUAGE
FastGAPP is written in MATLAB code, and therefore is not required to be compiled. Tests were performed with the MATLAB versions 2013 (Windows 10), 2015 (Mac OS X) and 2020 (also Windows 10).

ADDITIONAL SYSTEM REQUIREMENTS
The disk space of the zipped download is only 25 MB. The system requirements are those recommended for MATLAB installations (minimum 3.1 GB minimum, 4 GB RAM, any Intel or AMD x86-x64 processor).

DEPENDENCIES
FastGAPP requires only MATLAB (without any further add-ons or packages) and MS Excel to be installed on the platform.

LIST OF CONTRIBUTORS
No further scientists/researchers contributed to the development of FastGAPP.  dataset mode (B). The different panels give an overview about the imported data and allows to adjust markers, their labels, the plot lines and labels, and change the currently selected plot.

(3) REUSE POTENTIAL
FastGAPP is publicly available on GitHub and Zenodo. Preparation of input datasets for the different subprograms is accessible for most users with geoscientific background by using the program-specific headers in the first row (i.e., SiO 2 , TiO 2 , Zr, Nb, etc.) with their corresponding units in the second row (i.e., wt. %, %, ppm, ppb, etc.). Therefore, input data match or are close to geochemical datasets provided by the geochemical laboratories.
The program contains a high number of available published geochemical and petrographic plots for igneous rocks from over one century of petrological research. Moreover, FastGAPP covers more disciplines of geosciences since it also contains sub-programs for sedimentological classification, sediment-source discrimination and soil classification.
For advanced and interested users, FastGAPP also provides development tools, which make it possible to enhance the databases of plots and geochemical normalisation values or even to create new programs for other fields of Earth science. The functionality of the development tools is also listed and explained in FastGAPP's documentation.
The authors invite ideas for improvements in future versions of FastGAPP and report of any bugs. Please contact the lead author via email if support beyond the documentation and manual is required. This also applies if you are considering code modifications, enhancements of databases or further development.