pytomoatt.model

Module for handling model data.

class pytomoatt.model.ATTModel(para_fname='input_params.yml')[source]

Bases: object

Create initial model from external models

calc_dv(ref_mod_fname: str)[source]

calculate anomalies relative to another model

Parameters:

ref_mod_fname (str) – Path to reference model

calc_dv_avg()[source]

calculate anomalies relative to average velocity at each depth

copy()[source]

Copy the model

grid_data_ascii(model_fname: str, **kwargs)[source]

Grid data from custom model file in ASCII format

Parameters:
  • model_fname (str) – Path to model file

  • usecols (list or tuple) – Columns order by longitude, latitude, depth and velocity, defaults to [0, 1, 2, 3]

grid_data_crust1(type='vp')[source]

Grid data from CRUST1.0 model

Parameters:

type (str, optional) – Specify velocity type of vp or vs, defaults to ‘vp’

classmethod read(model_fname: str, para_fname='input_params.yml')[source]

Read an exists model

Parameters:
  • model_fname (str) – Path to the exists model

  • para_fname (str, optional) – Path to parameter file, defaults to ‘input_params.yml’

read_param()[source]

Read n_rtp, min_max_dep, min_max_lat and min_max_lon from para_fname

smooth(sigma=5.0)[source]

Gaussian smooth the 3D velocity model

Parameters:

sigma (scalar or sequence of scalars , optional) – Standard division of gaussian kernel in km, defaults to 10

to_ani()[source]

Convert to anisotropic strength (epsilon) and azimuth (phi)

to_xarray()[source]

Convert to xarray

Returns:

attarray dataset

Return type:

pytomoatt.attarray.Dataset

write(out_fname=None)[source]

Write to h5 file with TomoATT format.

Parameters:

fname (str, optional) – file name of output model, defaults to ‘model_crust1.0.h5’