00. Package structure

The package now is organized into a simple and practical directory structure to help you easily follow the workflow from data preparation to result analysis. Each folder and script has a specific role in the inversion process.

Main directory

  • SetupData: This folder contains everything related to preparing the input data. It includes scripts and files needed to organize raw data into the correct format for the inversion.

  • Codes: This is the core directory where the main inversion programs are stored. All scripts that perform the MCMC inversion are located here.

  • Project directory: Central workspace where all data, input models, inversion setting files, and output results are stored.

  • AnalyzeResult: After running the inversion, the output results are processed and visualized using the tools in this folder. It helps you understand and interpret the inversion results.

Workflow scripts (placed in {Main direcotry})

All the works will be called by those script. The workflow is controlled by 4 main scripts:

  • 01_prepare_data.sh: This script prepares and organizes the input data. It ensures that all required files are in the correct format and location before running the inversion.

  • 02_do_MCMC.sh: This script runs the MCMC inversion. It uses the prepared data and model settings to generate a set of possible solutions.

  • 03_re_prepare_data.sh: This script is intended for re-preparing the data (e.g., changing the weighting or removing a data type for testing). However, it is rarely used, since running 01_prepare_data.sh and 02_do_MCMC.sh is usually a better approach.

  • 04_re_do_MCMC_post_process.sh: Performs post-processing of the MCMC inversion when needed. It reads the posterior distributions from binary files and re-applies the parameter search ranges to select a refined subset of models.

  • 05_do_replot_MCMC.sh: Regenerates the output plots of the inversion results. This script is useful when adjusting visualization styles, such as switching between layer-cake and gradient representations.

Project directory

  • data: This folder contains the observed data used for inversion (e.g., dispersion curves or waveform-derived measurements). These are the inputs that the model tries to fit. The data was stored in the subdirectories as {Project}/data/{sta}_data/*

  • Vel_mod: This folder stores the velocity model settings or initial/reference models used during the inversion process.

  • MonterCarlo: This folder stores both the initial setup and the output generated after the inversion.

  • Station files: (placed in {Project direcotry})

station_cor.lst
Station list in the format: name – longitude – latitude – elevation.
For the MCMC workflow, only the station name is required; the other parameters are used for plotting purposes only. This file is used during the data setup stage.

sta_now
Defines the stations to be processed in the MCMC inversion. It can include all stations from station_cor.lst or a selected subset (e.g., a single station).

Summary

The overall workflow follows a simple sequence:

  1. Prepare data → SetupData + 01_prepare_data.sh
  2. Run inversion → Codes + 02_do_MCMC.sh
  3. Analyze results → AnalyzeResult (02_do_MCMC.sh)
  4. Re-do the post-process analysis if needed ( 04_re_do_MCMC_post_process.sh and 05_do_replot_MCMC.sh )

This structure is designed to keep the process clear, modular, and easy to debug, especially for new users.