5
Software Spotlight/ Chunmiao Zheng, Software Editor SGeMS: A Free and Versatile Tool for Three- Dimensional Geostatistical Applications reviewed by Marco Bianchi 1 and Chunmiao Zheng 2 Introduction Most of the data used in ground water studies vary spatially, such as hydraulic conductivity, contaminant concentration, and aquifer thickness. The analysis of spa- tial data and more specifically the estimation of values at unsampled locations from a discrete number of measure- ments at specific locations are an essential part of most hydrogeologic investigations. Geostatistical techniques such as kriging and stochastic simulation are widely used to accomplish these tasks. The marketplace offers a wide selection of software packages for geostatistical applications. Some of these pack- ages are limited to two-dimensional data sets, some are quite expensive, while others lack the necessary theoretical rigor. A very popular collection of geostatistical programs is GSLIB developed by two well-known experts in the field of geostatistics (Deutsch and Journel 1998). GSLIB is an open source and can be incorporated into other programs or expanded to new geostatistical applications. These advan- tages made GSLIB a must-have for both professionals and researchers involved in geostatistical data analysis. Un- fortunately, GSLIB does not have an easy-to-use graphical user interface (GUI) for input and output operations. The preparation of input files and compilation of the source codes can in fact be difficult and tedious, especially if the user is not familiar with the FORTRAN programming language. This disadvantage can now be overcome by the Stanford Geostatistical Modeling Software (SGeMS), which is freely available on the Internet. SGeMS was developed by Nicholas Remy with con- tributions from Alexandre Boucher, Jianbing Wu, and Ting Li in the Department of Energy Resources Engineering at Stanford University, and it is considered an evolution of GSLIB. The geostatistical algorithms implemented in SGeMS are taken from the Geostatistics Template Library (G S TL) (Remy 2001), which is a C11 library containing an extensive set of geostatistical tools. This library is de- signed to be easily extended and readily integrated into software packages. SGeMS is an example of integrating G S TL into a user-friendly software tool with a GUI. How We Tested Version 2.0 of the SGeMS software was tested on a laptop computer with a 2.6 GHz Intel Ò Pentium 4 CPU and 512 MB RAM under Microsoft Windows XP and an- other laptop computer with 2.0 GHz Pentium M CPU and 2 GB RAM running Microsoft Windows Vista. The main installation program (8.5 MB) was downloaded from the software authors’ Web site, and the installation went smoothly and quickly without any problems. Different types of installation (compact, standard, complete, and custom) can be performed. The compact installation with- out source codes requires 18.7 MB of hard disk space, while the complete installation with source codes, doc- umentation, and the G S TL library uses about 35.8 MB. During the evaluation period, no conflicts between SGeMS and other software applications were experi- enced. The reviewers tested the software by working with real-world three-dimensional (3D) data sets. What We Found Documentation and Technical Support An SGeMS user’s manual in PDF format can be downloaded from the authors’ Web site where an online tutorial for writing commands and scripts, an online devel- oper’s reference, and an online tutorial for creating a new geostatistics plug-ins are also available. The user’s manual provides a general overview of the software capabilities; a description of the GUI; a simple tutorial to guide through the steps of importing data, performing ordinary kriging, 1 Department of Geological Sciences, University of Alabama, Tuscaloosa, AL 35487; (205) 348-3015; fax: (205) 348-0818; [email protected] 2 Corresponding author: Department of Geological Sciences, University of Alabama, Tuscaloosa, AL 35487; (205) 348-0579; fax: (205) 348-0818; [email protected] Copyright ª 2008 The Author(s) Journal compilation ª 2008 National Ground Water Association. doi: 10.1111/j.1745-6584.2008.00522.x 8 Vol. 47, No. 1—GROUND WATER—January–February 2009 NGWA.org

SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applications

Embed Size (px)

Citation preview

Page 1: SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applications

Software Spotlight/ Chunmiao Zheng, Software Editor

SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applicationsreviewed by Marco Bianchi1 and Chunmiao Zheng2

IntroductionMost of the data used in ground water studies vary

spatially, such as hydraulic conductivity, contaminantconcentration, and aquifer thickness. The analysis of spa-tial data and more specifically the estimation of values atunsampled locations from a discrete number of measure-ments at specific locations are an essential part of mosthydrogeologic investigations. Geostatistical techniquessuch as kriging and stochastic simulation are widely usedto accomplish these tasks.

The marketplace offers a wide selection of softwarepackages for geostatistical applications. Some of these pack-ages are limited to two-dimensional data sets, some are quiteexpensive, while others lack the necessary theoretical rigor.A very popular collection of geostatistical programs isGSLIB developed by two well-known experts in the field ofgeostatistics (Deutsch and Journel 1998). GSLIB is an opensource and can be incorporated into other programs orexpanded to new geostatistical applications. These advan-tages made GSLIB a must-have for both professionals andresearchers involved in geostatistical data analysis. Un-fortunately, GSLIB does not have an easy-to-use graphicaluser interface (GUI) for input and output operations. Thepreparation of input files and compilation of the sourcecodes can in fact be difficult and tedious, especially ifthe user is not familiar with the FORTRAN programminglanguage. This disadvantage can now be overcome by theStanford Geostatistical Modeling Software (SGeMS), whichis freely available on the Internet.

SGeMS was developed by Nicholas Remy with con-tributions from Alexandre Boucher, Jianbing Wu, and TingLi in the Department of Energy Resources Engineering at

Stanford University, and it is considered an evolution ofGSLIB. The geostatistical algorithms implemented inSGeMS are taken from the Geostatistics Template Library(GSTL) (Remy 2001), which is a C11 library containingan extensive set of geostatistical tools. This library is de-signed to be easily extended and readily integrated intosoftware packages. SGeMS is an example of integratingGSTL into a user-friendly software tool with a GUI.

How We TestedVersion 2.0 of the SGeMS software was tested on a

laptop computer with a 2.6 GHz Intel� Pentium 4 CPUand 512 MB RAM under Microsoft Windows XP and an-other laptop computer with 2.0 GHz Pentium M CPU and2 GB RAM running Microsoft Windows Vista. The maininstallation program (8.5 MB) was downloaded from thesoftware authors’ Web site, and the installation wentsmoothly and quickly without any problems. Differenttypes of installation (compact, standard, complete, andcustom) can be performed. The compact installation with-out source codes requires 18.7 MB of hard disk space,while the complete installation with source codes, doc-umentation, and the GSTL library uses about 35.8 MB.During the evaluation period, no conflicts betweenSGeMS and other software applications were experi-enced. The reviewers tested the software by working withreal-world three-dimensional (3D) data sets.

What We Found

Documentation and Technical SupportAn SGeMS user’s manual in PDF format can be

downloaded from the authors’ Web site where an onlinetutorial for writing commands and scripts, an online devel-oper’s reference, and an online tutorial for creating a newgeostatistics plug-ins are also available. The user’s manualprovides a general overview of the software capabilities; adescription of the GUI; a simple tutorial to guide throughthe steps of importing data, performing ordinary kriging,

1Department of Geological Sciences, University of Alabama,Tuscaloosa, AL 35487; (205) 348-3015; fax: (205) 348-0818;[email protected]

2Corresponding author: Department of Geological Sciences,University of Alabama, Tuscaloosa, AL 35487; (205) 348-0579;fax: (205) 348-0818; [email protected]

Copyright ª 2008 The Author(s)Journal compilationª2008NationalGroundWater Association.doi: 10.1111/j.1745-6584.2008.00522.x

8 Vol. 47, No. 1—GROUND WATER—January–February 2009 NGWA.org

Page 2: SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applications

and displaying the results; and a description of some ofthe geostatistical estimation and simulation algorithmsavailable in SGeMS. Since the user’s manual was writtenin 2004 and refers to a previous version of the software,some of the tools that are present in the tested version ofSGeMS are not described in the manual. However, by theend of 2008, a new user’s guide will be available (Remyet al. 2008). At the time this review was written, the re-viewers had no access to the new user’s guide, but thebook’s preorder information indicates that it will provide astep-by-step guide to using SGeMS geostatistical tools, acomplete explanation of the underlying theory, and a dis-cussion of how to complete automatic tasks using the em-bedded scripting language and how to develop newalgorithms and integrate them into SGeMS.

To receive technical support, the user can subscribe toa mailing list through the authors’ Web site. The mailinglist is intended for seeking help on using SGeMS, gettinginformation about new releases, or exchanging problems orissues with the authors and other users. Another mailinglist is specifically dedicated to developers of new algo-rithms or scripts. Once an e-mail message is submitted, itis forwarded to all members of the mailing list. Requests

for technical help are also accessible from a forum-typeWeb site at the following address: http://sourceforge.net/mailarchive/forum.php?forum_name=sgems-users. The re-viewers did not submit any technical questions, but from asurfing of this Web site, it appears that the user can get aprompt reply from the authors or other users within days.

GUI and Data Import and ManagementThe GUI of SGeMS is well designed (Figure 1).

The program window is divided into three main panels:the algorithms panel, the display panel, and the com-mand panel, each of which can be activated or deacti-vated at the discretion of the user. Once a geostatisticaltool is selected from the algorithm panel, the user has toinput all the necessary parameters in order to run thecorresponding algorithm. Both reviewers found this taskstraightforward, thanks to the intuitive design of theGUI. The display panel is a true interactive 3D environ-ment where it is possible to have full control of thevisualization through simple movements of the mouse.The graphics can be adjusted by changing color mapsor by visualizing cross sections or portions of the 3Dvolumes resulting from geostatistical estimation or

Figure 1. A screen capture of the SGeMS GUI showing the algorithm panel (on the left), display panel (right) and, commandpanel (bottom).

NGWA.org Vol. 47, No. 1—GROUND WATER—January–February 2009 9

Page 3: SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applications

simulation. From the command panel, the user can alsocontrol the software by typing text commands ratherthan using the GUI. It also displays a history of all com-mands executed.

Data can be imported by using the menu option Ob-jects / Load Object or by simply hitting CTRL-L on thekeyboard. Two data formats are supported by default: theGSLIB format, which is an ASCII format, and the SGeMSbinary format. Details on the GSLIB format can be foundin Deutsch and Journel (1998). When importing data withthe GSLIB format, the user must specify if the data repre-sent a point set, a normal grid, or a masked grid. A maskedgrid is the kind of grid where only some of the cells are ac-tive. The steps necessary for importing data sets are easy tofollow, but some knowledge of the GSLIB format is helpful.

Geostatistical ToolsWith SgeMS, it is possible to perform a complete ge-

ostatistical analysis, including descriptive statistical anal-ysis of univariate and bivariate data, variogramestimation and modeling, variable estimation, and differ-ent types of geostatistical modeling and postprocessing.Descriptive statistical analysis of univariate data can beperformed by calculating summary statistics and plotting

histograms and cumulative histograms. Bivariate data canbe analyzed using scatter plots, q-q plots and p-p plots.

The parameters needed for variogram, cross-variogram,and indicator-variogram calculation and modeling are verysimilar to those used in the code GAMVof GSLIB. Assign-ing the required parameters for the experimental variogramcomputation is intuitive. These parameters include the num-ber of lags, lag separation and tolerance, azimuth, dip angu-lar tolerance, and bandwidth. Several directions can beexplored at the same time, making it easy to search for ani-sotropy. Variogram, covariance function, and correlogramscan be calculated and plotted (Figure 2). The current ver-sion of SGeMS allows the user to choose among four basicvariogram models and any positive linear combination.These are the nugget effect, the exponential, the spherical,and the Gaussian models. Once the appropriate model is se-lected and adjusted to fit the experimental variogram, theuser can save a parameter file that summarizes all the char-acteristics (i.e., type, sill, ranges) of the fitted variogrammodel. This parameter file can be used during the estima-tion or modeling phase.

Estimation tools include several types of kriging (sim-ple kriging, ordinary kriging, universal kriging, and simplekriging with locally varying mean), indicator kriging, and

Figure 2. A screen capture of the SGeMS GUI showing the controls for variogram modeling.

10 Vol. 47, No. 1—GROUND WATER—January–February 2009 NGWA.org

Page 4: SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applications

simple and ordinary cokriging. A 3D grid must be first de-fined in order to perform the kriging interpolation. Thistask can be done by selecting Objects / New grid fromthe menu option or by simply hitting CTRL-N on the key-board. In the grid creation dialog, the user must specifythe dimensions of the grid, the coordinates of the origin(the lower left corner), and the dimensions of each gridcell. For testing purposes, the reviewers estimated the dis-tribution of a spatial variable in a 31 3 31 3 63 grid usingdifferent types of kriging algorithms. All the algorithmstested were stable and computationally efficient.

SGeMS provides a comprehensive selection of algo-rithms for stochastic simulation. In particular, SGeMSprovides algorithms for both variogram-based stochasticsimulation (e.g., sequential Gaussian simulation) andmultiple-point simulation (e.g., single normal equationsimulation and filter-based simulation). The followinggeostatistical simulations can be performed: sequentialGaussian simulation, sequential indicator simulation, se-quential Gaussian cosimulation, sequential indicatorcosimulation, direct sequential simulation, single normalequation simulation, and filter-based simulation. All thenecessary parameters to run these algorithms can bespecified in the algorithm panel. The reviewers testedonly the algorithms for sequential Gaussian simulationand sequential indicator simulation and, as for the krigingalgorithms, no problems were encountered.

Running the Software in Batch Mode and ExpandabilityEach of the operations performed in SGeMS by

mouse clicks can also be performed by typing lines ofcommands in the command panel. The advantage is thatit is possible to include a list of commands in a script andlet the program execute them sequentially in batch mode.This is particularly important if the user needs to repeatthe same task (e.g., ordinary kriging) multiple times withdifferent input parameters (e.g., search radius and/ornumber of conditioning data). Scripts can be created us-ing an editor that can be activated from the menu options.To perform repetitive actions, SGeMS uses the Pythonscripting language. More details and examples abouthow to create scripts in SGeMS can be found at the follow-ing Web address: http://sgems.sourceforge.net/doc/sgems_scripts.html.

New geostatistical algorithms can be added toSGeMS. These must be written in the form of genericplug-ins in the C11 programming language. Plug-inscan be compiled separately and then called from the mainprogram when needed. Two examples of incorporatingnew geostatistical tools to SGeMS are presented in Liand Caers (2008) and Wu et al. (2008). A tutorial for cre-ating a SGeMS geostatistics plug-in can be found at thefollowing Web address: http://sgems.sourceforge.net/doc/geostatistics_plugin_howto.html.

OutputThe content in the display panel can be exported in

PNG, PS, BMP, and PPM files. The same formats areavailable for exporting specific graphs such as histograms

and variograms. Output data from estimation and simula-tion algorithms can be saved in the same two formats asused for importing data: the GSLIB ASCII format andthe SGeMS binary format.

What We LikedSGeMS provides a comprehensive set of geostatisti-

cal tools wrapped in an easy-to-use GUI. The number ofgeostatistical algorithms that are available is impressive.These include both classical kriging algorithms, instru-ments for multivariate kriging (co-kriging), indicatorkriging, and several types of stochastic simulation algo-rithms. SGeMS is the only software available that pro-vides algorithms for multiple-point statistics simulation.

The GUI is sufficiently intuitive to use and parame-ters input operations are easy to follow. Moreover, thesoftware alerts the user with error messages whenever aninput parameter is not correctly entered. After running anestimation or simulation algorithm, results are directly vi-sualized in the display panel.

Another attractive feature is the possibility of writingscripts and geostatistical plug-ins. Running the programin batch mode can save a considerable amount of time es-pecially if the user needs to repeat the same operationmany times as, for instance, during sensitivity analyses.The fact that the software can be augmented by writinggeostatistical plug-ins makes it possible to customize andupdate SGeMS easily. The mailing lists for technical sup-port can also help both advanced and novice users to ex-change experience and problems.

The reviewers also liked the fact that, even thoughthe GUI makes parameter input operations easy to follow,the user still must know the theoretical basis of geostatis-tics in order to use SGeMS effectively. For example,some software packages allow the user to perform krigingwithout calculating the variogram by using default pa-rameters of doubtful practical and theoretical validity.This is not the case with SGeMS. The user must have atleast a basic knowledge of geostatistical concepts to runthe geostatistical tools that are available.

What We Did Not LikeA noticeable limitation of the visualization panel is

that it is not possible to visualize Cartesian axes and labeldata points or import any kind of base map in either rasteror vector formats. These features would have certainlyhelped the user in localizing data and interpolating resultsmore easily on the display. It is also not possible to con-trol some graphical aspects of output displays such as his-tograms and variograms (e.g., colors, lines widths, fonts).Because of these limitations, the graphical outputs pro-duced by SGeMS may need to be processed with othergraphical softwares for publications and reports.

The downloadable user’s manual needs to be updated.Many of the geostatistical tools currently available in ver-sion 2.0 of SGeMS are not described and therefore theycannot be used unless the user has an advanced knowledge

NGWA.org Vol. 47, No. 1—GROUND WATER—January–February 2009 11

Page 5: SGeMS: A Free and Versatile Tool for Three-Dimensional Geostatistical Applications

of these geostatistical algorithms. It is a welcome develop-ment that a new user’s manual in the form of a referencebook will become available by the end of 2008 that willprobably provide a more complete and up-to-date descrip-tion of the features included in SGeMS. Nevertheless, thereviewers hope a new downloadable manual will be madeavailable soon to keep the open source software up to date.

OverallOnce in while, one might discover a rare gem on the

Internet that is an absolute delight to have. SGeMS issuch a discovery for the reviewers. It is free and yet few,if any, commercial or open source software can match itscapabilities. The number of geostatistical tools includedin SGeMS is very impressive. SGeMS combines an easy-to-use GUI with a theoretical rigor and expandability thatwill please both practitioners and researchers involved ingeostatistical data analysis from routine to very sophisti-cated. According to the user’s manual, SGeMS wasdesigned with the twofold goal of providing a user-friendly software tool with a wide range of geostatisticalalgorithms and an evolving software package whose capa-bilities can be conveniently augmented. The reviewers be-lieve these goals have been fully accomplished.

RankingThe reviewer ranked the software’s capability, reli-

ability, ease of use, and technical support on a scale of 1(worst) to 5 (best). The following rankings are the aver-age of the scores from both reviewers:

Capability: 4.7Reliability: 4.5Ease of use: 4.0Technical support: 4.5

How to Obtain the SoftwareSGeMS’s installation file, source code, and user’s

manual can be downloaded freely from the authors’ Website at http://sgems.sourceforge.net/. The software is dis-tributed under the GNU General Public License.

Our MissionThe goal of Software Spotlight is to help readers

identify well-written, intuitive, and useful software. Inde-pendent reviewers from government, industry, and aca-demia try out full working versions of software packagesand provide readers with a concise summary of their ex-periences and opinions regarding the capability, stability,and ease of use of these packages.

Software Editor Chunmiao Zheng can be reachedat the Department of Geological Sciences, Universityof Alabama, Box 870338, Tuscaloosa, AL 35487;[email protected].

ReferencesDeutsch, C.V., and A.G. Journel. 1998. GSLIB, Geostatistical

Software Library and User’s Guide, 2nd ed. New York:Oxford University Press.

Li, T., and J. Caers. 2008. Solving spatial inverse problemsusing the probability perturbation method: An S-GEMSimplementation. Computers & Geosciences 34, 1127–1141.

Remy, N.N. 2001. GSTL: the geostatistical template library inC++. M.S. thesis, Stanford University, Stanford, California.

Remy, N.N., J. Wu, and A. Boucher. 2008. Applied Geostatisticswith SGeMS: A User’s Guide. Cambridge, UK: CambridgeUniversity Press.

Wu, J., A. Boucher, and T. Zhang. 2008. A SGeMS code forpattern simulation of continuous and categorical variables:FILTERSIM. Computers & Geosciences 34, no. 12: 1863–1876.

12 Vol. 47, No. 1—GROUND WATER—January–February 2009 NGWA.org