Skip to content

Create initial model

This content is for v0.3.0. Switch to the latest version for up-to-date documentation.

TomoATT requires a 3D initial model to start the inversion. The initial model is an h5 file that contains the velocity and anisotropy information. The velocity and anisotropy are stored in three datasets, vel, xi, and eta, each with shape (nr, nt, np), where nr, nt, and np are the number of grid points along depth, latitude, and longitude respectively. These values are defined in the domain section of the parameter file under the key n_rtp.

The range of the model is also defined by the domain section of the parameter file, which should contain the following keys:

  • min_max_dep: the minimum and maximum depth of the model, in km.
  • min_max_lat: the minimum and maximum latitude of the model, in degrees.
  • min_max_lon: the minimum and maximum longitude of the model, in degrees.

PyTomoATT provides a simple command line interface, pta create_model, to create a 3D initial model:

usage: pta create_model [-h] [-m 1|2] [-i fname] [-c ncol_lon/ncol_lat/ncol_dep/ncol_vel] [-o fname] [-s sigma] [-t vel_type] input_params
Create model for TomoATT from external models: CRUST1.0 or custom model
Ex1 (CRUST1.0): pta create_model -oatt_model.h5 -s5 -tvs input_params.yml
Ex2 (custom model): pta create_model -m2 -imodel.txt -oatt_model.h5 -s3 input_params.yml
positional arguments:
input_params The parameter file of TomoATT, The section "domain" will be read.
options:
-h, --help show this help message and exit
-m 1|2 Background model type. 1 for CRUST1.0, 2 for custom ASCII file, defaults to 1
-i fname Path to input custom model with ASCII format, only valid for -m2
-c ncol_lon/ncol_lat/ncol_dep/ncol_vel
Columns used in custom model file, order by lon/lat/dep/vel. defaults to 0/1/2/3
-o fname Path to output model, defaults to Sub_CRUST1.0_nr_nt_np.h5
-s sigma Smooth the 3D model with a Gaussian filter, sigma is the standard deviation of the smoothing kernel in km, defaults to None
-t vel_type Type of velocity vp or vs are available, valid for -m1

PyTomoATT ships an internal CRUST1.0 model — a 3D model (Vp and Vs) based on CRUST1.0 — stored in the data folder of the PyTomoATT package.

Use -m1 with pta create_model to build a 3D model based on CRUST1.0, for example:

Terminal window
pta create_model -m1 -oatt_model.h5 -s15 -tvs input_params.yml

This creates a 3D S-wave velocity model based on CRUST1.0, smooths it with a Gaussian filter of standard deviation 15 km, and saves the result to att_model.h5. The size of the model follows the domain section of the parameter file.

PyTomoATT also supports building a 3D model from a custom ASCII file. The file should contain velocity information in the form lon lat dep vel; the columns used can be reordered with -c. The default order is 0/1/2/3 (lon/lat/dep/vel). For example:

Terminal window
pta create_model -m2 -i model.txt -oatt_model.h5 -s20 input_params.yml

This builds a 3D model from model.txt, smooths it with a Gaussian filter of standard deviation 20 km, and saves the result to att_model.h5.