On the effects of wrongly aligned seismogram components for shear wave splitting analysis

Seismic anisotropy inside the Earth’s interior, especially in the upper and lowermost mantle, is commonly studied by measuring shear wave splitting. This is mostly done by the determination of the splitting parameters fast polarization direction and delay time as well as the splitting intensity. The applied techniques highly rely on the correct temporal alignment of the single component traces (vertical, North, East referred to as Z, N, E components) of an earthquake relative to each other. Mixing wrongly aligned recording components would result in misleading and wrong data representations, including the particle motions in both the ZNE and the ray (LQT) coordinate systems and waveforms in the LQT coordinate system. The main pitfall in this context is that start and end times of the single traces in general differ due to data storage details. Unfortunately, the code of the widely used MATLAB based shear wave splitting software package SplitLab contains an error which can cause a wrong relative temporal alignment of the input seismograms in some cases. This effect distorts under certain conditions splitting signals or simulates non-existing ones. We show examples and offer a remedy.


Introduction
Geodynamic or tectonic processes cause deformation inside the Earth's interior leading to a preferred orientation of crystals or structural elements within the rock masses and layered media and by this to elastic or seismic anisotropy [Silver, 1996].Therefore, studying seismic anisotropy can provide important information and constrains on recent asthenospheric mantle flow [Long and Becker, 2010] as well as past (fossil, frozen-in) and present deformation processes in the upper mantle [e.g.Savage, 1999;Long and Silver, 2009;Margheriti et al., 2003;Aragon et al., 2017;Grund and Ritter, 2020] and lowermost mantle (LMM, D'' layer) [e.g.Nowacki et al., 2011;Nowacki and Cottaar, 2021;Lynner and Long, 2012;Deng et al., 2017;Grund and Ritter, 2019].
Since shear (S) wave splitting (SWS; analogue to birefringence in optics) is an unambiguously phenomena of seismic anisotropy, it is commonly used to detect and to quantify anisotropy [Savage, 1999;Long and Silver, 2009;Margheriti and Park, 2021].To do so the splitting parameters the fast polarization direction  and the delay Yvonne Fröhlich et al.
2 time  as well as the splitting intensity  [Chevrot, 2000] are determined. and  are mostly estimated using the rotation-correlation method [Bowman and Ando, 1987] and the eigenvalue or energy-minimum method [Silver and Chan, 1991].For investigating the Earth's mantle core-refracted phases, mainly SKS and SKKS, are favorable [Savage, 1999;Long and Silver, 2009].
The above-mentioned techniques for measuring SWS highly rely on a correct temporal alignment of the single traces, i.e. vertical, North, East or Z, N, E components, respectively, of an earthquake relative to each other.In case of a wrong relative temporal alignment the mixing of different components results in misleading particle motions in both the ZNE and the ray (LQT) coordinate systems as well as wrong waveforms in the LQT coordinate system.This is especially problematic for SKS phases since usually a change from the ZNE to LQT coordinate system is made to better detect these phases and their splitting behavior.Thus, a correct relative temporal alignment is absolutely essential to achieve correct shear wave splitting measurements.A correct alignment is in general important for all processing and analyzing steps relying on the mixing of seismic traces or components.
The main pitfall in this context is that requested (seismological) waveforms from data centers (e.g.IRIS, ORFEUS) have in general slightly different start and end times of the single traces for the specified time window of one earthquake.This is due to storage details of the data.Thus, the users have to make sure or (cross-)check that the traces are temporally aligned relative to each other in a correct way.This can be done based on a reference time, e.g.origin time, or by cutting the traces to their shared time window, i.e. the latest start time and the earliest end time, (Figure 1).
Unfortunately, especially the code of the widely used (229 citations as of beginning February 2022) MATLAB based software package SplitLab [Wüstefeld et al., 2008] contains an error causing a wrong relative temporal alignment under some conditions in some applications and releases.Then fractions of a second are not included in the start time of the input seismograms, leading to a temporal misalignment of the traces.Subsequently, unrecognized wrong shear wave splitting measurements can follow regarding both observation types, i.e.SWS instead of a null split and vice versa, as well as corrupt measurements of splitting parameters and splitting intensity.Previous anisotropy studies based on SWS measurements carried out with SplitLab may be incorrect at least when the versions and options were used which are described in the following.The problem also affects the plugin StackSplit [Grund, 2017], which allows to carry out a multi-event analysis based on the single-event analysis results obtained with SplitLab.
Here, we first outline this general issue and the error in SplitLab together with its impact on StackSplit based on real data examples.Furthermore, we provide recommendations, data for testing by other users and a modification or correction of the relevant SplitLab function which is also included in the new StackSplit version 3.0.Temporal misalignment and SWS analysis 3

Description of the problem
The general effects of a wrong relative temporal alignment of the Z, N, E components of an earthquake are illustrated in Figure 2.
In this example we used a deep earthquake underneath Bolivia (hypocentral depth 274 km) which occurred on 29 June 2001 at 18:35:51 (UTC).The waveforms were recorded at the broadband permanent seismological station Stuttgart (STU) in Southwest Germany which is part of the GEOFON (GE) network [GEOFON Data Centre, 1993] (backazimuth BAZ = 246.5°,epicentral distance Δ = 95.29°).During the pre-processing we removed both, trend and mean, and applied a third-order zero-phase Butterworth bandpass filter with corner frequencies of 0.02 Hz (lower corner) and 0.15 Hz (upper corner).The Z, N, E components were rotated into the LQT coordinate system using the theoretical backazimuth of the earthquake (BAZ = 246.5°)and the theoretical incidence angle of the SKS phase (inc = 9.2°) for better visibility of the phase.
In Figure 2, in the upper (yellow) part the Z, N, E components are correctly aligned and in the lower (green) part they are wrongly aligned by less than one second, for the N and E components by 0.9 s (Figure 2, white boxes with red or green font at the top or bottom of the hodogram of the wrongly aligned traces).For both cases the waveforms in the ZNE coordinate system, the horizontal (E-N) particle motion and the waveforms in the LQT coordinate system are displayed (from left to right).The hodogram in the W-E/N-S plane of the correctly aligned seismograms contains a linear particle motion.Furthermore, only on the Q component a SKS phase-related signal is visible.Thus, there are no clear indications for SWS in the correct waveforms.In contrast, the wrongly aligned

Error in SplitLab
For the purpose of further analysis, we tried to reproduce our shear wave splitting observations made with SplitLab regarding particle motions and waveforms with the Python toolbox ObsPy [Beyreuther et al., 2010;Megies et al., 2011;Krischer et al., 2015].In several cases, we recognized a slightly different temporal alignment of the Z, N, E components.We found that the SplitLab function getFileAndEQseconds.m does not always account for the milliseconds of the start time of the input seismograms when calculating the temporal offset to the origin time of the earthquake.For a sampling interval less than one second, there are three possible scenarios: (i) the start times of all traces have zero milliseconds, (ii) the start times of all traces have the same (non-zero) milliseconds and, (iii) the start times of the traces have different milliseconds.
For (i) there is no impact on the relative time between the traces.For (ii) "only" a common time shift occurs for all three traces, which does not affect the result of the SWS measurement, since this is a relative measurement.However, for (iii) the temporal alignment of the traces relative to each other is changed.As consequences the (E-N or Q-T) particle motions in both the ZNE and the LQT coordinate systems as well as the waveforms in the LQT coordinate system are corrupt leading to a potentially unrecognized wrong SWS measurement.Not taking into account the milliseconds in the start times, the maximum error in the temporal misalignment is one second minus the sampling interval.For a sampling rate of 0.05 s (often used for teleseismic recordings) this error can reach up to 0.95 s what is comparable to typical delay times of 0.4-1.5 s for continental anisotropy [Silver, 1996].In addition, a split may change to a null split or vice versa.Also, the export option "Cut and save as SAC" of SplitLab, i.e. cutting the three traces (Z, N, E) of one earthquake to the shared time window (latest start time and earliest end time) and saving them afterwards as new files, is indirectly affected, since it uses the previous relative alignment of the single components.

Occurrence in the publicly available SplitLab versions
The crucial point regarding the above-described problem in SplitLab is the assignment of the earthquake catalogue with the seismogram data.SplitLab offers (depending on the version) several options regarding filename format and how the start time is extracted (Table 1).If the option "Extract start time from SAC-header" is used, one must be cautious, because only in SplitLab version 1.9.0 [Wüstefeld et al., 2008] the milliseconds are accounted for.
In the SplitLab versions 1.0.5 [Wüstefeld et al., 2008], 1.2.1 [Porritt, 2014], and 1.3.0[Creasy, 2020] the milliseconds are ignored.For the option "Extract start time from filename" with the filename format "RDSEED" the milliseconds are used in all versions.For the other filename formats only seconds are included, for "YYYY_MM_DD_hhmm_stnn.
sac.e" even just minutes (Table 1).Thus, in case of non-zero milliseconds (or seconds) there are wrong start times.
If the milliseconds (or seconds) differ for the single component traces, this leads to a wrong relative temporal alignment of the Z, N, E traces.
Note, that even if the filename does not contain milliseconds, the start time needs not to begin automatically at zero milliseconds.A (re)naming of the traces has not necessarily to be done based on the start times.Therefore, the extraction of the start time from the SAC-header appears to be safer.

Impact on StackSplit
The SplitLab plugin StackSplit [Grund, 2017] (at the moment compatible with SplitLab versions 1.0.5 and 1.2.1) allows to carry out a multi-event analysis based on the previous single-event analysis results obtained with SplitLab.
The four implemented multi-event methods cover the simultaneous inversion of multiple waveforms [Roy et al., Temporal misalignment and SWS analysis 5 2017] and the stacking of error surfaces (stacking without weighting or normalization ("no weight"), Wolfe and Silver [1998], Restivo and Helfrich [1999]).These techniques are recommended to obtain more stable results for weak signals (low signal to noise ratio) and thus a wider and more even backazimuthal coverage, especially for studies based on short-term recording experiments.However, wrong single-event analysis results lead obviously also to wrong multi-event analysis results.Furthermore, StackSplit introduces the correct calculation of the degrees of freedom for the error calculation using the modified equations of Walsh et al. [2013].This is only directly implemented in SplitLab version 1.9.0.

Real data examples
Here we show in details the effect of a wrong relative temporal alignment of the Z, N, E components on the corresponding SWS measurement using seismological data (SKS phase) of two teleseismic earthquakes recorded at two broadband permanent stations: In Figure 3 , 1982].In Figure 3 the waveforms (left) and the particle motions (right) both, in the ZNE (top) and the LQT (bottom) coordinate systems, are displayed.
In these examples the start times were extracted from the SAC-headers.We compare the data representation by the original SplitLab code ("cut by SplitLab data 01", wrong temporal alignment) with the representation by ObsPy ("original data", correct temporal alignment).Clear differences between the observations are visible regarding the shape of the waveforms on the Q and T components and the E-N or Q-T particle motions.The same comparison was conducted for the data representation by our self-modified SplitLab code ("cut by SplitLab data 02", corrected temporal alignment) and the representation by ObsPy.As result we were able to achieve identical observations with SplitLab and ObsPy.In addition to the visual comparison, a calculation of the temporal difference for the Z, N, E components was carried out.First, we determined the temporal difference for each component separately (Figure 3, values in the lower left corners of the hodograms).Then, the temporal difference was estimated between these component-related differences across the components (Figure 3, values in the lower right corners of the hodograms).This value represents the error in the temporal alignment of two components relative to each other.
For SWS measurements using SKS phases the error in the relative temporal alignment of the N and the E components is most problematic.This is clearly visible from the two examples: in Figure 3

Recommendations regarding a correct relative temporal alignment
To control whether seismograms are correctly displayed, for instance regarding waveform, amplitude or relative temporal alignment, by a specific analysis software, we recommend to use at least one other independent software for a cross-check, e.g.ObsPy [Beyreuther et al., 2010;Megies et al., 2011;Krischer et al., 2015] or Snuffler [Heimann et al., 2017].A first visual comparison should reveal larger differences or errors.However, small differences may remain unrecognized.Calculating the difference between the two different visualizations may help, because small amplitude difference will be better visualized.If it is possible, save the seismograms as new files in the same way they are displayed by the software.For an identical display regarding waveforms, amplitude, and relative temporal alignment, etc. a difference of zero is expected between the two representations.Of course, there is also the possibility for a cross-check with other software for shear wave splitting, e.g. in MATLAB SplitRacer [Reiss and Rümpker, 2017], in Python SplitPy [Audet and Schaeffer, 2019], or in Julia SeisSplit [Nowacki, 2019].Repeated processing as well as analysis with other software and comparison of the results across different software packages will help to obtain reliable (splitting) results.This should be done with several traces or events, not only for one example, to avoid verifications by chance.

Data to test by other users
We recommend to use shear wave splitting measurements with known (correct) results as reference to check  6 are provided.For a general comparison of the user's result, e.g.regarding the shape of the E-N particle motion, the SplitLab diagnostic plots for both the wrong and the correct(ed) temporal alignment (without and with consideration of the milliseconds of the start times, respectively) can be used.

Conclusions
We recognize that the shear wave splitting software package SplitLab does not always account for the milliseconds (or seconds) in the start times of the input seismograms.Our real data examples show that the correct relative temporal alignment of the Z, N, E components is essential to achieve correct SWS measurements.A wrong relative temporal alignment results in misleading particle motions in both the ZNE and the LQT coordinate systems as well as wrong waveforms in the LQT coordinate system.Each processing and analyzing step which uses the mixing of traces or components will result in meaningless or wrong results.The different start and end times of the traces of one earthquake are the main pitfall for a wrong relative temporal alignment.Existing anisotropy studies based on a waveform analysis carried out in SplitLab may be at least partly incorrect, if a possible misalignment of the seismic traces was not checked and meaningless SWS measurements may have been conducted.The shear wave splitting measurements were carried out using the MATLAB based software package SplitLab [Wüstefeld et al., 2008] version 1.2.1 [Porritt, 2014] modified for MATLAB R2020b.The Python toolbox ObsPy [Beyreuther et al., 2010;Megies et al., 2011;Krischer et al., 2015] version 1.2.2 [The ObsPy Development Team, 2020] was used to request and process the seismological data.The waveform and particle motion plots were generated with ObsPy and the Python toolbox Matplotlib [Hunter, 2013] version 3.4.3 [Caswell et al., 2021].

Figure 1 .
Figure 1.Schematic visualization of the Z, N, E components of a seismic recording with slightly different start and end times for the specified time window of one earthquake due to the storage details of the data.Arrows indicate the temporal offset to a reference time, here for instance the origin time.Colored areas represent the relative temporal difference between two traces or components.The gray area represents the shared time window according to the latest.

Figure 2 .
Figure 2. Effect of a different temporal alignment of the Z, N, E components relative to each other (left) on the particle motions in the ZNE (and LQT) coordinate system (middle) and the waveforms in the LQT coordinate system (right).As consequence there is an impact on the shear wave splitting measurement (the corresponding SplitLab diagnostic plots are shown in Fig. 4).The selected time window contains the SKS phase.Top in yellow unshifted / correct temporal alignment and bottom in green shifted / wrong temporal alignment.The sampling interval of the traces is 0.05 s.The N and the E components are shifted relative to each other by 18 samples or 0.9 s (white boxes with red or green font at the top or bottom of the hodogram of the wrongly aligned traces, for details on these values see text and Fig.3).During the pre-processing, trend and mean were removed and a third-order zero-phase Butterworth bandpass filter with corner frequencies of 0.02 Hz (lower corner) and 0.15 Hz (upper corner) was applied.The shifted / wrong temporal alignment is caused by the problem that SplitLab does not always account for the milliseconds of the start time of the single traces.

SplitLab
(or any other tool) before analyzing a new dataset.To facilitate such a test, we provide the waveforms used in the three examples of this study for testing by other users.The waveforms (Z, N, E components as SAC-files) of the three earthquakes shown in Figure 2 or Figure 4 as well as Figure 3 (a) or Figure 5 and Figure 3 (b) or Figure

Figure 3 .
Figure 3. Two examples demonstrating how waveforms (left) and particle motions (right) in the ZNE (top) and the LQT (bottom) coordinate systems are affected by a wrong temporal alignment of the Z, N, E components (the corresponding SplitLab diagnostic plots are shown in Fig. 5 and Fig. 6).Both are misleading concerning the shear wave splitting measurement: (a) splitting observation turns out as null split and (b) vice versa.Seismograms (left): E or Q components in cyan and N or T components in red for the correct (solid lines) and the wrong (dotted lines) temporal alignment of the Z, N, E components.Black dotted lines after correction.Hodograms (right): solid yellow line correct ("original data") and dotted green line wrong ("cut by SplitLab data 01") temporal alignment, dotted purple line after correction ("cut by SplitLab data 02").The numbers give temporal differences in samples (sampling interval 0.05 s): lower left corners difference between the wrong and the correct temporal alignment (right top panel green font) as well as between the corrected and the correct temporal alignment (right bottom panel purple font) and lower right corners difference between these differences for the Z, N, E components, respectively.Additionally, for the E and the N components the difference relative to each other is given in seconds (right top panel purple font).

Figure 4 .
Figure 4. SplitLab diagnostic plot of the shear wave splitting measurement on the SKS phase of the earthquake underneath Bolivia on 29 June 2001 at 18:35:51 (UTC) recorded at the station Stuttgart (STU).(a) shifted / wrong relative temporal alignment (without consideration of the milliseconds) and (b) unshifted / correct relative temporal alignment (with consideration of the milliseconds).

Figure 5 .
Figure 5. Analogous to Figure 4 but for the earthquake underneath Argentina on 14 November 2009 at 19:44:29 (UTC) recorded at the station Stuttgart (STU).
Beside general recommendations we provide the seismological data of our examples for testing by other users, a modified or corrected SplitLab function getFileAndEQseconds.m for the publicly available SplitLab versions and a new StackSplit version 3.0 which introduces this modified SplitLab function (SplitLab versions 1.0.5 and 1.2.1).This should help to prevent other users to build modeling and interpretation on unrecognized wrong SWS measurements.Data and sharing resources.We used seismological data from two networks achieved by the German Research Centre for Geosciences (Deutsches GeoForschungsZentrum (GFZ) Potsdam): STU (GE, GEOFON Program GFZ Potsdam) [GEOFON Data Centre, 1993] and the Institut de Physique du Globe de Paris (IPGP) Data Centre: ECH (G, GEOCOP) [GEOSCOPE, 1982].

Figure 1 and
Figure 1 and Figure 2 were prepared with PowerPoint Home & Student 2016.

Table 1 .
Overview of the GEOFON (GE) network [GEOFON Data Centre, 1993].The other example in Figure 3 (b) is a recording from the earthquake on 8. August 2018 at 22:35:13 (UTC) underneath the Mariana Islands recorded at station the Échery (ECH) in East France which is part of the GEOSCOPE (G) network [GEOSCOPE (a) one example is presented from the earthquake on 14. November 2011 at 19:44:29 (UTC) underneath Argentina recorded at the station Stuttgart (STU) in Southwest Germany which is for which options of start time extraction and filename format the milliseconds (msec) are considered in the offset calculation by the publicly available SplitLab versions.Otherwise, only seconds (sec) or even just minutes (min) are included.If a filename format is not provided in the SplitLab version, "-" is set.Yvonne Fröhlich et al.part