pytomoatt.model
ATTModel
Section titled “ATTModel”Create initial model from external models
Constructor
__init__(para_fname='input_params.yml')Parameters
| Name | Type | Description |
|---|---|---|
para_fname |
(str, optional) |
Path to parameter file, defaults to ‘input_params.yml’ (default: 'input_params.yml') |
Methods
Section titled “Methods”ATTModel.calc_dv
Section titled “ATTModel.calc_dv”ATTModel.calc_dv(ref_mod_fname: str)calculate anomalies relative to another model
Parameters
| Name | Type | Description |
|---|---|---|
ref_mod_fname |
str |
Path to reference model |
ATTModel.calc_dv_avg
Section titled “ATTModel.calc_dv_avg”ATTModel.calc_dv_avg()calculate anomalies relative to average velocity at each depth
ATTModel.copy
Section titled “ATTModel.copy”ATTModel.copy()Copy the model
ATTModel.grid_data_ascii
Section titled “ATTModel.grid_data_ascii”ATTModel.grid_data_ascii(model_fname: str, **kwargs)Grid data from custom model file in ASCII format
Parameters
| Name | Type | Description |
|---|---|---|
model_fname |
str |
Path to model file |
usecols |
list | tuple |
Columns order by longitude, latitude, depth and velocity, defaults to [0, 1, 2, 3] |
ATTModel.grid_data_crust1
Section titled “ATTModel.grid_data_crust1”ATTModel.grid_data_crust1(type='vp', rotate=None)Grid data from CRUST1.0 model
Parameters
| Name | Type | Description |
|---|---|---|
type |
(str, optional) |
Specify velocity type of vp or vs, defaults to ‘vp’ (default: 'vp') |
rotate |
— |
Rotation parameters [central_lat, central_lon, rotation_angle] in degrees, defaults to None (default: None) |
ATTModel.read
Section titled “ATTModel.read”ATTModel.read(model_fname: str, para_fname='input_params.yml')Read an exists model
Parameters
| Name | Type | Description |
|---|---|---|
model_fname |
str |
Path to the exists model |
para_fname |
(str, optional) |
Path to parameter file, defaults to ‘input_params.yml’ (default: 'input_params.yml') |
ATTModel.read_param
Section titled “ATTModel.read_param”ATTModel.read_param()Read n_rtp, min_max_dep, min_max_lat and min_max_lon from para_fname
ATTModel.smooth
Section titled “ATTModel.smooth”ATTModel.smooth(sigma=5.0, unit_deg=False, smooth_ani=False, **kwargs)Gaussian smooth the 3D velocity model
Parameters
| Name | Type | Description |
|---|---|---|
sigma |
scalar | 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. (default: 5.0) |
unit_deg |
bool |
If True, horizontal sigma is in degrees. If False, horizontal sigma is in km. Defaults to False. (default: False) |
smooth_ani |
bool |
If True, also smooth anisotropic parameters (xi, eta, zeta). Defaults to False. (default: False) |
kwargs |
— |
Additional arguments passed to scipy.ndimage.gaussian_filter .. rubric:: 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) (default: {}) |
ATTModel.to_ani
Section titled “ATTModel.to_ani”ATTModel.to_ani()Convert to anisotropic strength (epsilon) and azimuth (phi)
ATTModel.to_xarray
Section titled “ATTModel.to_xarray”ATTModel.to_xarray()Convert to xarray
Returns
| Type | Description |
|---|---|
pytomoatt.attarray.Dataset |
attarray dataset |
ATTModel.write
Section titled “ATTModel.write”ATTModel.write(out_fname=None)Write to h5 file with TomoATT format.
Parameters
| Name | Type | Description |
|---|---|---|
fname |
(str, optional) |
file name of output model, defaults to ‘model_crust1.0.h5’ |

