def test_geertsma_TS_simple(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_simple(vintage_pairs) assert tshift[0][0] == pytest.approx(-0.01006, 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_simple(vintage_pairs) assert tshift[0][0] == pytest.approx(0.01006, abs=0.0001)
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)