Пример #1
0
def get_model_syntest1():
    model_ref = SeismicModel.ak135()
    types = [ParameterType.VSH]
    radii = 6371. - np.array([493.33, 410.])
    model_params = ModelParameters(types, radii, mesh_type='boxcar')
    model, mesh = model_ref.boxcar_mesh(model_params)
    values = np.array(
        [.2 * (-1)**i for i in range(model_params._n_grd_params)])
    values_dict = {param_type: values for param_type in types}
    values_mat = model_params.get_values_matrix(values_dict)
    mesh_mul = mesh.multiply(model_params.get_nodes(), values_mat)
    model_mul = model + mesh_mul

    return model_mul
Пример #2
0
        [0. if i % 2 == 1 else 0. for i in range(model_params._n_grd_params)])
    values = np.array(
        [0. if i % 2 == 1 else 0. for i in range(model_params._n_grd_params)])
    values[2] = -0.1
    values[3] = 0
    values_r = np.zeros(model_params._n_grd_params, dtype=np.float64)
    values_r[2] = -20
    values_r[3] = -0
    values_dict = {ParameterType.VSH: values, ParameterType.RADIUS: values_r}
    values_dict_m = {
        ParameterType.VSH: values_m,
        ParameterType.RADIUS: values_r
    }
    values_mat = model_params.get_values_matrix(values_dict)
    values_mat_m = model_params.get_values_matrix(values_dict_m)
    model_ = model_.multiply(model_params.get_nodes(), values_mat,
                             values_mat_m)

    # # mesh
    # model, mesh = ak135.boxcar_mesh(model_params)

    # # multiply mesh with values
    # values = np.array(
    #     [0.1 * (-1)**i for i in range(model_params._n_grd_params)])
    # values_dict = {
    #     ParameterType.VSH: values}
    # values_mat = model_params.get_values_matrix(values_dict)
    # mesh_ = mesh.multiply(model_params.get_nodes(), values_mat)
    # model_ = model + mesh_

    # # retrieve model perturbations