- Technical report
- Open Access
Online plotting applications for paleomagnetic and rock magnetic data
Earth, Planets and Space volume 70, Article number: 139 (2018)
This paper describes the development and release of a series of web-based services to generate plots of paleomagnetic and rock magnetic data. All plotting services require a World Wide Web browser as the user interface. The use of online plotting services facilitates rapid and easy sharing of work of analysis and preliminary results with collaborators who use different platforms and operating systems. To implement these routines, two paleomagnetic data types (stepwise demagnetization and paleodirection) are formally defined. These have been popular among researchers for many decades.
In various fields of Earth sciences, there are methods and pieces of software for visualization of various data. In paleomagnetism and rock magnetism, the Zijderveld diagram (As and Zijderveld 1958; Zijderveld 1967) uses three-dimensional vectors projected onto two planes to represent changes in magnetization during the demagnetizing process and is the most popular method for visualizing paleomagnetic direction. On the other hand, paleomagnetic directions (i.e., the stable directions of each specimen and the mean direction of all samples from a site) are often plotted on equal-area projections. In such plots, the dispersion, error, or confidence interval of the direction (Fisher 1953) is shown as a cone, or a circle projected onto the sphere, and the virtual magnetic poles (VGPs) are also often plotted on the global map.
Because plotting methods such as the Zijderveld diagram are unpopular outside of the subfields of paleomagnetism and rock magnetism, programs for plotting are often produced specifically for magnetic measurements. These software products are distributed in various ways: (1) as software bundled with instruments such as magnetometers; (2) as programs coded by an individual researcher and distributed among colleagues or more widely; or (3) as macros or scripts created for use in general-purpose data visualization software such as Microsoft Excel.
Many of these programs are dependent on the operating system or require special runtime libraries that must be installed individually. Therefore, it can be difficult to share the work of analysis among collaborators who use different computing environments. Here we present a newly developed platform-agnostic web-based service to generate plots of paleomagnetic and rock magnetic data.
Here we provide an outline of, and describe the implementation of, the plotting services. The basic concept was described by Hatakeyama (2015), but additional details are provided here because only a part of the services were introduced in the previous work, using test implementation on a local server, and the text was published in an unreviewed institutional report in Japanese.
The greatest advantage of providing plotting tools as a web service is that the user interface requires only a graphical World Wide Web browser. Web browsers such as Google Chrome are based on open standard protocols (e.g., http), and the behavior of input, output and displaying is almost uniform, so users of the web service have the same experience in any web browser on any operating system. In addition, on each operating system, since the application can use clipboard functions offered by the OS, the user can copy data from other programs, such as a text editor or spreadsheet manager, and paste them into a text box on the website; this property is useful for data visualization.
Paleomagnetism.org (Koymans et al. 2016; http://paleomagnetism.org/), a multifunction web-based service for paleomagnetism and rock magnetism, is based on similar concepts to those of the present study and houses many plotting and analysis tools. This site is attractive because the user interface and drawn materials are sophisticated. On the other hand, the greatest advantage of our service is the simplicity of use, as the interface related to data handling requires only copy and paste operations, instead of uploading formatted data to a server.
To actualize a web-based plotting service, descriptions of both front- and back-end programs are necessary. The front-end programs generate web pages that transfer data and results between the user and the back-end programs. We prepare three front-end pages for each instance of the service. On the first page, the user inputs data via PHP. On the second page, data inputs are displayed for confirmation using PHP scripts, and data files are produced to send to the back-end programs. The third page uses Perl CGI to send data and options to the back-end program, receives results after analysis, and displays results and link buttons to download the figure.
The back-end program is used for analysis and figure generation. The plotting programs for this service were created by our group and are used regularly to display paleomagnetic and rock magnetic results; only minor modifications are necessary for web functionality. The back-end programs use the Perl Data Language (PDL; Glazebrook and Economou 1997) for mathematical analysis and Generic Mapping Tools (GMT; Wessel and Smith 1991) and gnuplot (Racine 2006) for plotting and drawing results.
File format for paleomagentism
Here we provide a technical description of the Kyoto file format used by the proposed services. Many paleomagnetists, especially in Japan, have used the plotting programs Progress and Direction, which draw stepwise demagnetization curves on a Zijderveld diagram and paleodirections on a polar Lambert azimuthal equal-area projection (Hidetoshi Shibuya, http://www.sci.kumamoto-u.ac.jp/earthsci/shibuya/index.html); however, the link for downloadable versions of these applications is presently broken. Early versions of these programs were developed at Kyoto University, Japan. In the 1980s, the original code was written for the PC98 platform architecture; this was the first popular 16-bit computer series developed by NEC and was widely distributed in Japan during the 1980s and 1990s. The PC98 architecture used Intel 8086 series CPUs, and supported BASIC, MS-DOS, and Microsoft Windows operating systems during its history. These PCs were very popular and common in the paleomagnetic laboratories of Japanese research institutions. Since the 1990s, these programs have been ported and developed for the Mac OS architecture and have been released for Mac OS X. Although the data files used by Progress and Direction follow a simple format, requiring only a space-separated values file with the minimum number of columns required to display the paleomagnetic results, the output figures are of the quality required for publication. We now formally define the file format for Progress, Direction, and their derivative programs, which we name KyotoFormat after Fukuma and Xuan (2017). These are the file formats used by our programs, as well as modern versions of Progress and Direction.
KyotoFormat (/P and /D) files are simple text files that contain no binary data. The line break code in the file is different for each of platform; LF (line feed or new line, ASCII hex code 0x0a) in UNIX, Linux, Mac OS X, and other derivatives and CR + LF (carriage return + line feed, 0x0d + 0x0a) in Microsoft Windows. The treatment and display of non-ASCII characters are not standardized, so the output displayed depends on the program used; the use of other non-printing ASCII characters is therefore not recommended. The first line of the file indicates the plot title. In each line (record) below the title, the column delimiter should be either a space (0x20) or tab (0x09) character.
The KyotoFormat/P protocol for input data is used to represent progressive demagnetization curves on a Zijderveld diagram and uses the formatting specifications given in Fig. 1a, which is compatible with the format for the Progress program. The first line, or title line, includes the specimen name. The records beginning on the second line show magnetizations at each demagnetization level, which include the level of demagnetization, declination, inclination, and the intensity of magnetization or magnetic moment. Columns beyond the fourth are not read into the plotting program, so descriptive comments can be included here.
The KyotoFormat/D protocol is used to plot paleomagnetic directions on Lambert azimuthal equal-area projections, and its specifications are given in Fig. 1b, which is compatible with the format for the Direction program. The first line includes the name of the site or region as a title. Each line after the second corresponds to an individual sample or subsite, including the name, declination, and inclination, arranged in columns separated by the delimiters. In the fourth column of each line, the angle of the uncertainty, error, or confidence interval can be included to draw a circle (cone) projected onto the projection, but this is optional.
Usage of online plotting tools
Our online plotting services have been released under the name MagePlot and are available at http://mage-p.org/mageplot/. We currently provide two paleomagnetic analysis tools and two rock magnetic analysis tools, and we introduce their usage below using sample screenshots. In all programs, any type of line break character is acceptable, including CR, LF, or CR + LF, and users do not need to reformat input data. A sample input file for each service is available from the website.
MagePlot/P is a web-based program compatible with the Progress program described above, in which a stepwise demagnetization curve is drawn on a Zijderveld diagram. On the first page (Fig. 2a), users select whether or not coordinates are converted, and regression is calculated as part of the demagnetization process. Raw data are pasted in accordance with the KyotoFormat/P protocol. The data can be directly imported from a text editor or a Microsoft Excel spreadsheet using standard copy-and-paste functionality. If conversion and/or regression are selected, the user inputs a value for the angle of the sample coordinates and/or fitting interval. On the second page, the “Confirm” button sets input data and options, and the “Run” button executes the program (Fig. 2b). Data are then transferred to the back-end analysis program, and results and figures are shown on the third page (Fig. 2c). The figure displayed onscreen is downloadable in a number of file formats, including PNG, EPS, and A4-sized PDF. Users can edit figures for presentation and printing after downloading.
When “Automatic (experimental)” in the “Regression” option is selected, an experimental procedure is adopted for automatic determination of the best-fit interval. The demagnetization levels of the start and end of the best-fit line from principal component analysis (PCA) are selected when the MAD value (Kirschvink 1980), normalized by the unbiased weight defined as the square root of the value with two subtracted from the number of points used for fitting, is minimized.
MagePlot/D is a web-based program, compatible with the Direction program, in which the magnetic directions and their mean are plotted on a polar-centered equal-areal projection. On the first web page (Fig. 3a), users select options for plotting/drawing the mean direction and its 95% confidence interval (α95); drawing the scatter, error, or confidence intervals for all data; and drawing VGPs on the global sphere. Data lines formatted in accordance with the KyotoFormat/D protocol are pasted into a large text box. After clicking the “Confirm” button on the second page to save input data and options, the user clicks the “Run” button to execute the program (Fig. 3b). The results and figure derived from the back-end program are shown on the third page (Fig. 3c), and the figure output is downloadable from the page in PNG, EPS, and A4-sized PDF formats.
For archaeomagnetism in Japan, we include two additional options: the user can restrict the drawing area to − 30° ≤ D ≤ + 30° and + 30° ≤ I ≤ + 70°, and secular variation curves (Hirooka 1977, 1983) can be drawn, reduced from the reference position in Osaka to the site location by keeping the common VGP position.
MagePlot/MB is a web-based program that draws a graph of high-temperature magnetic responses obtained by magnetic suspension balance (Curie balance) NMB-89 by Natsuhara Giken. The output file, in.mbf format with the header from the instrument, can be pasted directly into the text box of the web user interface, and the program will output a downloadable figure. Measurement conditions are extracted from the header and displayed in the figure (Fig. 4). The user can also select options for output normalization and cutoff temperature, below which the magnetization curve is not drawn. This cutoff option is especially useful when plotting data from experiments conducted under vacuum, as precise temperature control of the heater current is difficult under vacuum and the magnetization temperature curve becomes unstable at temperatures below ~ 150 °C. An option for drawing the first-derivative curves of the magnetization helps the user to find the Curie/Néel temperatures easily. These three options are not available in the software bundled with the instrument.
MagePlot/H is a service for plotting the magnetic hysteresis loop (Fig. 5). The readable data format here is the output of VSM/AGM (MicroMag 2900/3900, Lake Shore, PMC), which can be pasted into the text box of the data input window. If data lines include also a column with the values of slope-corrected magnetization that the parallel component due to anti-ferro-, para- and diamagnetism is subtracted from the raw data, two curves (uncorrected and corrected) are drawn. An option for plotting derivatives can be selected to draw the first and second derivatives of the curve. In the future, drawing curves from the output of other instruments and simple applied field (H)—magnetization (J) data will be implemented.
We have developed and released a web-based service to facilitate easy plotting of paleomagnetic and rock magnetic data in any operating system. About 600 and 400 plots have been generated by MagePlot/P and /D since its release in November 2016, respectively, but no usage statistics are available for MagePlot/MB or /H services because they were released recently in March 2018. In the future, we would like to release additional services and prepare guides that enable non-paleomagnetic users to use these services more easily. Additional analysis options will be provided in future releases, including more methods to choose the best interval in the demagnetization diagram using different mathematical techniques (Schmidt 1982; Kent et al. 1983), fitting a hysteresis loop to an unsaturated curve (von Dobeneck 1996; Doubrovine and Tarduno 2006) and calculating the uncertainty of the demagnetization direction from a single specimen, e.g., from sedimentary data (Khokhlov and Hulot 2016).
As JA, Zijderveld JDA (1958) Magnetic cleaning of rocks in paleomagnetic research. Geophys J 1:308–319
Doubrovine PV, Tarduno JA (2006) N-type magnetism at cryogenic temperatures in oceanic basalt. Phys Earth Planet Inter 157:46–54. https://doi.org/10.1016/j.pepi.2006.03.002
Fisher RA (1953) Dispersion on a sphere. Proc R Soc Lond A217:295–305
Fukuma K, Xuan C (2017) Multi-platform applications generated from MATLAB codes for viewing and analyzing demagnetization and directional data. JpGU-AGU Joint Meeting 2017 abstr: SEM20-P14
Glazebrook K, Economou F (1997) PDL: The Perl data language, Dr. Dobb’s Journal: Sep 01. http://www.ddj.com/184410442. Accessed 9 July 2018
Hatakeyama T (2015) On providing user interfaces by web services from non-GUI applications. Bull Inf Process Cent Okayama Univ Sci 36:25–30 (in Japanese with English abstract). http://www.center.ous.ac.jp/pdf/bulletin/bulletin_36.pdf
Hirooka K (1977) Recent trend in archaeomagentic and paleomagnetic studies in quaternary research. Quater Res 15:200–203 (in Japanese with English abstract)
Hirooka K (1983) Results from Japan. In: Creer KM, Tucholka P, Barton CE (eds) Geomagnetism of baked clays and recent sediments. Elsevier, Amsterdam, pp 150–157
Kent JT, Briden JC, Mardia KV (1983) Linear and planar structure in ordered multivariate data as applied to progressive demagnetization of palaeomagnetic remanence. Geophys J R Astron Soc 75:593–621. https://doi.org/10.1111/j.1365-246X.1983.tb05001.x
Khokhlov A, Hulot G (2016) Principal component analysis of palaeomagnetic directions: converting a Maximum Angular Deviation (MAD) into an α95 angle. Geophys J Int 204:274–291. https://doi.org/10.1093/gji/ggv451
Kirschvink JL (1980) The least-squares line and plane and the analysis of paleomagnetic data. Geophys J R Astron Soc 62:699–718. https://doi.org/10.1111/j.1365-246X.1980.tb02601.x
Koymans MR, Langereis CG, Pastor-Galan D, van Hinsbergen DJJ (2016) Paleomagnetism.org: an online multi-platform open source environment for paleomagnetic data analysis. Comput Geosci 93:127–137. https://doi.org/10.1016/j.cageo.2016.05.007
Racine J (2006) gnuplot 4.0: a portable interactive plotting utility. J Appl Econometr 21:133–141. https://doi.org/10.1002/jae.885
Schmidt PL (1982) Linearity spectrum analysis of multi-component magnetizations and its application to some igneous rock from south-eastern Australia. Geophys J R Astron Soc 70:647–655. https://doi.org/10.1111/j.1365-246X.1982.tb05978.x
von Dobeneck T (1996) A systematic analysis of natural magnetic mineral assemblages based on modelling hysteresis loops with coercivity-related hyperbolic basic functions. Geophys J Int 124:675–694. https://doi.org/10.1111/j.1365-246X.1996.tb05632.x
Wessel P, Smith WHF (1991) Free software helps map and display data. EOS Trans Am Geophys Union 72:445–446. https://doi.org/10.1029/90EO00319
Zijderveld JDA (1967) A.C. demagnetization of rocks: analysis of results. In: Collinson DW, Creer KM, Runcorn SK (eds) Methods in palaeomagnetism. Elsevier, Amsterdam, pp 254–286
All of coding, writing and administration of the site have been performed by TH. The author read and approved the final manuscript.
We thank two anonymous reviewers for their constructive and useful comments. We also thank Masaru Kono and Hidetoshi Shibuya for discussions. This study was partly performed under the cooperative research program of the Center for Advanced Marine Core Research, Kochi University (14A016, 14B014, 15A006, 15B006, 16A034, 16B030, 17A033, and 17B033).
The author declares that he/she has no competing interests.
Availability of data and materials
Anyone can use the services with his/her own data noticed in this paper. The author is releasing the code with an open source license (GPL3) on Zenodo.org (URL of ver. 1.0 is in https://zenodo.org/record/1307545), and users can execute the plotting tools on their own environments.
This study was partly funded by JSPS KAKENHI Grant Nos. 24720362, 16H01826, and 17H02420.
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
About this article
Cite this article
Hatakeyama, T. Online plotting applications for paleomagnetic and rock magnetic data. Earth Planets Space 70, 139 (2018). https://doi.org/10.1186/s40623-018-0906-5
- Rock magnetism
- Drawing applications
- Online services