Exemple #1
0
    def do_plot(self, line):
        keys = matchItems(line, self.summaryKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one Summary key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            plot = ShellPlot(key)
            for case_name in case_list:
                data = SummaryCollector.loadAllSummaryData(
                    self.ert(), case_name, [key])
                if not data.empty:
                    plot.plot(data, value_column=key, legend_label=case_name)

            if len(
                    case_list
            ) > 0 and SummaryObservationCollector.summaryKeyHasObservations(
                    self.ert(), key):
                observation_data = SummaryObservationCollector.loadObservationData(
                    self.ert(), case_list[0], [key])

                if not observation_data.empty:
                    plot.plotObservations(observation_data, value_column=key)

            plot.showLegend()
Exemple #2
0
    def do_plot(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one GenData key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            key, report_step = key.split("@", 1)
            report_step = int(report_step)
            plot = ShellPlot("%s at report step: %d" %(key, report_step))
            for case_name in case_list:
                data = GenDataCollector.loadGenData(self.ert(), case_name, key, report_step)

                if not data.empty:
                    plot.plotGenData(data, legend_label=case_name)

                obs_key = GenDataObservationCollector.getObservationKeyForDataKey(self.ert(), key, report_step)

                if obs_key is not None:
                    obs_data = GenDataObservationCollector.loadGenDataObservations(self.ert(), case_name, [obs_key])

                    if not obs_data.empty:
                        plot.plotObservations(obs_data, obs_key)

            plot.showLegend()
Exemple #3
0
    def do_print(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one GenKW key")
            return False

        case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()

        data = GenKwCollector.loadAllGenKwData(self.ert(), case_name, keys)
        print(data)
Exemple #4
0
    def do_print(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one GenKW key")
            return False

        case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()

        data = GenKwCollector.loadAllGenKwData(self.ert(), case_name, keys)
        print(data)
Exemple #5
0
    def do_histogram(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            print("Error: Must have at least one GenKW key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            for case_name in case_list:
                data = GenKwCollector.loadAllGenKwData(self.ert(), case_name, [key])
                plot = ShellPlot(key)
                plot.histogram(data, key, log_on_x=key.startswith("LOG10_"))
Exemple #6
0
    def do_print(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one GenData key")
            return False

        case_name = self.ert().getEnkfFsManager().getCurrentFileSystem().getCaseName()

        for key in keys:
            key, report_step = key.split("@", 1)
            report_step = int(report_step)
            data = GenDataCollector.loadGenData(self.ert(), case_name, key, report_step)
            print(data)
Exemple #7
0
    def do_histogram(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one GenKW key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            for case_name in case_list:
                data = GenKwCollector.loadAllGenKwData(self.ert(), case_name, [key])
                if not data.empty:
                    plot = ShellPlot(key)
                    plot.histogram(data, key, log_on_x=key.startswith("LOG10_"))
Exemple #8
0
    def do_density(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            print("Error: Must have at least one GenKW key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            plot = ShellPlot(key)
            for case_name in case_list:
                data = GenKwCollector.loadAllGenKwData(self.ert(), case_name, [key])
                plot.density(data, key, legend_label=case_name)
            plot.showLegend()
Exemple #9
0
    def do_density(self, line):
        keys = matchItems(line, self.fetchSupportedKeys())

        if len(keys) == 0:
            self.lastCommandFailed("Must have at least one GenKW key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            plot = ShellPlot(key)
            for case_name in case_list:
                data = GenKwCollector.loadAllGenKwData(self.ert(), case_name, [key])

                if not data.empty:
                    plot.density(data, key, legend_label=case_name)
            plot.showLegend()
Exemple #10
0
    def do_plot_area(self, line):
        keys = matchItems(line, self.summaryKeys())

        if len(keys) == 0:
            print("Error: Must have at least one Summary key")
            return False

        case_list = self.shellContext()["plot_settings"].getCurrentPlotCases()

        for key in keys:
            plot = ShellPlot(key)
            for case_name in case_list:
                data = SummaryCollector.loadAllSummaryData(self.ert(), case_name, [key])
                plot.plotArea(data, value_column=key, legend_label=case_name)

            if len(case_list) > 0 and SummaryObservationCollector.summaryKeyHasObservations(self.ert(), key):
                observation_data = SummaryObservationCollector.loadObservationData(self.ert(), case_list[0], [key])
                plot.plotObservations(observation_data, value_column=key)

            plot.showLegend()