def test_geertsma_TS(setUp): spec, actnum, parms = setUp grid = EclGridGenerator.createRectangular( dims=(2, 2, 2), dV=(100, 100, 100), actnum=actnum ) create_restart(grid, "TEST") create_init(grid, "TEST") grid.save_EGRID("TEST.EGRID") parms.velocity_model = "TEST.segy" int_val = [50, 150] create_segy_file( parms.velocity_model, spec, xl=int_val, il=int_val, cdp_x=int_val, cdp_y=int_val ) ots = OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) vintage_pairs = [ (datetime.date(2000, 1, 1), datetime.date(2010, 1, 1)), (datetime.date(2010, 1, 1), datetime.date(2011, 1, 1)), ] tshift = ots.geertsma_ts(vintage_pairs) assert tshift[0][0] == pytest.approx(-0.00104, abs=0.0001) parms.convention = -1 ots = OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) vintage_pairs = [ (datetime.date(2000, 1, 1), datetime.date(2010, 1, 1)), (datetime.date(2010, 1, 1), datetime.date(2011, 1, 1)), ] tshift = ots.geertsma_ts(vintage_pairs) assert tshift[0][0] == pytest.approx(0.00104, abs=0.0001)
def test_create(setup_spec): spec = setup_spec vel = "TEST.segy" create_segy_file(vel, spec) grid = EclGridGenerator.createRectangular(dims=(2, 2, 2), dV=(100, 100, 100)) res_surface = OTSResSurface(grid=grid, above=0) OTSVelSurface(res_surface, vel)
def test_z3d(setup_spec): spec = setup_spec vel = "TEST.segy" int_val = [50, 150] create_segy_file(vel, spec, xl=int_val, il=int_val, cdp_x=int_val, cdp_y=int_val) grid = EclGridGenerator.createRectangular(dims=(2, 2, 2), dV=(100, 100, 100)) res_surface = OTSResSurface(grid=grid, above=0) ots_s = OTSVelSurface(res_surface, vel) assert (4, 2) == ots_s.z3d.shape
def test_eval(setUp): spec, actnum, parms = setUp grid = EclGridGenerator.createRectangular( dims=(2, 2, 2), dV=(100, 100, 100), actnum=actnum ) grid.save_EGRID("TEST.EGRID") create_init(grid, "TEST") create_restart(grid, "TEST") parms.velocity_model = "TEST.segy" create_segy_file(parms.velocity_model, spec) ots = OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) with pytest.raises(ValueError): ots.add_survey("S1", datetime.date(2000, 1, 15)) vintage_pairs = [(datetime.date(1900, 1, 1), datetime.date(2010, 1, 1))] with pytest.raises(ValueError): ots.geertsma_ts_simple(vintage_pairs) vintage_pairs = [(datetime.date(2010, 1, 1), datetime.date(1900, 1, 1))] with pytest.raises(ValueError): ots.geertsma_ts_simple(vintage_pairs) vintage_pairs = [(datetime.date(2000, 1, 1), datetime.date(2010, 1, 1))] ots.geertsma_ts_simple(vintage_pairs)
def test_irap_surface(setUp): spec, actnum, parms = setUp grid = EclGridGenerator.createRectangular( dims=(2, 2, 2), dV=(100, 100, 100), actnum=actnum ) # with TestAreaContext("test_irap_surface"): create_restart(grid, "TEST") create_init(grid, "TEST") grid.save_EGRID("TEST.EGRID") parms.velocity_model = "TEST.segy" create_segy_file(parms.velocity_model, spec) ots = OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) f_name = "irap.txt" s = ots._create_surface() s.write(f_name) s = Surface(f_name) assert s.getNX() == 2 assert s.getNY() == 2 for val in s: assert val == 90
def test_create_valid(set_up, config_item, value): spec, actnum, params = set_up grid = EclGridGenerator.createRectangular(dims=(10, 10, 10), dV=(1, 1, 1)) grid.save_EGRID("TEST.EGRID") create_init(grid, "TEST") create_restart(grid, "TEST") # Testing individual items in config, so setting that value here: setattr(params, config_item, value) if params.velocity_model: create_segy_file(params.velocity_model, spec) OverburdenTimeshift( params.eclbase, params.mapaxes, params.seabed, params.youngs, params.poisson, params.rfactor, params.convention, params.above, params.velocity_model, )
def test_create(setUp): spec, actnum, parms = setUp grid = EclGridGenerator.createRectangular(dims=(10, 10, 10), dV=(1, 1, 1)) create_init(grid, "TEST") with pytest.raises(IOError): OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) with pytest.raises(IOError): OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) grid = EclGridGenerator.createRectangular(dims=(10, 10, 10), dV=(1, 1, 1)) create_init(grid, "TEST") create_restart(grid, "TEST") with pytest.raises(IOError): OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) grid = EclGridGenerator.createRectangular(dims=(10, 10, 10), dV=(1, 1, 1)) grid.save_EGRID("TEST.EGRID") create_init(grid, "TEST") create_restart(grid, "TEST") parms.velocity_model = "missing.segy" with pytest.raises(IOError): OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, ) grid = EclGridGenerator.createRectangular(dims=(10, 10, 10), dV=(1, 1, 1)) grid.save_EGRID("TEST.EGRID") create_init(grid, "TEST") create_restart(grid, "TEST") parms.velocity_model = "TEST.segy" create_segy_file(parms.velocity_model, spec) OverburdenTimeshift( parms.eclbase, parms.mapaxes, parms.seabed, parms.youngs, parms.poisson, parms.rfactor, parms.convention, parms.above, parms.velocity_model, )