Demagnetization Analysis in Excel (DAIE). An open source workbook in Excel for viewing and analyzing demagnetization data from paleomagnetic discrete samples and u-channels

The Demagnetization Analysis in Excel (DAIE) program is a single Microsoft Excel ﬁle designed for viewing and analyzing stepwise demagnetization data of both discrete and u-channel samples in paleomagnetic studies. DAIE is an Excel workbook and has an open modular structure organized in 10 work-sheets. It is designed for easy use and interactive operation; all the commands and choices can be entered using drop-down menus associated to single cells. The standard demagnetization diagrams and various parameters of common use are shown on the same worksheet including selectable parameters and user's choices. The characteristic remanence components may be computed by principal component analysis (PCA) on a selected interval of de-magnetization steps. Saving of the PCA data can be done both sample by sample, and automatically by applying the selected choices to all the samples included in the ﬁle. The whole workbook is free both for use and editing and it is available for download on a dedicated website.


Introduction
The stepwise demagnetization procedures and measurement cycles carried out in modern paleomagnetic studies result in the production of large datasets, which need versatile and fast software for their display and analysis.In particular, technical advances in long-core magnetometers coupled with routine continuous (u-channel) sampling and measurement of sedimentary cores generate a large amount of data that require specific analytical tools for viewing and interpretation.Various software packages for demagnetization data analyses for both u-channel and discrete paleomagnetic samples have recently been developed [e.g., Chadima and Hrouda 2006, Xuan and Channell 2009, Tauxe et al. 2010, Lurcock and Wilson 2012].Besides the advantages linked to their modern analytical features, the development of new software packages is also fostered by the need to overcome the problems linked to the limited capability and the loss of operability of early programs, dependent on obsolete computer languages and/or platforms.For instance, the Apple's abandonment of "Classic" Mac OS has rendered the paleo-magnetic program "Paleomac" described by Cogné [2003], highly inconvenient or impossible to use.
Demagnetization Analysis in Excel (DAIE) is a new program for viewing and analyzing demagnetization data from paleomagnetic discrete samples and u-channels and consists of a single Microsoft Excel workbook.A program which proposed the use of Microsoft Excel for the analysis of demagnetization data from u-channels was also formerly realized by Mazaud [2005].In fact, the widespread diffusion of Excel ensures multiplatform operability and guarantees long term working life, since compatibility and functionality of current Excel files should be most likely maintained during the development of new processors and operating systems.
The DAIE workbook is intended as open source software; all the computations are accessible for user's inspection and improvement.
DAIE is designed for interactive operation: all the options and choices can be selected by drop-down menus associated with distinct cells.All the standard demagnetization diagrams (orthogonal projection diagrams, stereographic projection of unit vectors, variation of remanence intensity during stepwise demagnetization) are featured.The automatic computation of the characteristic remanence components can be done by principal component analysis (PCA) on a selected interval of demagnetization steps, following Kirschvink [1980].Selected demagnetization data may be fitted either by a line, anchored or not anchored to the origin, or by a great circle [Halls 1976].Saving of the PCA results can be done either sample by sample, varying the selected parameters each time, or automatically by applying the same parameters and choices to all the demagnetization data included in the file.
The program has the following features which may be valuable for various users: -Compatibility with nearly all computers; -Easy input of demagnetization data by "copy and paste" from ASCII files; -Easy export of computed parameters and demagnetization plots; -Complete control of the whole workflow and possibility of implementation of the workbook by any user; -Modular structure in distinct worksheets for each type of analyses and plots, in order to make implementation and personalization easier; -Opportunity to use the workbook for educational purposes, since all the computations and analyses are easily traceable and accessible; -Automatic and fast analysis of a large batch of demagnetization data, such as those measured on u-channel samples.

Software description
The DAIE workbook has a modular structure and is organized in 10 worksheets (Figure 1).
The yellow worksheets are those where the user introduces the input data and makes all the choices about parameters and computations.The measured input data are entered in the OriginalData worksheet.The viewing and the analysis of the demagnetization data are done in the Commands_Plots worksheet, which includes all the main demagnetization diagrams, as well as all the selectable and computed parameters.
The blue worksheets are those in which the output of the demagnetization data analysis are stored, either listed as   The red worksheets are those in which all the computations are made.These worksheets are open for inspections and are editable.However, they should not be modified unless the user wants to make functional changes to the software.

Yellow worksheets
OriginalData worksheet -This is the worksheet including the data input.
The data input has been designed with the aim of keeping the structure as simple as possible and minimizing the requirements.Therefore only the bare minimum data are needed.In fact, the required data consist of only 9 parameters (Figure 2).The demagnetization data must be copied from the original measurement data file and pasted in columns A to I of this worksheet.
Column A lists the specimen ID (in case of discrete samples) or the stratigraphic depth or position (in case of u-channels).
Column B lists the demagnetization steps.
Columns C, D and E list the measured magnetic intensities along the X, Y and Z specimen's coordinates respectively.These intensities are computed from the measured magnetic moments along the three orthogonal axes of the specimen, normalized by the actual specimen volume in the case of discrete samples, or by the volume felt by the SQUID response functions in the case of u-channels.The convention for the specimen coordinates is shown in Figure 3. X is along the "reference arrow" drawn on the upper base of a cylindrical sample, Y is on the upper base of the cylinder too and Z is along the physical axis of the cylinder.The samples, both cylindrical or cubic discrete samples and u-channels, are then measured such as the axes of the specimen coordinate system will correspond to those of the magnetometer coordinate system.
Columns F, G, H and I list the conventional orientation angles, namely Sample Azimuth, Sample Dip, Formation Dip Azimuth, Formation Dip.All these data should then be ordered according to column A.
Commands_plots worksheet -This is the worksheet where all the available choices, the demagnetization diagrams and the PCA outputs for the selected specimen are shown (Figure 4).
All the possible settings and choices are listed in dropdown menus associated with the grey cells in columns A-D.
The interval of demagnetization steps for PCA may be chosen by selecting the minimum and maximum values in cells C8 and D8.The default value is "Demag Steps", which implies no PCA.Figure 5 shows the use of the drop-down menu associated with cell C8 to select the minimum step for PCA analysis.
There is the possibility to discard one or two demagnetization step intervals (cells C10, D10 and C12, D12) from graphic display and analysis.Default value in these cells is "Demag Steps", which implies that no step is discarded.For a correct use, the upper step of the interval to be discarded should be entered before than the lower step.If the values of the upper and lower demagnetization steps coincide a single step is discarded.This option may also be used to blow up a given interval of steps in the demagnetization diagrams (e.g., by skipping the first n demagnetization steps, only the remaining steps will be shown).
Two types of fit can be used for PCA analysis: codes "L" and "C" indicate a best-fit line or a great circle, respectively (cell C15).In the first case, the line can be either anchored to the origin (1) or free (2) (cell C17).
Codes S, G and T (cell C19) are used to select the Specimen, Geographic or Tilt-corrected coordinate systems, respectively.
Cells A26-A29 list the conventional codes for the orientation angles and follow the P1-P4 codes defined by AGICO [2009].They are briefly summarized below: P1 is clock value of the direction of the "reference  arrow" drawn on the frontal base of cylinder (Figure 6a).This arrow is the X axis of the specimen coordinate (see also Figure 3).P2 value is 0 or 90.P2=0 if the dip of the frontal side is measured.P2=90 if the plunge of the cylinder (drilling) axis is measured (Figure 6b).
P3 is clock value of the sample azimuth measured in the field (Figure 6c).
P4 refers to the orientation of the mesoscopic foliation elements (e.g., bedding or cleavage) used to compute tilt corrected paleomagnetic data.P4 value is 0 or 90.P4=0 means that azimuth of dip and dip of mesoscopic foliation are measured.P4=90 means that strike (right oriented) and dip are measured.
Alternatively to the grey cells, it is possible to use the colored buttons, which are associated with Visual Basic macros.These buttons may be used for scrolling through the samples, as well as for choosing the best fit type for PCA and the coordinate system.
The grey buttons are also associated with macros that allow saving of the PCA results in the PCA_Output worksheet.The button "Save PCA Data and move to next sample" saves the output data for each single specimen according to the selected parameters; the button "Autosave" automatically saves the output data using the same selected parameters for all the specimens in the file.
The results of PCA are indicated in the yellow colored cells.They include the selected fit type (cell C23; where L = line anchored to the origin, L* = line not anchored to the origin, C = great circle), the lower and the upper selected steps (C25 and C27), the number of steps selected for PCA (C29), the coordinate system (D21), the declination and the inclination of the best-fit line or of the great circle pole (D23 and D25, respectively) and the maximum angular deviation (D27).For every sample, the declination and inclination values computed at each demagnetization step, in specimen, geographic and tilt corrected coordinates, are listed in cells F31 to P52.
The demagnetization diagrams shown in this worksheet include: -Orthogonal projection diagrams (or "Zijderveld diagrams", after Zijderveld [1967]) of vectors measured at each demagnetization step, with projection on the North-South or East-West vertical planes.Black (white) circles indicate projection on the horizontal (vertical) plane.When demagnetization steps are selected for PCA, the corresponding symbols turn to red (for horizontal projection) and to light blue (for vertical projections).The natural remanent magnetization (NRM) projections are marked by a cross superimposed on the circles.The numbers close to the symbols for the vertical planes projections indicate the level of stepwise demagnetization.
-Stereographic (equal area) projection of unit vectors defined at each demagnetization step.Black (white) circles indicate projection on the lower (upper) hemisphere.When demagnetization steps are selected for PCA, the corresponding symbols turn to red (for the lower hemisphere projection) and to light blue (for the upper hemisphere projections).NRM direction is marked by a cross superimposed on the circle.
-Three plots for the variation of the NRM intensity as a function of the demagnetization steps.
The first plot shows the absolute remanence intensity values in SI units (A/m).
The second plot shows the intensity differences (in A/m) between consecutive demagnetization steps.Vector differences are positive if the intensity decreases and negative if it increases.
The third plot uses the sum of vector difference magnitudes (VDS) [Gee et al. 1993] between successive demagnetization steps and shows the remanence intensity decay as a percentage of the initial value.In order to avoid the effect of possible gyromagnetic or spurious remanences acquired at high demagnetization steps, the computation of the VDS is limited to the step corresponding to the minimum intensity value reached during the whole demagnetization treatment.
From the intensity data used to draw this third plot the median destructive field (MDF) and the ΔGRM/ΔNRM parameter are computed (listed in cells R21 and R24, respectively).The MDF is the value of the peak AF necessary to reduce the remanent magnetization intensity to half of its initial value and is a coercivity-dependent rock magnetic pa-  Figure 6.Schematic representation of P1 to P3 conventional orientation codes for standard cylindrical paleomagnetic specimens.a) P1 is used to describe the direction of the "reference arrow" drawn on the frontal base of the cylinder.The "field arrow", which is drawn on the side of the cylinder, marks the direction of drill.b) P2 is used to distinguish between the measurement of the dip of the frontal base of the cylinder (angle W1; P2=0) or the plunge of the cylinder axis (angle W2; P2=90).c) P3 is the clock value of the azimuth measured the field, here visualized by an arrow which need not necessarily be drawn.In fact, the "reference arrow" drawn on the frontal base of the cylinder and the measured azimuth may not coincide.For this reason, different orientation parameters are used to specify how the "reference arrow" is drawn (P1) and how the azimuth of the specimen is measured (P3).
rameter [Dankers 1981].The ΔGRM/ΔNRM parameter was introduced by Fu et al. [2008] with the aim of quantifying the of a gyromagnetic remanent magnetization (GRM) during alternating field (AF) demagnetization.Defining MV as the intensity minimum value during the whole AF treatment, ΔGRM represents the difference between the final intensity value (FV) measured at the last AF step and MV, whereas ΔNRM represents the difference between the initial intensity value(IV) and MV: The ΔGRM/ΔNRM parameter is therefore quite useful as a proxy for the occurrence of magnetic minerals prone to GRM acquisition at high AF peaks, such as greigite.Anyway, a cautionary note should be made about a dogmatic interpretation of this parameter.In fact, random fluctuation of remanence values at high AF steps in fully demagnetized or in high-coercivity specimens may produce positive ΔGRM/ΔNRM values which are not actually due to GRM acquisition.
All the plots are Excel graphs which can be easily modified and customized, as well as easily exported to other graphic software packages.

Blue worksheets
PCA_Output worksheet -This worksheet lists 17 parameters for each sample, which includes all the outputs of the principal component analysis (PCA) and some of the input data (Figure 7).In particular, this worksheet includes: -Sample Number -Sample ID -Fit Type -Coordinate System -Declination from PCA -Inclination from PCA -Maximum angular deviation (MAD) -The lower step selected for PCA -The upper step selected for PCA -The number of steps selected for PCA -The NRM intensity (in A/m) -The MDF (in case of thermal demagnetization it lists the temperature at which the NRM intensity reaches half of its initial value) -The ΔGRM/ΔNRM -The four orientation angles, according to the 12, 0, 12, 0 convention of the AGICO P1-P4 codes.
OutputPlots worksheet -This worksheet includes the output plots from the PCA analysis.All the parameters are plotted as a function of the sample ID (or stratigraphic depth).These plots are particularly useful in the case of uchannel samples to visualize the variation of the magnetic properties through the stratigraphic section.
This worksheet shows (Figure 8): -the variation of the PCA declination and inclination -the variation of MAD and NRM intensity -the comparison of the trends for the NRM intensity and the PCA declination and inclination -the comparison of the trends for the MAD value and the PCA declination and inclination -the variation of the MDF and ΔGRM/ΔNRM parameters.

Red worksheets
These worksheets include all the computations employed by the workbook and should not be edited unless it is intended to change the software.
SelectedSample worksheet -It includes all the main original data for the selected sample.These data are automatically extracted from the OriginalData worksheet by making use of array formulas.
CoordSystems worksheet -It lists and computes the data (X, Y, Z, Declination, Inclination) for the selected sample in the three coordinate systems (specimen, geographic and tilt corrected).
PCA worksheet -It includes all the computations used to calculate the principal component analysis parameters according to Kirschvink [1980].
Zijderveld worksheet -It includes all the data needed to draw orthogonal vector plots and the best-fit line through the demagnetization steps selected for PCA.
Stereo worksheet -It includes all the data needed to draw the equal area projection plot and for drawing great circles from PCA as well as great circle intervals connecting the projection points between consecutive demagnetization steps.
MDF_DGRM worksheet -It includes all the data and computations employed to calculate the MDF and ΔGRM/ΔNRM parameters.

Conclusion and availability
The Demagnetization Analysis in Excel (DAIE) workbook is a software that has been designed to make the analysis of demagnetization data easy and accessible on an application (Excel) widely diffused and available on both the Microsoft Windows and Mac OS X operating systems.The DAIE features allow easy personalization, development and improvement.
The DAIE workbook and the User manual are available for download on a dedicated web site (http://roma2.rm.ingv.it/en/facilities/software/49/daie).The downloadable file is compressed and a password is needed to unzip it.The password can be obtained by request to the author.
A DAIE version without macros, compatible with early versions of Microsoft Excel, is also available and included in the downloadable file.In this version, choices and selections

Figure 1 .
Figure 1.The modular structure of the DAIE workbook.The workbook consists of 10 worksheets which are organized in 3 groups marked with distinct colors.

Figure 2 .
Figure 2. The structure of input data.Only 9 parameters are required in input, listed in columns A to I of the OriginalData worksheet.Input data should be ordered according to column A.
values for distinct parameters (PCA_Output worksheet) or shown in plots and bi-plots as a function of the specimen ID or stratigraphic depth (OutputPlots worksheet).

Figure 3 .
Figure 3.The convention for the specimen coordinate system.See text for discussion.

Figure 4 .
Figure4.The Commands_plots worksheet.This is the main user interface.Choices be made either by drop-down menus associated to grey cells or by colored buttons associated to Visual Basic macros.The figure shows an example referring to specimen 5323.In this case, the choice for PCA was to select the data in the range from 200 Oe to 500 Oe AF demagnetization steps, in the geographic coordinate system, and to fit them by a line anchored to the origin.This best least-square fit line has a declination of 109.7°, an inclination of -49.2° and a MAD of 1.5°.See text for further discussion.

Figure 5 .
Figure 5. Cells and buttons associated with user choices in the Com-mands_plots worksheet.The figure illustrates the use of the drop-down menu in cell C8 to select the minimum step for PCA analysis.

Figure 7 .
Figure 7.The PCA_Output worksheet.Data are stored in columns A to R and each lists the data corresponding to a single specimen.
only possible by drop-down menus associated with grey cells and the choice to save the PCA data applies indiscriminately to all samples contained in the file.

Figure 8 .
Figure 8.The OutputPlots worksheet.This worksheet includes 10 plots showing the variation of various parameters as a function of the sample ID (or stratigraphic depth).