Ejemplo n.º 1
0
    def copyEnsemble(self, selected_parameters, selected_members):
        ert = self.getModel()

        selected_parameters = [str(parameter) for parameter in selected_parameters]
        selected_members = [int(member.strip()) for member in selected_members]

        source_case = str(self.sourceCase.currentText())
        source_report_step = self.sourceReportStep.getSelectedValue()
        source_state = ert_state_enum.resolveName(str(self.sourceType.currentText())).value()

        target_case = str(self.targetCaseLabel.text())
        target_report_step = self.targetReportStep.getSelectedValue()
        target_state = ert_state_enum.resolveName(str(self.targetType.currentText())).value()

        member_mask = ert.createBoolVector(self.membersList.count(), selected_members)
        ranking_key = None
        node_list = ert.createStringList(selected_parameters)

        ert.enkf.enkf_main_copy_ensemble(ert.main,
                                         source_case,
                                         source_report_step,
                                         source_state,
                                         target_case,
                                         target_report_step,
                                         target_state,
                                         member_mask,
                                         ranking_key,
                                         node_list)

        ert.freeStringList(node_list)
        ert.freeBoolVector(member_mask)
Ejemplo n.º 2
0
    def initializeCaseFromCase(self, selected_parameters, selected_members):
        ert = self.getModel()

        selected_parameters = [str(parameter) for parameter in selected_parameters]
        selected_members = [int(member.strip()) for member in selected_members]

        source_case = str(self.sourceCase.currentText())
        source_report_step = self.sourceReportStep.getSelectedValue()
        source_state = ert_state_enum.resolveName(str(self.sourceType.currentText())).value()
        member_mask = ert.createBoolVector(self.membersList.count(), selected_members)
        ranking_key = None
        node_list = ert.createStringList(selected_parameters)

        ert.enkf.enkf_main_initialize_from_existing__(ert.main,
                                                      source_case,
                                                      source_report_step,
                                                      source_state,
                                                      member_mask,
                                                      ranking_key,
                                                      node_list)

        ert.freeStringList(node_list)
        ert.freeBoolVector(member_mask)