def test_set_regular_grid(self): # Test creating an empty list grid = gp.Grid() # print(grid.create_regular_grid_3d([0,2000, 0, 2000, -2000, 0], [50, 50, 50])) # Test set regular grid by hand grid.create_regular_grid([0, 2000, 0, 2000, -2000, 0], [50, 50, 50])
def test_custom_grid(self): # create custom grid grid = gp.Grid() cg = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) grid.create_custom_grid(cg) # make sure the custom grid is active assert grid.active_grids[1] # make sure the custom grid is equal to the provided values np.testing.assert_array_almost_equal(cg, grid.custom_grid.values) # make sure we have the correct number of values in our grid l0, l1 = grid.get_grid_args('custom') assert l0 == 0 assert l1 == 3
def a_grid(): # Or we can init one of the default grids since the beginning by passing # the correspondant attributes grid = gp.Grid(extent=[0, 2000, 0, 2000, -2000, 0], resolution=[50, 50, 50]) grid.set_active('regular') grid.create_custom_grid(np.arange(12).reshape(-1, 3)) grid.set_active('custom') grid.create_topography() grid.set_active('topography') section_dict = { 'section_SW-NE': ([250, 250], [1750, 1750], [100, 100]), 'section_NW-SE': ([250, 1750], [1750, 250], [100, 100]) } grid.create_section_grid(section_dict) grid.set_active('sections') return grid
def test_grid_init(self): # Or we can init one of the default grids since the beginning by passing # the correspondant attributes grid = gp.Grid(extent=[0, 2000, 0, 2000, -2000, 0], resolution=[50, 50, 50])
orientations # %% orientations.map_data_from_series(series, 'order_series') orientations # %% orientations.update_annotations() # %% # Grid # ~~~~ # # %% grid = gp.Grid() grid.create_regular_grid([0, 10, 0, 10, 0, 10], [50, 50, 50]) # %% grid.values # %% # Rescaling Data # ^^^^^^^^^^^^^^ # # %% rescaling = gempy.core.data_modules.geometric_data.ScalingSystem( surface_points, orientations, grid) # %%
def create_grid(): # Test creating an empty list grid = gp.Grid() # Test set regular grid by hand grid.create_regular_grid([0, 2000, 0, 2000, -2000, 0], [50, 50, 50]) return grid