**Output Files** ================ TESLA generates comprehensive output reports detailing the analysis results. These reports include visual representations (figures), tabulated data (CSV files), serialized data files (pickle objects), and log reports (HTML files). Here is an overview of the output provided by TESLA. **Figures** ----------- TESLA produces figures illustrating the fitted spectral parameters and their uncertainties. Users can configure TESLA to generate: - Figures for all computed spectra, including those selected for analysis and those not selected. - Figures only for spectra that meet the selection criteria. - No figures, if preferred for streamlined analysis. **Figure Naming Convention** The spectral figures are named following a concise convention that encapsulates the window number, phase type, and station code: - For P-wave spectra, the naming format is ``.P.Spctr..png``. For instance, a figure might be named ``10.P.Spctr.STA1.png``. - S-wave spectra follow a similar naming structure, denoted as ``.S.Spctr..png``. An example would be ``8.S.Spctr.STA1.png``. **CSV Files** ------------- The CSV output files contain detailed information on: - Fitted parameters and their uncertainties. - Statistical metrics evaluating the quality of the spectral analysis. - Dimensions of the signal windows used in the analysis. The data is organized to facilitate further statistical analysis and interpretation. Regarding the CSV files, TESLA saves two types in the ``sel_spectra`` folder: - ``Source_Spectra.all.STA1.csv``: This file contains all the statistical data and results from the spectral fit for every analyzed window. - ``Source_Spectra.best.STA1.csv``: This file includes only the spectra that have met the selection criteria as specified in the configuration file. Both files are organized in ascending order based on the cost function value. **CSV File Output Description** The CSV files generated by TESLA are meticulously organized to provide a clear and detailed view of the spectral analysis results. These files are sorted in ascending order based on the cost function value, which is a crucial metric for evaluating the fit between observed and modeled data. The cost function is normalized, ranging from 0 to 1, where a value of 0 typically represents the best fit (indicative of the closest match between the observed and the modeled spectra), and a value of 1 corresponds to the worst fit. **Column Descriptions**: - **No.**: Identification number of the analysis or signal window. - **Signal_Window_Duration**: Duration of the analyzed signal window, measured in seconds. It is the sum of ``Len_Sig_PrePick`` and ``Len_Sig_AfterPick``. - **Len_Sig_PrePick**: Length of the signal before the pick, in seconds. - **Len_Sig_AfterPick**: Length of the signal after the pick, in seconds. - **Omega0**: :math:`\Omega_0`, low frequency spectral level of the source spectrum. The units of measure are those of the waveform used as input. - **Omega0_Error**: Error associated with the :math:`\Omega_0` parameter. - **Corner_Frequency**: The corner frequency of the source spectrum. - **Corner_Frequency_Error**: Error associated with the corner frequency. - **Q**: Quality factor describing the damping of seismic waves. - **Q_Error**: Error associated with the Q factor. - **SNR_Percentage**: Signal-to-noise ratio expressed as a percentage. - **Delta_Omega**: Difference in :math:`\Omega` between the first and last points of the computed source spectrum. - **RMS_CurveFit**: This parameter corresponds to the Mean Absolute Percentage Error (MAPE), used to evaluate the goodness of fit, but expressed not as a percentage. - **Cost_Function**: Value of the cost function utilized during the optimization process for classifying the calculated spectra using various signal windows. - **RMS_Normalized**: Similar to RMS_CurveFit, but expressed as a percentage. This parameter corresponds to the Mean Absolute Percentage Error (MAPE), serving to assess the fit's accuracy. Specifically, in the ``Source_Spectra.best.STA1.csv`` file, which contains only those spectra that have met the selection criteria defined in the configuration file, the data set on the first line after the header represents the spectrum with the best fit. This prioritization allows researchers to quickly identify the most accurately modeled spectrum, facilitating an efficient preliminary analysis and selection process for further detailed study or for preparing results for publication. **Example of the First Line in the Best Spectra File** The ``Source_Spectra.best.STA1.csv`` will have, as its first line of data (immediately following the header), the information pertaining to the spectrum considered to have the best fit based on the applied criteria. This makes the first line a critical reference point for instantly assessing the quality of the seismic analysis conducted. Below is the representation of this concept in a table format: .. csv-table:: :header: "No.", "Signal_Window_Duration", "Len_Sig_PrePick", "Len_Sig_AfterPick", "Omega0", "Omega0_Error", "Corner_Frequency", "Corner_Frequency_Error", "Q", "Q_Error", "SNR_Percentage", "Delta_Omega", "RMS_CurveFit", "Cost_Function", "RMS_Normalized" :widths: 5, 20, 20, 20, 10, 15, 20, 25, 10, 10, 15, 15, 15, 15, 15 "18", "0.400", "0.200", "0.200", "6.519", "0.074", "8.351", "0.512", "45.86", "4.94", "100", "2.423", "0.166", "0.0", "16.63" This ascending order based on the cost function, which is normalized from 0 (best) to 1 (worst), assists researchers in swiftly pinpointing the spectra that best adhere to predefined criteria, simplifying the initial analysis phase and selection of spectra for in-depth studies or result dissemination. **Pickle Objects** ------------------ TESLA allows for the saving of computed spectra as Python objects using the pickle library. This option includes: - Complete spectral data. - Quality metrics associated with each spectrum. - Relevant analysis parameters. These saved objects enable in-depth post-analysis and are ideal for researchers needing to revisit or extend their studies without re-running the entire analysis pipeline. **Log Files** ------------- TESLA displays a range of information in a user-friendly and visually accessible format on the screen. This information offers insights into: 1) the current status of processing; 2) immediate findings regarding the event being analyzed and the waveforms under examination; 3) results from the curve fitting process and the spectra chosen. Furthermore, any computational errors are displayed on the screen, providing direct links to the specific script or function implicated in generating the error. Processing times and additional important details are presented in a clear and readable manner within the terminal. To improve visibility based on the selected color scheme, it is advised to use a terminal with a dark background. Beyond simply mirroring on-screen data, TESLA generates a comprehensive HTML ``logfile`` that captures all displayed information and systematically records any encountered errors, each annotated with hyperlinks to the respective scripts for quick troubleshooting. This log file, saved within the directory housing the earthquake waveform recordings, proves invaluable for detailed post-processing analysis. It enables a thorough examination of the processing steps performed, deepens the understanding of the computational workflow, and ensures the reliability and reproducibility of the results. **Directory Structure and Results Management** ---------------------------------------------- For each seismic event analyzed, TESLA organizes the results within the waveform directory, creating two main folders: ``P`` and ``S``. These folders contain the inversion results of the spectra for P waves and S waves, respectively. Within each of these folders (``P`` and ``S``), for every seismic station analyzed – as specified in the configuration file – TESLA creates a subfolder named after the station code. This subfolder contains two additional directories: - ``sel_spectra``: Contains the figures of the selected spectra, i.e., those that meet the selection criteria defined in the analysis. - ``not_sel_spectra``: Houses the figures of the unselected spectra, i.e., those that did not meet the selection criteria. This organization facilitates easy access and review of the results, allowing users to conveniently compare the selected spectra with the unselected ones for each analyzed seismic station. **Folder Structure** The folder structure within the ``earthquake_id_folder`` directory is as follows: .. code-block:: none earthquake_id_folder/ ├── P/ │ ├── STA1/ │ │ ├── sel_spectra/ │ │ │ ├── 10.P.Spctr.STA1.png │ │ │ ├── 11.P.Spctr.STA1.png │ │ │ ├── Source_Spectra.all.STA1.csv │ │ │ └── Source_Spectra.best.STA1.csv │ │ └── not_sel_spectra/ │ │ ├── 12.P.Spctr.STA1.png │ │ └── 13.P.Spctr.STA1.png │ ├── STA2/ │ │ ├── sel_spectra/ │ │ │ ├── 1.P.Spctr.STA1.png │ │ │ ├── 3.P.Spctr.STA1.png │ │ │ ├── Source_Spectra.all.STA2.csv │ │ │ └── Source_Spectra.best.STA2.csv │ │ └── not_sel_spectra/ │ │ ├── 22.P.Spctr.STA2.png │ │ └── 17.P.Spctr.STA2.png ├── S/ │ ├── STA1/ │ │ ├── sel_spectra/ │ │ │ ├── 1.S.Spctr.STA1.png │ │ │ ├── 2.S.Spctr.STA1.png │ │ │ ├── Source_Spectra.all.STA1.csv │ │ │ └── Source_Spectra.best.STA1.csv │ │ └── not_sel_spectra/ │ └── STA2/ │ ├── sel_spectra/ │ └── not_sel_spectra/ │ └── logfile.html **Configurability and Access to Results** ----------------------------------------- TESLA's flexibility allows users to customize the output according to their needs, including: - Choice between plotting all spectra, only selected spectra, or no spectra. - Option to save computed spectra for future analysis, leveraging the pickle library for comprehensive data preservation. Thanks to this detailed structure, users can easily navigate through specific analysis results, improving the efficiency of data review and the interpretation of seismic spectra. TESLA's flexible configuration allows it to adapt to various research requirements, facilitating the understanding and use of analyzed seismic data. .. raw:: latex \vspace{1cm} .. figure:: ../_static/Figure_5.png :width: 20cm :align: center :alt: Example of (a) P- and (b) S-wave displacement spectra calculated by TESLA with 3C velocimetric waveforms. From top to bottom, vertical, north-south, and east-west components [m/s] vs. [s]. The spectrum (in red) in the lower panels is computed using the signal window composed by a prepick signal (highlighted in orange on the waveforms) and postpick signal (highlighted in green on the waveforms). The gray circles in the lower panels indicate the noise spectrum calculated using the signal window highlighted in gray on the waveforms. Black line corresponds to best-fit curve .. raw:: latex \vspace{1cm}