def test_cube_resampling(loadsfile1): """Import a cube, then make a smaller and resample, then export the new""" logger.info("Import SEGY format via SEGYIO") incube = loadsfile1 newcube = Cube( xori=460500, yori=5926100, zori=1540, xinc=40, yinc=40, zinc=5, ncol=200, nrow=100, nlay=100, rotation=incube.rotation, yflip=incube.yflip, ) newcube.resample(incube, sampling="trilinear", outside_value=10.0) tsetup.assert_almostequal(newcube.values.mean(), 5.3107, 0.0001) tsetup.assert_almostequal(newcube.values[20, 20, 20], 10.0, 0.0001) newcube.to_file(join(TMD, "cube_resmaple1.segy"))
def test_storm_import(tmpdir): """Import Cube using Storm format (case Reek).""" acube = Cube() st1 = xtg.timer() acube.from_file(SFILE3, fformat="storm") elapsed = xtg.timer(st1) logger.info("Reading Storm format took %s", elapsed) assert acube.ncol == 280, "NCOL" vals = acube.values assert vals[180, 185, 4] == pytest.approx(0.117074, 0.0001) acube.to_file(join(tmpdir, "cube.rmsreg"), fformat="rms_regular")
def test_storm_import(): """Import Cube using Storm format (case Reek).""" acube = Cube() st1 = xtg.timer() acube.from_file(SFILE3, fformat="storm") elapsed = xtg.timer(st1) logger.info("Reading Storm format took %s", elapsed) assert acube.ncol == 280, "NCOL" vals = acube.values tsetup.assert_almostequal(vals[180, 185, 4], 0.117074, 0.0001) acube.to_file(join(TMD, "cube.rmsreg"), fformat="rms_regular")