示例#1
0
    def test_arg_loader(self):

        with self.assertRaises(IOError):
            arg = ArgLoader.load("arg1X")

        arg_file = self.createTestPath("Equinor/config/with_GEN_DATA_RFT/wellpath/WI_1.txt")

        with self.assertRaises(ValueError):
            arg = ArgLoader.load(arg_file , column_names = ["Col1" , "Col2" , "Col3"  ,"COl5" , "Col6"])

        arg = ArgLoader.load(arg_file , column_names = ["utm_x" , "utm_y" , "md" , "tvd"])
        self.assertFloatEqual( arg["utm_x"][0] , 461317.620646)
示例#2
0
                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:
                    realization_frame = pandas.DataFrame(data={"TVD": tvd_arg,