pytomoatt.model¶
Module for handling model data.
- class pytomoatt.model.ATTModel(para_fname='input_params.yml')[source]¶
Bases:
objectCreate 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
- 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
vporvs, 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’
- smooth(sigma=5.0, unit_deg=False, smooth_ani=False, **kwargs)[source]¶
Gaussian smooth the 3D velocity model
- Parameters:
sigma (scalar or sequence of scalars) – Standard deviation for Gaussian kernel. If scalar, apply to all dimensions. If sequence of 3, apply to [depth, lat, lon]. Depth is always in km. Horizontal dimensions depend on unit_deg.
unit_deg (bool) – If True, horizontal sigma is in degrees. If False, horizontal sigma is in km. Defaults to False.
smooth_ani (bool) – If True, also smooth anisotropic parameters (xi, eta, zeta). Defaults to False.
kwargs – Additional arguments passed to scipy.ndimage.gaussian_filter
Examples
To smooth with 5 km in depth and 0.2 degrees in horizontal directions:
>>> model.smooth(sigma=[5.0, 0.2, 0.2], unit_deg=True)
To smooth with 5 km in depth and 20 km in horizontal directions:
>>> model.smooth(sigma=[5.0, 20.0, 20.0], unit_deg=False)