Example #1
0
def test_property(sol_values, a_grid, stack_eg, surface_eg):
    sol = XSolution(a_grid, stack=stack_eg, surfaces=surface_eg)
    sol.set_values(sol_values)
    print('scalar', sol.scalar_field_matrix)
    print('lith', sol.lith_block)
    print('values', sol.values_matrix)

    print('scalar_asp', sol.scalar_field_at_surface_points)
Example #2
0
def test_xsol_full(model_horizontal_two_layers):
    model_horizontal_two_layers.update_to_interpolator()
    vals = gp.compute_model(model_horizontal_two_layers, set_solutions=False)
    sol = XSolution(model_horizontal_two_layers._grid,
                    stack=model_horizontal_two_layers._stack,
                    surfaces=model_horizontal_two_layers._surfaces)
    sol.set_values(vals)
    print('\n regular', sol.s_regular_grid)
    print('\n custom', sol.s_custom_grid)
    print('\n topo', sol.s_topography)
Example #3
0
def test_scalar_field_matrix_property_full(model_horizontal_two_layers):
    sol_vals = gp.compute_model(model_horizontal_two_layers,
                                set_solutions=False)
    sol = XSolution(model_horizontal_two_layers._grid,
                    stack=model_horizontal_two_layers._stack,
                    surfaces=model_horizontal_two_layers._surfaces)
    sol.set_values(sol_vals)
    print('scalar', sol.scalar_field_matrix)

    old_sol = Solution(model_horizontal_two_layers._grid,
                       series=model_horizontal_two_layers._stack,
                       surfaces=model_horizontal_two_layers._surfaces)
    old_sol.set_solution_to_regular_grid(sol_vals, False, None)
    print(old_sol.scalar_field_matrix)

    np.testing.assert_array_almost_equal(sol.scalar_field_matrix,
                                         old_sol.scalar_field_matrix)
Example #4
0
def test_xsol(sol_values, a_grid, stack_eg, surface_eg):
    sol = XSolution(a_grid, stack=stack_eg, surfaces=surface_eg)
    sol.set_values(sol_values)
    print('\n regular', sol.s_regular_grid)
    print('\n custom', sol.s_custom_grid)
    print('\n topo', sol.s_topography)
    print('\n sect', sol.s_sections['section_SW-NE'])
    print('\n sect', sol.s_sections['section_NW-SE'])

    sol.set_values(sol_values)
    print('\n custom2', sol.s_custom_grid)
Example #5
0
def test_xsol_to_disk(sol_values, a_grid, stack_eg, surface_eg, tmpdir):
    sol = XSolution(a_grid, stack=stack_eg, surfaces=surface_eg)
    sol.set_values(sol_values)
    print('\n custom', sol.s_regular_grid)
    sol.to_netcdf(tmpdir, 'bar')
Example #6
0
def test_xsol_structured(sol_values, a_grid, stack_eg, surface_eg):
    sol = XSolution(a_grid, stack=stack_eg, surfaces=surface_eg)
    sol.set_values(sol_values)
    print('\n custom', sol.s_regular_grid)