Computers & Geosciences 51 (2013) 34–48

Contents lists available at SciVerse ScienceDirect

Computers & Geosciences journal homepage: www.elsevier.com/locate/cageo

CGDK: An extensible CorelDRAW VBA program for geological drafting Jun-Ting Qiu a,b,n, Wan-Jiao Song b, Cheng-Xin Jiang b, Han Wu c, Raymond M. Dong d a

China University of Geosciences, Beijing 100083, China School of the Earth Sciences and Resources, China University of Geosciences, Beijing 100083, China Geological Lab Center, China University of Geosciences, Beijing 100083, China d University of Chicago, Chicago, IL 60637, United States b c

a r t i c l e i n f o

a b s t r a c t

Article history: Received 20 October 2011 Received in revised form 12 July 2012 Accepted 13 July 2012 Available online 5 August 2012

Corel Geological Drafting Kit (CGDK), a program written in VBA, has been designed to assist geologists and geochemists with their drafting work. It obtains geological data from a running Excel application directly, and uses the data to plot geochemical diagrams and to construct stratigraphic columns. The software also contains functions for creating stereographic projections and rose diagrams, which can be used for spatial analysis, on a calibrated geological map. The user-friendly program has been tested to work with CorelDRAW 13–14–15 and Excel 2003–2007. & 2012 Elsevier Ltd. All rights reserved.

Keywords: VBA CorelDRAW Excel Software CGDK Geological drafting

1. Introduction

2. Features of CGDK

CorelDRAWTM Graphic Suite is a graphic software package produced by the Canadian Corel Corporation that provides powerful tools for drawing geological maps, geological profiles, cross sections, and stratigraphic columns. Although CorelDRAW is one of the most widely used graphic applications in geology, it has several shortcomings. For example, when constructing a stratigraphic column, the user must draw, reposition, resize, and fill shapes manually, which is both time consuming and inaccurate. Additionally, because CorelDRAW does not provide features for plotting diagrams, users must plot diagrams in Microsoft ExcelTM or some other statistical software first before copying and pasting the diagrams to CorelDRAW for modification. Although the above method is widely used, the diagrams moved from Excel to CorelDRAW usually contain many redundant or duplicative shapes and lines, which must be removed before adding comments and explanations to the diagram. In order to improve the efficiency and convenience of geological drafting, this paper presents an extensible CorelDRAW VBA program, Corel Geological Drafting Kit (CGDK) for geologists and geochemists. The main functions of CGDK include calibrating geological maps, creating stereographic projections and rose diagrams, constructing stratigraphic columns and plotting geochemical diagrams. The details of CGDK and several examples of the program are presented in this paper.

2.1. Installation

n

Corresponding author. Tel.: þ861 590 102 2978; fax: þ861 082 326 956. E-mail address: [email protected] (J.-T. Qiu).

0098-3004/$ - see front matter & 2012 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.cageo.2012.07.020

An executable file named ‘‘setup.exe’’ is provided for software installation (Fig. 1a). By double-clicking on this file, users start an installation procedure in which initially an environment test is performed automatically to check whether the computer can run the software. CGDK requires CorelDRAW 13 or later and Excel 2003 or 2007 to be installed on users’ computer. If these requirements are met, the test will pass and a green text message will appear in the lower-left corner of the ‘‘Deploy’’ window (Fig. 1b). Also, the ‘‘Install’’ button will become clickable. After clicking on the ‘‘Install’’ button (Fig. 1b), the program begins to deploy the software files. A few seconds later, a message box will pop up to inform the user of successful deployment (Fig. 1c) and a toolbar with 12 buttons named ‘‘Corel Geological Drafting Kit’’ will be added in the active CorelDRAW workspace (Fig. 1d). The whole procedure will be completed after restarting the operating CorelDRAW application. 2.2. Acquiring data from a running Excel application CGDK supports data acquisition from a running Excel application. The acquisition procedure can be performed by first clicking on the ‘‘Data input’’ button (Fig. 2a) to open or activate an Excel file, then specifying a data range in an Excel spreadsheet (Fig. 2b), and finally adding this range to CGDK by clicking on the

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

35

Fig. 1. CGDK installation. (a) Setup.exe. (b) Deploy window. (c) Message box that informs users of successful installation. (d) CGDK toolbar. Buttons displayed in CGDK toolbar (from left to right) are ‘‘Calibrate map’’, ‘‘Show GPS’’, ‘‘Plot on map’’, ‘‘Move to’’, ‘‘Draw projection’’, ‘‘Common tool’’, ‘‘Stratigraphic column’’, ‘‘Template designer’’, ‘‘Geochemical diagram’’, ‘‘Series editor’’, ‘‘Template manager’’, and ‘‘About’’.

Fig. 2. Acquiring Data from Excel. (a) The ‘‘Data input’’ button, which is shown as an Excel icon (left) is coupled with a ‘‘Data delete’’ button (right). (b) An Excel spreadsheet. (c) Confirmation box. (d) The address of the data range is displayed in the textbox, indicating that the data have been added successfully. (e) The address of the data range is cleared by the program, indicating the data have been removed.

36

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Fig. 3. Saving and loading a template. (a) CGDK toolbar with the ‘‘Template manager’’ button highlighted. (b) The ‘‘Template manager’’ window. (c) A selection area which contains all the template elements. (d) The ‘‘Save template’’ window, in which users enter the name and description for a template. (e) Select a template from the template list. (f) Place the template on CorelDRAW page.

‘‘OK’’ button located in upper-left corner of the screen (Fig. 2c). Once a range is added, its address will be automatically displayed in the textbox on the left side of the ‘‘Data input’’ button, indicating that the data have been added successfully (Fig. 2d). The ‘‘Data input’’ button is always coupled with a ‘‘Data delete’’ button on its right side. By clicking on the ‘‘Data delete’’ button, a selected range will be removed from CGDK and the address of the selected range will be cleared by the program (Fig. 2e). 2.3. Features designed for geochemistry Geochemical diagrams are basic and convenient geochemical analysis tools, helping geochemists classify rock types (e.g., Le Maitre, 1976; Herron, 1988; Frost et al., 2001; Frost and Frost, 2008), study crustal evolution (e.g., Taylor and McLennan, 1995; Rollinson, 2008), distinguish between different tectonic settings (e.g., Pearce and Cann, 1971, 1973; Pearce and Gale, 1977; Wood, 1980; Brown et al., 1984; Pearce et al., 1984), and interpret the provenance of sediments (e.g., Belousova et al., 2002). Particularly valuable is the ability to plot data onto an existing diagram or

template (e.g., MacDonald and Katsura, 1964; Kuno, 1966; Irvine and Baragar, 1971), so users can compare their work with previous works and interpret their own data based on a larger number of statistical results. CGDK offers three main categories of templates: X–Y scatter plots, triangular plots, and ‘‘spider’’ plots. Each category contains a series of templates, such as the total alkalis-silica (TAS) diagram, Alkalis-FeOn-MgO (AFM) diagram, and the primitive mantle normalized diagram. A ‘‘Template manager’’ tool is available for template management. References for the templates offered by CGDK are listed in Appendix A1. Besides the templates offered by CGDK, new templates can be easily developed using the ‘‘Template designer’’ tool, which provides a series of features for the establishment of a template coordinate system, and for the creation of template elements.

2.3.1. Saving and loading a template A diagram template is a group of CorelDRAW standard shapes, which are easy to modify but difficult to manage. The management difficulty arises in distinguishing a specific template from

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

37

Fig. 4. Plotting a geochemical diagram. (a) CGDK toolbar with the ‘‘Geochemical diagram’’ button highlighted. (b) The ‘‘Plot geochemistry diagram’’ window, in which users input the data series for plotting a diagram.

another. CGDK solves this problem by offering a ‘‘Template manager’’ tool, which divides the templates into different groups by category and purpose. A name list is available for users to browse, and an information box is offered to display template descriptions. The ‘‘Template manager’’ window can be opened by clicking on the ‘‘Template manager’’ button in the CGDK toolbar (Fig. 3a). A template group can then be selected from the drop-down list at the top of the ‘‘Template manager’’ window (Fig. 3b). If users need to save a template, they must specify a rectangle selection area on the CorelDRAW page that contains all the template elements (Fig. 3c) and click on the ‘‘Save’’ button (Fig. 3b) to show the ‘‘Save template’’ window (Fig. 3d) where the template name and the description can be added. After inputting the name and the description, users must click on the ‘‘Save’’ button in the ‘‘Save template’’ window to finish the procedure (Fig. 3d). Users can also load a template by selecting one from the list box and clicking on the ‘‘Load’’ button (Fig. 3e). After the operation, the mouse cursor changes into a cross, indicating that the program is ready for users to locate the template. By left clicking on a CorelDRAW page, users can place the template on the page (Fig. 3f).

2.3.2. Plotting a geochemical diagram with a template Once a diagram template has been placed on a CorelDRAW page, the first step in creating a plot is to click on the ‘‘Geochemical diagram’’ button in the CGDK toolbar (Fig. 4a) to open the ‘‘Plot geochemistry diagram’’ window (Fig. 4b). The ‘‘Plot geochemistry diagram’’ window, whose components change with each template category, has the ability to distinguish between different categories of templates.

After opening the ‘‘Plot geochemistry diagram’’ window, a data acquisition procedure is required. The method of adding data has been described in Section 2.2, while the examples of data series used to create different categories of diagrams are displayed in Fig. 5. Triangular diagrams need three series of data for the Top, Left, and Right axes (Fig. 5a), X–Y scatter diagrams require two series of data for the X and Y axes (Fig. 5b), and spider diagrams need only one data series for the Y axes. For spider diagrams, users must specify whether the Y values are arranged in columns (Fig. 5c) or in rows (Fig. 5d) by selecting the corresponding option button in the ‘‘Plot geochemistry diagram’’ window. After inputting the entire data series for a sample, users must click on the ‘‘Add’’ button to add the current sample series into CGDK series list (Fig. 4b). Usually, several series of samples may be added, so it is recommended to enter a name for identification before adding the series to the list. Finally, users click on the ‘‘Plot’’ (Fig. 4b) button to create a geochemical diagram. The results are shown in Fig. 5e.

2.3.3. Customizing a sample series In a default situation, the data points in one sample series are represented by rectangles and organized in a CorelDRAW shape group object (Fig. 6a). The filling color, border width, line style, and text font of these data points can be easily modified by using the tools offered by CorelDRAW. Additionally, CGDK provides a ‘‘Series editor’’ tool to automatically replace rectangles with custom symbols. By clicking on the ‘‘Series editor’’ button (Fig. 6b) in the CGDK toolbar, users can open the ‘‘Series editor’’ window (Fig. 6c). Before replacing data, users must set a custom symbol by selecting one (Fig. 6d) and clicking on the ‘‘Set symbol’’ button located in the ‘‘Series editor’’ window (Fig. 6c). To perform

38

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Fig. 5. Examples of geochemical diagrams plotted by CGDK. (a) Data series for plotting a triangular diagram. (b) Data series for plotting an X–Y scatter diagram. (c) and (d) Data series for plotting a spider diagram. (e) The outputs of geochemical diagrams.

the replacement, users must select a sample series desired to be replaced (Fig. 6e) and click on the ‘‘Replace’’ button (Fig. 6c). The result is shown in Fig. 6f.

2.3.4. Creating a new template Although several templates are available for geochemical analysis, new ones can be supplemented to handle additional geochemical problems. Usually, a geochemical diagram contains a frame that defines diagram size, a coordinate system, and graphic elements, such as axes, classification lines, data points, and labels. The frame and labels can be created by using the tools provided by CorelDRAW, whereas other elements, including the coordinate system, axes, classification lines, and data points must be created with ‘‘Template designer’’ tool. The ‘‘Template designer’’ window consists of three pages: (1) Coordinate, (2) Axis, and (3) Marks. Users can switch between different pages by clicking on the buttons at the top of the ‘‘Template designer’’ window. Once a frame is selected, a calibration procedure can be performed by clicking on the ‘‘Coordinate’’ button and defining the boundary values. The triangular template requires no boundary value, the X–Y scatter diagram requires four values for the left, right, top, and bottom boundaries, and the spider diagram requires two values for the top and bottom boundaries as well as a series of data obtained from Excel for the normalizing values. After calibration, axes can be added by

clicking on the ‘‘Axis’’ button and defining the axis interval values in the textbox where commas are employed to separate the values. The classification lines and data marks can be defined in the ‘‘Marks’’ page. The method of creating classification lines and marks is similar to that of creating axis. The following example shows how to create a TAS (Le Maitre et al., 1989) template with the ‘‘Template designer’’ tool. First, click on the ‘‘Template designer’’ button (Fig. 7a) to open the ‘‘Template designer’’ window and choose a diagram type (Fig. 7b) from the drop-down list at the top of the ‘‘Template designer’’ window. Here, the second option ‘‘Scatter diagram’’ should be selected since TAS is an X–Y scatter diagram. Then, create a template frame by drawing a rectangle on a CorelDRAW page (Fig. 7c), build up the coordinate system for the frame by defining the left, right, top, and bottom values in the textboxes in the ‘‘Template designer’’ window (Fig. 7b), and click on the ‘‘Establish’’ button (Fig. 7b). Next, click on the ‘‘Axis’’ button (Fig. 7d), enter interval values in X-axis and Y-axis textboxes using commas to separate each number, and click on the ‘‘Draw axis’’ button (Fig. 7d). Finally, click on the ‘‘Marks’’ button, input the coordinates of each turning node of a classification line, and click on the ‘‘Draw curve’’ button (Fig. 7e). Fig. 7f shows the relevant information that has been added for the creation of the classification lines in a TAS diagram. Users can also employ the tools offered by CorelDRAW to add labels to the template (Fig. 7g). In addition, CGDK provides alternative ways to create a diagram template. For example, it allows users to develop templates with bmp

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

39

Fig. 6. Customizing a series. (a) Use tools offered by CorelDRAW to customize data points. (b) CGDK toolbar with the ‘‘Series editor’’ button highlighted. (c) The ‘‘Series editor’’ window. (d) Select a legend symbol. (e) Select the sample series desired to be replaced. (f) The rectangles are replaced with stars.

(Bitmap) pictures. The following example shows how to use a bmp format diagram to create a 10,000nGa/Al vs. Nb template: First, copy a.bmp image from an article (e.g., Wong et al., 2009) and paste it to CorelDRAW (Fig. 8a). To calibrate the template, first draw a frame whose left, right, top, and bottom borders overlap with the original grid lines (Fig. 8a). Next, open the ‘‘Template designer’’ window, choose a diagram type, input the left, right, top, and bottom values according to the overlapped grid lines, and click on the ‘‘Establish’’ button (Fig. 8b). Finally, hide the frame and use ‘‘Template manager’’ to save the template (Fig. 8c). The method of creating a template with a.bmp image is less time consuming than the former method since an existent diagram is used as a background as opposed to having to create the graphic elements, but depends on the availability of a highresolution.bmp image. In order to check the accuracy of plotting on the template created by this method, the geochemical data of Baijuhuajian granite (Wong et al., 2009) has been re-plotted on this template. The new plotted data points represented by stars overlap the original data points marked by rectangles. Fig. 8d

displays the results and indicates that the calibration of the template is accurate.

2.4. Features designed for stratigraphy Stratigraphic columns are widely used for stratigraphic unit division and comparison (e.g., Vogel et al., 1998; Michelsen and Clausen, 2002; Vilas et al., 2003). They can also be used to reflect the changing deposition environment (e.g., Weissheimer de Borba et al., 2004). In some cases, elements of a stratigraphic column can be drawn by rectangles and filled with specified patterns and symbols that represent different rock types. The height of a rectangle normally represents thickness of a rock layer (Miall, 1984; Tucker, 1988), while the width normally represents the average grain size of the layer (Krumbein and Sloss, 1963). In modern stratigraphic studies, other types of columns and diagrams, such as magnetostratigraphic columns, magnetostratigraphic diagrams, chronostratigraphic columns, element concentration diagrams, and temperature change diagrams are also

40

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Fig. 7. Creating a template. (a) The ‘‘Template designer’’ button in CGDK toolbar. (b) The ‘‘Template designer’’ window. (c) Draw a rectangle. (d) Create axis intervals. (e) Create the classification lines. (f) Relevant information that has been added on the TAS template (g) Use text tools provided by CorelDRAW to add labels to the template.

provided along with stratigraphic columns (e.g., Cirilli et al., 2009; Glen et al., 2009).

2.4.1. Drawing a stratigraphic column During the process of creating a stratigraphic column, CGDK first reads the thickness and grain size data and creates rectangles with different heights and widths before trying to fill each rectangle based on its lithology. A rectangle whose lithology is not registered will automatically be unfilled by the program. The lithology registration can be done in the ‘‘Lithology’’ window where there are two list boxes. The right list box displays all the lithologies that have been registered in the previous work, while the left list box displays the lithologies of the rectangles that are going to be filled. Registered lithologies in the left list box are marked so they can be distinguished from the unregistered lithologies. To perform a registration, choose an unregistered lithology from the left list box, select a legend shape filled with the desired colors or patterns from the CorelDRAW page, and click on the ‘‘Set’’ button. The registered lithology will be stored by CGDK for future use. The following example shows the instructions for creating a stratigraphic column: First, click on the ‘‘Stratigraphic column’’ button in the CGDK toolbar (Fig. 9a) to show the ‘‘Draw stratigraphic columns’’

window (Fig. 9b). Then, get the thickness, grain size and lithology data from an Excel file (Fig. 9b). Next, click on the ‘‘Set lithology’’ button (Fig. 9b) to show the ‘‘Lithology’’ window (Fig. 9c). Choose an unregistered lithology from the left list box (Fig. 9c), select a legend shape from the CorelDRAW page (Fig. 9d), and click on the ‘‘Set’’ button (Fig. 9c). After all legends have been registered, click on the ‘‘OK’’ button (Fig. 9c). Next, draw a rectangle whose height represents the total thickness of all layers and whose width stands for the maximum grain size of all layers (Fig. 9e). Finally, click on the ‘‘Draw’’ button (Fig. 9b) to build the stratigraphic column (Fig. 9e).

2.4.2. Drawing other columns Besides stratigraphic columns, CGDK provides three other categories of columns, including the polyline, smooth line, and magnetostratigraphic columns. Users can choose a column type from the drop-down list at the top of ‘‘Draw stratigraphic columns’’ window (Fig. 10a). The polyline (Fig. 10b) and the smooth line (Fig. 10c) columns need two data series for ‘‘Thicknesses’’ and ‘‘X values’’, where the ‘‘X’’ may represent grain size, element concentration, or another feature of a layer. For example, if ‘‘X’’ stands for grain size, the columns can be used to reflect the sea level change during periods of deposition formation (Nørgaard-Pedersen et al., 2006).

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

41

Fig. 8. Developing a template with a BMP picture. (a) Copy a BMP picture from an article and draw a rectangle. (b) Input the coordinate information of the template. (c) Hide the rectangle and save the template with ‘‘Template manager’’. (d) The geochemical data of Baijuhuajian granite are re-plotted on the template and are represented by red stars that overlap the original data points, indicating an accurate calibration of the template.

The magnetostratigraphic column (Fig. 10d) requires two data series for the thicknesses and polarities. The method of creating a magnetostratigraphic column is similar to that of building a stratigraphic column as described in Section 2.4.1. 2.4.3. Drawing diagrams In Sections 2.3.2 and 2.3.4 we introduced the methods for creating templates and plotting geochemical diagrams, and these methods can also be used to create diagrams for stratigraphic analysis. The following example shows how to create a TOC (Total Organic Carbon) vs. depth diagram. First, duplicate the rectangle that has been used for creating a stratigraphic column (Fig. 11a). Then, open the ‘‘Template designer’’ window, choose ‘‘Scatter diagram’’ from the drop-down list, input the left, right, bottom and, top values, and click on the ‘‘Establish’’ button (Fig. 11b). Next, open the ‘‘Plot geochemical diagram’’ window (Fig. 11c), enter the X and Y values (Fig. 11c and d), click on the ‘‘Add’’ button, select the ‘‘Draw connecting curve’’ checkbox, and click on the ‘‘Plot’’ button to draw the diagram (Fig. 11a). In some studies (e.g., Brault et al., 2004; Mazumder and Sarkar, 2004), rose diagrams are used to indicate paleocurrent directions. A series of rose diagrams along with a stratigraphic column reflect changes of paleocurrent directions through time (Fig. 11e), which is significant for basin analysis. The rose diagram can be created by CGDK, and the methodology will be described in Section 2.5.2. 2.5. Features designed for field geology 2.5.1. Convenient tools for filling shapes and areas A geological map is used to show geological features of an area. Rock types and stratigraphic units are shown in different colors, patterns and symbols to indicate where they are exposed in the area.

CorelDRAW provides several widely used tools, such as burette and paint barrel to copy and assign filling and outline styles from a legend to a specified shape or area. In some cases, however, users must flip between burette and paint barrel frequently, which is both tedious and inconvenient. CGDK provides a smart filling tool to solve this problem. The tool can memorize the filling and outline styles of a legend when left clicking on the legend with the ‘‘Shift’’ key pressed, and can assign the remembered styles to a specified shape or area when clicking on the area with the ‘‘Shift’’ key released. The following example shows the procedure: First, click on the ‘‘Common tool’’ button to open the ‘‘Common tools’’ window (Fig. 12a) where there are two options (‘‘Fill’’ and ‘‘Outline’’). With the first option (‘‘Fill’’) selected, the program fills the specified area with the memorized fill style, and with the second option (‘‘Outline’’) selected, the program assigns the outline style to the specified shape. Then, click on the ‘‘Smart fill’’ button (Fig. 12b). Next, click on a legend shape with the ‘‘Shift’’ key pressed (Fig. 12c). Finally, click on an area with the ‘‘Shift’’ key released to assign the memorized style to the area (Fig. 12d). Continue clicking on the areas desired to be filled (Fig. 12e) before pressing ‘‘ESC’’ key to end the procedure. Not only can the ‘‘Smart filling’’ tool be used to fill shapes, but it can also be used to modify geological boundaries, such as faults and unconformities (Fig. 12f). 2.5.2. Creating stereographic projections and rose diagrams Stereographic projections and rose diagrams are important tools for structural analysis. The stereographic diagrams of joints, faults, folds, and cleavages along with a geological map help the user determine the stress field of an area (e.g., Whitaker and Engelder, 2005). Rose diagrams of bedding orientations and pebbles reflect paleocurrent directions (e.g., Franks et al., 1959) and can thus be used to interpret the evolution of basins and orogenic belts (e.g., Maejima et al., 2004).

42

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Fig. 9. Drawing a stratigraphic column. (a) The ‘‘Stratigraphic column’’ button in CGDK toolbar. (b) The ‘‘Draw stratigraphic columns’’ window. (c) The ‘‘Lithology’’ window. (d) Select a legend shape for a lithology. The registered lithology will be stored for future use. (e) The stratigraphic column that is created by CGDK. A legend list is also created along with the stratigraphic column.

To create a stereographic projection or rose diagram with CGDK, users need to follow the steps below: Click on the ‘‘Draw projection’’ button (Fig. 13a) to open the ‘‘Projection & diagram’’ window, obtain azimuth and dip data from an Excel file (Fig. 13b), and draw a circle (Fig. 13c). If a stereographic projection is to be created, users must specify the type of structure (planar or linear) (Fig. 13b), whereas if a rose diagram is to be created, users must define the type (strike, azimuth or dip) of rose diagram by selecting the corresponding option in the ‘‘Projection and diagram’’ window (Fig. 13b). Finally, click on the ‘‘Projection’’ or ‘‘Rose diagram’’ button to create a stereographic projection or rose diagram (Fig. 13b). The results are shown in Fig. 13d. 2.5.3. Calibrating a UTM geological map The coordinate system in CorelDRAW is orthogonal with the origin located in the lower-left corner of the CorelDRAW page. Positions in this coordinate system are measured in document unit, rather than latitude and longitude. Although linear interpolation

may be used to convert latitudes and longitudes into X and Y coordinates, this method works only on small-sized maps with large scales at low latitudes. Because the earth is three-dimensional, several map projections (e.g., Mercator, Gauss–Kruger, Universal Transverse Mercator (UTM), and Lambert), and many datum planes (e.g., WGS84, NAD83, GRS 80, WGS72) have been used to represent its surface on plane maps. As long as we know the map projection information, the datum plane and several calibration points with latitudes and longitudes, we can use these datasets to calibrate the map and exploit the datasets to represent other positions on the same map. A UTM conversion file1 has been revised and used to develop a feature of CGDK that allows users to calibrate a UTM WGS84 map with two calibration points. By clicking on the ‘‘Calibrate map’’ button in the CGDK toolbar, users start a calibration procedure during which users are prompted

1

http://home.hiwaay.net/  taylorc/toolbox/geography/geoutm.html.

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

43

in Fig. 15 shows that the data points are consistent with the guidelines intersections, indicating a good calibration.

3. Advantages of CGDK 3.1. Data acquisition Other software packages have been developed to plot geochemical diagrams, such as Newpet (Clarke, 1993), Igpet (Carr, 1995), and MinPet (Richard, 1997). However, these programs access only plot functionalities without linking to a spreadsheet. Users must convert an Excel file into an external file with a specific format before and after data processing. By providing an interface for importation directly from Excel to CorelDRAW, CGDK aims to integrate the data storage and manipulation advantages of Excel with the powerful vector drawing and editing features of CorelDRAW. This interface has three benefits: (1) the program can obtain data without format conversion and avoid importing useless data, (2) users may select data flexibly (for example, by row, by column, or even from different rows and columns in different sheets), and (3) CGDK obtains data from a running Excel application, which means all the features provided by Excel, such as autofill, data sort, and macros can be used during the data acquisition process. 3.2. Plotting geochemical diagrams with graphic-based templates

Fig. 10. Other available columns provided by CGDK. (a) Polyline column. (b) Smooth line column. (c) Magnetostratigraphic column.

to specify two points with different longitudes and latitudes and give their geographic coordinates (Fig. 14a). The two calibration points must be in the same UTM zone so that the zone number and central meridian can be determined by CGDK. The map will be calibrated after the point specification and will be available for plotting data and representing other positions. If users want to obtain the latitude and longitude of an arbitrary point on the map, they can click on the ‘‘Show GPS’’ button and move the mouse cursor to the point. The latitude and longitude will be displayed in the floating window next to the mouse cursor (Fig. 14b). By clicking on the ‘‘Show GPS’’ button again, users can close the floating window. The method of plotting data on a calibrated map is similar to that of plotting data on geochemical diagrams. First, click on the ‘‘Plot on map’’ button, click on a legend symbol, and click on the ‘‘Set symbol’’ button. Next, obtain latitudes and longitudes from an Excel file, and click on the ‘‘Plot’’ button (Fig. 14c). In order to evaluate the accuracy of the calibration, the geographic coordinates of some guideline intersections have been plotted on a calibrated 1:250,000 geological map from USGS2. The result displayed

2

http://geopubs.wr.usgs.gov/open-file/of01-262/PULL-MAP.PDF.

Microsoft Excel is widely used by geochemists for data storage and analysis, but only manual data organization and basic X–Y plots are available for data interpretation (Wang et al., 2008). Although several previous macro programs have been written for plotting triangular and spider plots in Excel (e.g., Christie and Langmuir, 1994; Sidder, 1994; Marshall, 1996), these programs do not meet present geochemists’ needs because they are not capable of adding new diagram types for current geochemical analysis. GeoPlot (Zhou and Li, 2006) and GCDPlot (Wang et al., 2008) are the latest macro programs with powerful functions for plotting triangular and discrimination diagrams, the capability of adding new diagram types, and the friendly user interface. However, the two programs provide data-based templates whose elements, including lines of various classifications, data points, and labels are exactly defined in VBA macros or configuration files, meaning these templates are difficult to update or share. Additionally, the appearances of these templates rarely meet publication requirements, so users must modify them prior to publication. The modifications must be repeated every time a new diagram is created. CGDK introduces the concept of a graphic-based template. In contrast to an abstract data-based template, the graphic-based template is concrete and can be easily modified and updated. The template is a standard CorelDRAW shape group object, which can be stored and shared conveniently. When plotting data on a template that has been optimized to meet publication requirements, users can focus on customizing data points and adding comments and explanations rather than modifying the whole diagram. Additionally, a graphic-based template can be used with flexibility to create diagrams for other geological analysis, such as TOC vs. depth diagram for stratigraphic analysis. 3.3. Creating stratigraphic columns along with other columns and diagrams Since the construction of a stratigraphic column is usually very time consuming, a series of applications have been provided such

44

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Fig. 11. Constructing diagrams with stratigraphic column. (a) Duplicate a rectangle. (b) Establish coordinate system for the rectangle. (c) Input the X and Y values. Note: ‘‘Draw connecting curve’’ option must be selected. (d) Data used to create the diagram. Note: Depth is Y axis, while TOC is the X axis. (e) Rose diagrams with a stratigraphic column.

as PRIZM3, DBSond4, LogView5 and Winbohr6 to solve this problem. However, these software packages are mostly designed for hydrocarbon exploration companies and many of the functions are not useful for many geologists. StratDraw (Hoelzel, 2004) is a simple freeware for building stratigraphic columns. It is written in VBA and runs on the widely distributed application CorelDRAW. Although it draws stratigraphic columns accurately, it has three shortcomings: (1) the data input is cumbersome because users must convert an Excel data sheet into a TXT file, (2) it fills stratigraphic columns with colors not patterns (Hoelzel, 2004), and (3) the color selection is based on grain size, not on lithology, which makes it hard for geologists to distinguish between different rock types accurately. CGDK can read data from and Excel file without data conversion. It fills stratigraphic columns with different colors, symbols and patterns automatically based on lithologies. Other columns and curves, such as magnetostratigraphic columns, magnetostratigraphic curves, chronostratigraphic columns, and element concentration curves are also available to help geologists understand the history of sedimentary evolution in different dimensions.

4. Conclusion and significance Stereographic projections, rose diagrams, stratigraphic columns, and geochemical diagrams are important tools for geologists and geochemists to interpret the rock characteristics, 3 4 5 6

http://www.geographix.com/products/default.htm. http://www.geoandsoft.com/english/dbsex02.htm. http://www.rockware.com. http://www.idat.de/jsfr/index_dj.html.

structures and sedimentary strata, and to further understand the geological evolution of a region. However, drawing these graphics can often be time consuming. CGDK partly implements the automation of geological drafting in CorelDRAW, which can visualize a large amount of data in a short period of time. The graphics created by CGDK can be fully edited in CorelDRAW. CGDK is written in VBA and runs on CorelDRAW 13 or later, which means that VBA can be used not only in Microsoft Office, but can also be implemented in other graphic applications. With VBA, the program can easily facilitate data transportation between two different programs without data conversion or importation as required by most other available programs. Besides plotting geochemical diagrams on existing templates, CGDK also supports the creation of new templates that can be easily updated, modified, shared, and managed. This feature has not been present in other programs. Additionally, CGDK offers a feature to fill stratigraphic columns with colors, symbols or patterns automatically to distinguish different lithologies. Some other columns and diagrams, such as magnetostratigraphic columns and element concentration diagrams for stratigraphic research are available as well. CorelDRAW is not a GIS program, so it does not support geographic coordinates. CGDK makes up for this shortcoming by providing features for map calibration and coordinate transformation so users can easily find the latitude and longitude of a point. Although this feature presently works only on UTM WGS84 maps, the development of the VBA classes for other projection conversions is now being undertaken. These classes will be available in the next version of CGDK. CGDK is a freeware designed for geochemists and geologists. The software as well as several examples and outputs can be downloaded from our Windows Live group page (https://groups. live.com/tmgr).

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

45

Fig. 12. Filling areas and modifying geological boundaries. (a) The ‘‘Common tool’’ button. (b) The ‘‘Common tools’’ window. Selecting the ‘‘Fill’’ option will command the program to fill a specified area, while clicking the ‘‘Outline’’ option will assign an outline style to a specified area. (c) Obtain the filling and border style by clicking on the legend with the ‘‘Shift’’ key held down. (d) Assign the filling style to the specified area by clicking on the area with the ‘‘Shift’’ key released. (e) Continue clicking on other areas to fill them. Users can fill more than one area before pressing the ‘‘ESC’’ key. (f) Modify a fault by copying and assigning the style of the legend.

Fig. 13. Creating projections and rose diagrams. (a) The ‘‘Draw projection’’ button. (b) The ‘‘Projection & diagram’’ window, in which users enter the azimuth and dip data and chose a diagram type. (c) Draw a circle. (d) Different stereographic projections and rose diagrams created by CGDK.

46

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Fig. 14. Calibrating a UTM WGS84 map. (a) Calibrate a map by giving two calibration points. (b) Show GPS coordinate. (c) Plot data on map. Note: users must set a legend before plotting data on the map.

Fig. 15. Result from calibration check. The data points are consistent with the intersections of the guidelines, indicating a good calibration.

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

47

Table A1 Templates offered by CGDK for trial. Template group

Template type Template name

Purpose

Reference

Rock classification Rock classification Rock classification

X–Y scatter X–Y scatter X–Y scatter

TAS diagram for volcanic rocks TAS diagram for intrusive rocks Na2O–K2O diagram

Le Maitre et al., 1989 Middlemost, 1994 Le Maitre et al., 1989

Rock classification

X–Y scatter

SiO2–K2O diagram

Classify volcanic rocks Classify intrusive rocks Classify ultrapotassic, shoshonitic and calc-alkaline rocks Classify calc-alkaline and tholeiite rocks

Rock classification Rock classification Rock classification Rock classification Tectonic environment Tectonic environment Tectonic environment Tectonic environment Tectonic environment Petrogenesis Petrogenesis Petrogenesis Petrogenesis Petrogenesis Normalized diagram Normalized diagram

Triangular X–Y scatter Triangular X–Y scatter X–Y scatter X–Y scatter X–Y scatter X–Y scatter Triangular X–Y scatter X–Y scatter X–Y scatter X–Y scatter X–Y scatter Spider Spider

Le Maitre et al., 1989; Rickwood, 1989 AFM diagram Classify calc-alkaline and tholeiite rocks Irvine and Baragar, 1971 A/NK—A/CNK Diagram Classify metaluminous and peraluminous rocks Maniar and Piccoli, 1989 An–Ab–Or diagram Classify granitic rocks Barker, 1979 (Nb/Y)—(Zr/Ti) diagram Classify volcanic rocks Winchester and Floyd, 1977 (YbþTa)-Rb diagram Identify tectonic environment Pearce et al., 1984 Y–Nb diagram Identify tectonic environment Pearce et al., 1984 Yb–Ta diagram Identify tectonic environment Pearce et al., 1984 (Y þNb)-Rb diagram Identify tectonic environment Pearce et al., 1984 (Ti/100)-Zr-(Y  3) diagram Identify tectonic environment Pearce and Cann, 1973 (10,000  Al/Ga)-Nb Distinguish A-type, I and S-type granites Whalen et al., 1987 (10,000  Al/Ga)-Zr Distinguish A-type, I and S-type granites Whalen et al.,1987 K2O–Na2O diagram Distinguish A-type, I-type and S-type granites Collins et al., 1982 (Y/Nb)–(Ce–Nb) diagram Subdivision of A-type granitoids Eby, 1992 206 204 207 204 Pb/ Pb– Pb/ Pb Identify the source of magma Zartman and Doe, 1981 Rare earth element spider diagram REE comparison research Boynton, 1984 Primitive mantle normalized spider diagram Trace element comparison Sun and McDonough, 1989 research

Acknowledgements We wish to thank Jef Caers for his editorial review, two anonymous reviewers for their useful comments and suggestions, Yuelong Chen, Shangguo Su, Danping Yan, Wei Gan, Liang Qiu, Longlong Zhao, Bo Zhang, Ping Li and Yixi Zhang for testing our software, and C. Michael Lesher ([email protected]) for correcting and improving our English.

Appendix A. Templates offered by CGDK for trial See Table A1

References Belousova, E.A., Griffin, W.L., O’Reilly, S.Y., Fisher, N.I., 2002. Igneous zircon: trace element composition as an indicator of source rock type. Contributions to Mineralogy and Petrology 143, 602–622. Brault, N., Bourquin, S., Guillocheau, F., Dabard, M.P., Bonnet, S., Courville, P., Este´oule–Choux, J., Stepanoff, F., 2004. Mio–Pliocene to Pleistocene paleotopographic evolution of Brittany (France) from a sequence stratigraphic analysis: relative influence of tectonics and climate. Sedimentary Geology 163, 175–210. Brown, G.C., Thorpe, R.S., Webb, P.C., 1984. The geochemical characteristics of granitoids in contrasting arc and comments on magma sources. Journal of the Geological Society 141, 411–426. Carr, M., 1995. IGPET. Software Program. Terra Softa Inc., Somerset, NJ, USA. Christie, D.M., Langmuir, C.H., 1994. Automated XY plots from Microsoft Excel. Computers & Geosciences 20 (1), 47–52. Cirilli, S., Marzoli, A., Tanner, L., Bertrand, H., Buratti, N., Jourdan, F., Bellieni, G., Kontak, D., Renne, P.R., 2009. Latest Triassic onset of the Central Atlantic Magmatic Province (CAMP) volcanism in the Fundy Basin (Nova Scotia): new stratigraphic constraints. Earth and Planetary Science Letters 286, 514–525. Clarke, D., 1993. NEWPET Software Program. Department of Earth Sciences, Memorial University of Newfoundland. St. Johns, Newfoundland, Canada. Glen, J.M.G., Nomade, S., Lyons, J.J., Metcalfe, I., Mundil, R., Renne, P.R., 2009. Magnetostratigraphic correlations of Permian-Triassic marine-to-terrestrial sections from China. Journal of Asian Earth Sciences 36 (6), 521–540. Franks, P.C., Coleman, G.L., Plummer, N., Hamblin, W.K., 1959. Vector resultants of cross-stratification dip bearings in Dakota Sandstone, Ottawa County, Kansas. Kansas Geological Survey, Bulletin part 6, 134, plate 1. Frost, B.R., Barnes, C.G., Collins, W.J., Arculus, R.J., Ellis, D.J., Frost, C.D., 2001. A geochemical classification for granitic rocks. Journal of Petrology 42 (11), 2033–2048. Frost, B.R., Frost, C.D., 2008. A geochemical classification for feldspathic igneous rocks. Journal of Petrology 49 (11), 1955–1969.

Herron, M.M., 1988. Geochemical classification of terrigenous sands and shales from core or log data. Journal of Sedimentary Petrology 58 (5), 820–829. Hoelzel, M., 2004. StratDraw: automatic generation of stratigraphic sections from tabulated field data. Computers & Geosciences 30, 785–789. Irvine, T.N., Baragar, W.R.A., 1971. A guide to the chemical classification of the common volcanic rocks. Canadian Journal of Earth Sciences 8, 523–548. Krumbein, W.C., Sloss, L.L., 1963. Stratigraphy and Sedimentation. Freeman and Company, San Francisco, CA 660pp. Kuno, H., 1966. Lateral variation of basalt magma types across continental margins and island arcs. Bulletin of Volcanology 29, 195–222. Le Maitre, R.W., 1976. A new approach to the classification of igneous rocks using the basalt-andesite-dacite-rhyolite suite as an example. Contributions to Mineralogy and Petrology 56, 191–203. Le Maitre, R.W., Bateman, P., Dudek, A., Keller, J., Lameyre, J., Le Bas, M.J., Sabine, P.A., Schmin, R., Sorensen, H., Streckeisen, A., Wooley, A.R., Zanettin, B., 1989. A Classification of Igneous Rocks and Glossary of Terms. Blackwell, Oxford. MacDonald, G.A., Katsura, T., 1964. Chemical composition of Hawaiian lavas. Journal of Petrology 5, 83–133. Michelsen, O., Clausen, O.R., 2002. Detailed stratigraphic subdivision and regional correlation of the southern Danish Triassic succession. Marine and Petroleum Geology 19, 563–587. Maejima, W., Das, R., Pandya, K.L., Hayashi, M., 2004. Deglacial control on sedimentation and basin evolution of Permo-Carboniferous Talchir Formation, Talchir Gondwana Basin, Orissa, India. Gondwana Research 7, 339–352. Marshall, D., 1996. Ternplot: an Excel spreadsheet for ternary diagrams. Computers & Geosciences 22 (6), 697–699. Mazumder, R., Sarkar, S., 2004. Sedimentation history of the Palaeoproterozoic Dhanjori Formation, Singhbhum, eastern India. Precambrian Research 130, 267–287. Miall, A.D., 1984. Principles of Sedimentary Dasin Analysis. Springer, New York 490pp. Nørgaard-Pedersen, N., Austin, W.E.N., Howe, J.A., Shimmield, T., 2006. The Holocene record of Loch Etive, western Scotland: influence of catchment and relative sea level changes. Marine Geology 228, 55–71. Pearce, J.A., Cann, J.R., 1971. Ophiolite origin investigated by discriminant analysis using Ti Zr and Y. Earth Planet Science Letter 12, 339–349. Pearce, J.A., Cann, J.R., 1973. Tectonic setting of basic volcanic rocks determined using trace element analysis. Earth Planet Science Letter 19, 290–300. Pearce, J.A., Gale, G.H., 1977. Identification of Ore-Deposition Environment from Trace Element Geochemistry of Associated Igneous Host Rocks, 7. Geological Society Special Publications 14-24. Pearce, J.A., Harris, N.B.W., Tindle, A.G., 1984. Trace element discrimination diagrams for the tectonic interpretation of granitic rocks. Journal of Petrology 25, 956–983. Richard, L.R., 1997. MinPet. Software Program. MinPet Geological Software, Gatineau, Canada. Rollinson, H., 2008. Secular evolution of the continental crust: implications for crust evolution models. Geochemistry Geophysics Geosystems 9 (12), 1–14. Sidder, G.B., 1994. PETRO.CALC.PLOT, Microsoft Excel macros to aid petrologic interpretation. Computers & Geosciences 20 (6), 1041–1061. Taylor, S.R., McLennan, S.M., 1995. The geochemical evolution of the continental crust. Reviews of Geophysics 33, 241–265.

48

J-T Qiu et al. / Computers & Geosciences 51 (2013) 34–48

Tucker, M.E., 1988. Techniques in Sedimentology. Blackwell Scientific Publications, Oxford 394pp. Vilas, L., Martin-Chivelet, J., Arias, C., 2003. Integration of subsidence and sequence stratigraphic analyses in the cretaceous carbonate platforms of the Prebetic (Jumilla-Yecla Region), Spain. Palaeogeography Palaeoclimatology Palaeoecology 200, 107–129. Vogel, D.C., Vuollo, J.I., Alapieti, T.T., James, R.S., 1998. Tectonic, stratigraphic, and geochemical comparisons between ca. 2500–2440 Ma mafic igneous events in the Canadian and Fennoscandian Shields. Precambrian Research 1998 92 (2), 89–116. Wang, X.R., Ma, W.F., Gao, S., Ke, L., 2008. GCDPlot: an extensible Microsoft Excel VBA program for geochemical discrimination diagrams. Computers & Geosciences 34, 1964–1969. Weissheimer de Borba, A.W., Maraschin, A.J., Mizusaki, A.M.P., 2004. Stratigraphic analysis and depositional evolution of the Neoproterozoic Marica´ formation (Southern Brazil): constraints form field data and sandstone petrography. Gondwana Research 7, 871–886. Whitaker, A.E., Engelder, T., 2005. Characterizing stress fields in the upper crust using joint orientation distributions. Journal of Structural Geology 27 (10), 1778–1787. Wong, J., Sun, M., Xing, G.F., Li, X.H., Zhao, G.C., Wong, K., Yuan, C., Xia, X.P., Li, L.M., Wu, F.Y., 2009. Geochemical and zircon U-Pb and Hf isotopic study of the Baijuhuajian metaluminous A-type granite: extension at 125–100 Ma and its tectonic significance for South China. Lithos 112, 289–305. Wood, D.A., 1980. The application of a Th–Hf–Ta diagram to problems of tectonomagmatic classification and to establishing the nature of crustal contamination of basaltic lavas of the British Tertiary volcanic provinces. Earth Planet Science Letter 50, 11–30. Zhou, J.B., Li, X.H., 2006. GeoPlot: an excel VBA program for geochemical data plotting. Computers & Geosciences 32, 554–560.

Appendix References Barker, F., 1979. Trondhjemites, Dacites and Related Rocks [M]. Elsevier Sci. Pub. Comp., New York. Boynton, W.V., 1984. Geochemistry of the rare earth elements: meteorite studies. In: Henderson, P. (Ed.), Rare Earth Element Geochemistry. Elservier, pp. 63–114.

Collins, W.J., Beams, S.D., White, A.J.R., Chappell, B.W., 1982. Nature and origin of A-type granites with particular reference to southeastern Australia. Contributions to Mineralogy and Petrology 1982, 189–200. Eby, G.N., 1992. Chemical subdivision of the A-type granitoids petrogenetic and tectonic implications. Geology 20, 641–644. Irvine, T.N., Baragar, W.R.A., 1971. A guide to the chemical classification of the common volcanic rocks. Canada Journal of Earth Science 8, 523–548. Le Maitre, R.W., Bateman, P., Dudek, A., Keller, J., Lameyre, J., Le Bas, M.J., Sabine, P.A., Schmin, R., Sorensen, H., Streckeisen, A., Wooley, A.R., Zanettin, B., 1989. A Classification of Igneous Rocks and Glossary of Terms. Blackwell, Oxford. Maniar, P.D., Piccoli, P.M., 1989. Tectonic discrimination of granitoids. Geological Society of America Bulletin 101, 635–643. Middlemost, EAK, 1994. Naming materials in the magma/igneous rock system. Earth-Science Reviews 37, 215–224. Pearce, J.A., Cann, J.R., 1973. Tectonic setting of basic volcanic rocks determined using trace element analysis. Earth Planet Science Letter 19, 290–300. Pearce, J.A., Harris, N.B.W., Tindle, A.G., 1984. Trace element discrimination diagrams for the tectonic interpretation of granitic rocks. Journal of Petrology 25, 956–983.Pearce, J.A., Harris, N.B.W., Tindle, A.G., 1984. Nature and origin of A-type granites with particular reference to southeastern Australia. Contributions to Mineralogy and Petrology 80, 189–200. Rickwood, P.C., 1989. Boundary lines within petrologic diagrams which use oxides of major and minor elements. Lithos 22, 247–263. Sun, S.-s., McDonough, W.F., 1989. Chemical and Isotopic Systematics of Oceanic Basalts: Implications for Mantle Composition and Processes. Geological Society, London, Special Publications, 42: pp. 313–345. Whalen, J.B., Currie, K.L., Chappell, B.W., 1987. A-type granites: geochemical characteristics, discrimination and petrogenesis. Contributions to Mineralogy and Petrology 95, 407–419. Winchester, J.A., Floyd, P.A., 1977. Geochemical discrimination of different magma series and their differentiation products-using immobile elements. Chemical Geology 20, 325–343. Zartman, R.E., Doe, B.R., 1981. Plumbotectonics—the model. Tectonophysics 75, 135–162.