Skip to content

pytomoatt.checkerboard

Create checkerboard model by adding perturbations on an exist model

Constructor

__init__(model_fname: str, para_fname='input_params.yml')

Initialize Checker object

Parameters

Name Type Description
fname str Path to initial model file
para_fname (str, optional) Path to parameter file, defaults to ‘input_params.yml’ (default: 'input_params.yml')
Checker.checkerboard(n_pert_x: int, n_pert_y: int, n_pert_z: int, pert_vel=0.08, pert_ani=0.04, ani_dir=45, lim_x=None, lim_y=None, lim_z=None)

Create checkerboard

Parameters

Name Type Description
n_pert_x int Multiple of period along X, e.g., set to 1 for 2 anomalies
n_pert_y int Multiple of period along Y
n_pert_z int Multiple of period along Z
pert_vel (float, optional) Perturbation for velocity, defaults to 0.08 (default: 0.08)
pert_ani (float, optional) Perturbation for anisotropy, defaults to 0.04 (default: 0.04)
ani_dir (float, optional) Direction of fast velocity direction, defaults to 45 (default: 45)
lim_x (list, optional) Left and right bound along X, defaults to None (default: None)
lim_y (list, optional) Left and right bound along Y, defaults to None (default: None)
lim_z (list, optional) Left and right bound along Z, defaults to None (default: None)

Checker.copy()

Create a deep copy of the Checker object

Returns

Type Description
Checker A copy of the Checker object

Checker.to_attmodel()

Convert to ATTModel object

Returns

Type Description
ATTModel ATTModel object

Checker.write(fname)

Write new model to h5 file

Parameters

Name Type Description
fname str Path to output file