Esempio n. 1
0
    def test_trajectory(self):
        with self.assertRaises(IOError):
            WellTrajectory("/does/no/exist")

        with self.assertRaises(UserWarning):
            WellTrajectory(
                self.createTestPath(
                    "Statoil/ert-statoil/spotfire/gendata_rft_zone/invalid_float.txt"
                ))

        with self.assertRaises(UserWarning):
            WellTrajectory(
                self.createTestPath(
                    "Statoil/ert-statoil/spotfire/gendata_rft_zone/missing_item.txt"
                ))

        wt = WellTrajectory(
            self.createTestPath(
                "Statoil/ert-statoil/spotfire/gendata_rft_zone/E-3H.txt"))
        self.assertEqual(len(wt), 38)

        with self.assertRaises(IndexError):
            p = wt[38]

        p0 = wt[0]
        self.assertEqual(p0.utm_x, 458920.671)
        self.assertEqual(p0.utm_y, 7324939.077)
        self.assertEqual(p0.measured_depth, 2707.5000)

        pm1 = wt[-1]
        p37 = wt[37]
        self.assertEqual(p37, pm1)
Esempio n. 2
0
 def test_basics(self):
     wt = WellTrajectory(
         self.createTestPath(
             "Statoil/ert-statoil/spotfire/gendata_rft_zone/E-3H.txt"))
     self.assertEqual(len(wt), 38)
     self.assertTrue(isinstance(str(wt), str))
     self.assertTrue(isinstance(repr(wt), str))
     self.assertEqual('WellTrajectory(len=38)', repr(wt))
Esempio n. 3
0
                wells.add(well)
                obs_vector = enkf_obs[obs_key]
                data_key = obs_vector.getDataKey()
                report_step = obs_vector.activeStep()
                obs_node = obs_vector.getNode(report_step)

                rft_data = GenDataCollector.loadGenData(self.ert(), case, data_key, report_step)
                fs = self.ert().getEnkfFsManager().getFileSystem(case)
                realizations = fs.realizationList(RealizationStateEnum.STATE_HAS_DATA)

                # Trajectory
                trajectory_file = os.path.join(trajectory_path, "%s.txt" % well)
                if not os.path.isfile(trajectory_file):
                    trajectory_file = os.path.join(trajectory_path, "%s_R.txt" % well)

                trajectory = WellTrajectory(trajectory_file)
                arg = ArgLoader.load(trajectory_file, column_names=["utm_x", "utm_y", "md", "tvd"])
                tvd_arg = arg["tvd"]
                data_size = len(tvd_arg)

                # Observations
                obs = numpy.empty(shape=(data_size, 2), dtype=numpy.float64)
                obs.fill(numpy.nan)
                for obs_index in range(len(obs_node)):
                    data_index = obs_node.getDataIndex(obs_index)
                    value = obs_node.getValue(obs_index)
                    std = obs_node.getStandardDeviation(obs_index)
                    obs[data_index, 0] = value
                    obs[data_index, 1] = std

                for iens in realizations: