Ejemplo n.º 1
0
    def __init__(self, parent):
        super(GenKWKeys, self).__init__("gen_kw", parent)
        self.addShellFunction(name="list", function=GenKWKeys.list, help_message="Shows a list of all available GenKW keys.")

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "GenKW")
        ShellPlot.addHistogramPlotSupport(self, "GenKW")
        ShellPlot.addGaussianKDEPlotSupport(self, "GenKW")
        ShellPlot.addDistributionPlotSupport(self, "GenKW")
        ShellPlot.addCrossCaseStatisticsPlotSupport(self, "GenKW")
Ejemplo n.º 2
0
    def __init__(self, parent):
        super(CustomKWKeys, self).__init__("custom_kw", parent)

        self.addShellFunction(**{"name": "list",
                                 "function": CustomKWKeys.list,
                                 "help_message": "List all CustomKW keys."})

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "CustomKW")
        ShellPlot.addHistogramPlotSupport(self, "CustomKW")
        ShellPlot.addGaussianKDEPlotSupport(self, "CustomKW")
        ShellPlot.addDistributionPlotSupport(self, "CustomKW")
        ShellPlot.addCrossCaseStatisticsPlotSupport(self, "CustomKW")
Ejemplo n.º 3
0
    def __init__(self, parent):
        super(GenKWKeys, self).__init__("gen_kw", parent)
        self.addShellFunction(
            name="list",
            function=GenKWKeys.list,
            help_message="Shows a list of all available GenKW keys.")

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "GenKW")
        ShellPlot.addHistogramPlotSupport(self, "GenKW")
        ShellPlot.addGaussianKDEPlotSupport(self, "GenKW")
        ShellPlot.addDistributionPlotSupport(self, "GenKW")
        ShellPlot.addCrossCaseStatisticsPlotSupport(self, "GenKW")
Ejemplo n.º 4
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_"))
Ejemplo n.º 5
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()
Ejemplo n.º 6
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()
Ejemplo n.º 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_"))
Ejemplo n.º 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()
Ejemplo n.º 9
0
    def __init__(self, parent):
        super(CustomKWKeys, self).__init__("custom_kw", parent)

        self.addShellFunction(
            **{
                "name": "list",
                "function": CustomKWKeys.list,
                "help_message": "List all CustomKW keys."
            })

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "CustomKW")
        ShellPlot.addHistogramPlotSupport(self, "CustomKW")
        ShellPlot.addGaussianKDEPlotSupport(self, "CustomKW")
        ShellPlot.addDistributionPlotSupport(self, "CustomKW")
        ShellPlot.addCrossCaseStatisticsPlotSupport(self, "CustomKW")
Ejemplo n.º 10
0
    def __init__(self, parent):
        super(SummaryKeys, self).__init__("summary", parent)

        self.addShellFunction(
            name="list",
            function=SummaryKeys.list,
            help_message=
            "Shows a list of all available Summary keys. (* = with observations)"
        )

        self.addShellFunction(
            name="observations",
            function=SummaryKeys.observations,
            help_message=
            "Shows a list of all available Summary key observations.")

        self.addShellFunction(
            name="matchers",
            function=SummaryKeys.matchers,
            help_message=
            "Shows a list of all Summary keys that the ensemble will match "
            "against during simulations and manual load.")

        self.addShellFunction(
            name="add_matcher",
            function=SummaryKeys.add_matcher,
            help_arguments="<summary_key>",
            help_message="Add a matcher to the Summary key matcher set.")

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "Summary")
        ShellPlot.addEnsemblePlotSupport(self, "Summary")
        ShellPlot.addQuantilesPlotSupport(self, "Summary")
Ejemplo n.º 11
0
    def __init__(self, parent):
        super(SummaryKeys, self).__init__("summary", parent)

        self.addShellFunction(name="list",
                              function=SummaryKeys.list,
                              help_message="Shows a list of all available Summary keys. (* = with observations)")

        self.addShellFunction(name="observations",
                              function=SummaryKeys.observations,
                              help_message= "Shows a list of all available Summary key observations.")

        self.addShellFunction(name="matchers",
                              function=SummaryKeys.matchers,
                              help_message="Shows a list of all Summary keys that the ensemble will match "
                                           "against during simulations and manual load.")

        self.addShellFunction(name="add_matcher",
                              function=SummaryKeys.add_matcher,
                              help_arguments="<summary_key>",
                              help_message="Add a matcher to the Summary key matcher set.")

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "Summary")
        ShellPlot.addEnsemblePlotSupport(self, "Summary")
        ShellPlot.addQuantilesPlotSupport(self, "Summary")
Ejemplo n.º 12
0
    def __init__(self, parent):
        super(GenDataKeys, self).__init__("gen_data", parent)
        self.addShellFunction(name="list", function=GenDataKeys.list, help_message="Shows a list of all available GenData keys.")

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "GenData")
        ShellPlot.addEnsemblePlotSupport(self, "GenData")
        ShellPlot.addQuantilesPlotSupport(self, "GenData")
Ejemplo n.º 13
0
    def __init__(self, parent):
        super(GenDataKeys, self).__init__("gen_data", parent)
        self.addShellFunction(
            name="list",
            function=GenDataKeys.list,
            help_message="Shows a list of all available GenData keys.")

        self.__plot_data_gatherer = None

        ShellPlot.addPrintSupport(self, "GenData")
        ShellPlot.addEnsemblePlotSupport(self, "GenData")
        ShellPlot.addQuantilesPlotSupport(self, "GenData")
Ejemplo n.º 14
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()
Ejemplo n.º 15
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()