コード例 #1
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def exportVisibleCells(self, caseId, viewName, exportKeyword='FLUXNUM', visibleActiveCellsValue=1, hiddenActiveCellsValue=0, inactiveCellsValue=0):
     return self.__execute(exportVisibleCells=Cmd.ExportVisibleCellsRequest(caseId=caseId,
                                                                          viewName=viewName,
                                                                          exportKeyword=exportKeyword,
                                                                          visibleActiveCellsValue=visibleActiveCellsValue,
                                                                          hiddenActiveCellsValue=hiddenActiveCellsValue,
                                                                          inactiveCellsValue=inactiveCellsValue))
コード例 #2
0
def export_property(
    self,
    time_step,
    property_name,
    eclipse_keyword=property,
    undefined_value=0.0,
    export_file=property,
):
    """Export an Eclipse property

    Arguments:
        time_step (int): time step index
        property_name (str): property to export
        eclipse_keyword (str): Keyword used in export header. Defaults: value of property
        undefined_value (double): Value to use for undefined values. Defaults to 0.0
        export_file (str): File name for export. Defaults to the value of property parameter
    """
    return self._execute_command(exportProperty=Cmd.ExportPropertyRequest(
        caseId=self.id,
        timeStep=time_step,
        property=property_name,
        eclipseKeyword=eclipse_keyword,
        undefinedValue=undefined_value,
        exportFile=export_file,
    ))
コード例 #3
0
ファイル: instance.py プロジェクト: ysx1993/ResInsight
    def set_export_folder(self, export_type, path, create_folder=False):
        """
        Set the export folder used for all export functions

        **Parameters**::

            Parameter        | Description                                  | Type
            ---------------- | -------------------------------------------- | -----
            export_type      | String specifying what to export             | String
            path             | Path to folder                               | String
            create_folder    | Create folder if it doesn't exist?           | Boolean

        **Enum export_type**::

            Option          | Description
            --------------- | ------------
            "COMPLETIONS"   |   
            "SNAPSHOTS"     |
            "PROPERTIES"    | 
            "STATISTICS"    | 

        """
        return self.__execute_command(
            setExportFolder=Commands_pb2.SetExportFolderRequest(
                type=export_type, path=path, createFolder=create_folder))
コード例 #4
0
def create_well_bore_stability_plot(self,
                                    well_path,
                                    time_step,
                                    parameters=None):
    """Create a new well bore stability plot

    Arguments:
        well_path(str): well path name
        time_step(int): time step

    Returns:
        :class:`rips.generated.generated_classes.WellBoreStabilityPlot`
    """
    pb2_parameters = None
    if parameters is not None:
        assert isinstance(parameters, WbsParameters)
        pb2_parameters = parameters.pb2_object()

    plot_result = self._execute_command(
        createWellBoreStabilityPlot=Cmd.CreateWbsPlotRequest(
            caseId=self.id,
            wellPath=well_path,
            timeStep=time_step,
            wbsParameters=pb2_parameters,
        ))
    project = self.ancestor(rips.project.Project)
    plot = project.plot(view_id=plot_result.createWbsPlotResult.viewId)
    return plot
コード例 #5
0
ファイル: view.py プロジェクト: bska/ResInsight
def export_visible_cells(
    self,
    export_keyword="FLUXNUM",
    visible_active_cells_value=1,
    hidden_active_cells_value=0,
    inactive_cells_value=0,
):
    """Export special properties for all visible cells.

    Arguments:
        export_keyword (string): The keyword to export.
        Choices: 'FLUXNUM' or 'MULTNUM'. Default: 'FLUXNUM'
        visible_active_cells_value (int): Value to export forvisible active cells. Default: 1
        hidden_active_cells_value (int): Value to export for hidden active cells. Default: 0
        inactive_cells_value (int): Value to export for inactive cells. Default: 0
    """
    case_id = self.case().id
    return self._execute_command(
        exportVisibleCells=Cmd.ExportVisibleCellsRequest(
            caseId=case_id,
            viewId=self.id,
            exportKeyword=export_keyword,
            visibleActiveCellsValue=visible_active_cells_value,
            hiddenActiveCellsValue=hidden_active_cells_value,
            inactiveCellsValue=inactive_cells_value,
        ))
コード例 #6
0
ファイル: well_log_plot.py プロジェクト: bska/ResInsight
def export_data_as_las(
    self,
    export_folder,
    file_prefix="",
    export_tvdrkb=False,
    capitalize_file_names=False,
    resample_interval=0.0,
    convert_to_standard_units=False,
):
    """Export LAS file(s) for the current plot

    Arguments:
        export_folder(str): The path to export to. By default will use the global export folder
        file_prefix (str): Exported file name prefix
        export_tvdrkb(bool): Export in TVD-RKB format
        capitalize_file_names(bool): Make all file names upper case
        resample_interval(double): if > 0.0 the files will be resampled

    Returns:
        A list of files exported
    """
    res = self._execute_command(
        exportWellLogPlotData=Commands_pb2.ExportWellLogPlotDataRequest(
            exportFormat="LAS",
            viewId=self.id,
            exportFolder=export_folder,
            filePrefix=file_prefix,
            exportTvdRkb=export_tvdrkb,
            capitalizeFileNames=capitalize_file_names,
            resampleInterval=resample_interval,
            convertCurveUnits=convert_to_standard_units,
        ))
    return res.exportWellLogPlotDataResult.exportedFiles
コード例 #7
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
    def exportPropertyInViews(self, caseId, viewNames, undefinedValue):
        if isinstance(viewNames, str):
            viewNames = [viewNames]

        return self.__execute(exportPropertyInViews=Cmd.ExportPropertyInViewsRequest(caseId=caseId,
                                                                                   viewNames=viewNames,
                                                                                   undefinedValue=undefinedValue))
コード例 #8
0
ファイル: well_log_plot.py プロジェクト: bska/ResInsight
def export_data_as_ascii(self,
                         export_folder,
                         file_prefix="",
                         capitalize_file_names=False):
    """Export LAS file(s) for the current plot

    Arguments:
        export_folder(str): The path to export to. By default will use the global export folder
        file_prefix (str): Exported file name prefix
        capitalize_file_names(bool): Make all file names upper case

    Returns:
        A list of files exported
    """
    res = self._execute_command(
        exportWellLogPlotData=Commands_pb2.ExportWellLogPlotDataRequest(
            exportFormat="ASCII",
            viewId=self.id,
            exportFolder=export_folder,
            filePrefix=file_prefix,
            exportTvdRkb=False,
            capitalizeFileNames=capitalize_file_names,
            resampleInterval=0.0,
        ))
    return res.exportWellLogPlotDataResult.exportedFiles
コード例 #9
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def setStartDir(self, path):
     """Set current start directory
     
     Arguments:
         path (str): path to directory
     
     """
     return self.__execute(setStartDir=Cmd.FilePathRequest(path=path))
コード例 #10
0
def create_saturation_pressure_plots(self):
    """
    Create saturation pressure plots for the current case
    """
    case_ids = [self.id]
    return self._execute_command(
        createSaturationPressurePlots=Cmd.CreateSatPressPlotRequest(
            caseIds=case_ids))
コード例 #11
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def exportMultiCaseSnapshots(self, gridListFile):
     """Export snapshots for a set of cases
     
     Arguments:
         gridListFile (str): Path to a file containing a list of grids to export snapshot for
     
     """
     return self.__execute(exportMultiCaseSnapshot=Cmd.ExportMultiCaseRequest(gridListFile=gridListFile))
コード例 #12
0
def export_msw(self, well_path):
    """
    Export Eclipse Multi-segment-well model to file

    Arguments:
        well_path(str): Well path name
    """
    return self._execute_command(
        exportMsw=Cmd.ExportMswRequest(caseId=self.id, wellPath=well_path))
コード例 #13
0
def create_view(self):
    """Create a new view in the current case

    Returns:
        :class:`rips.generated.generated_classes.View`
    """
    return self.view(
        self._execute_command(createView=Cmd.CreateViewRequest(
            caseId=self.id)).createViewResult.viewId)
コード例 #14
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def openProject(self, path):
     """Open a project
     
     Arguments:
         path (str): path to project file
     
     
     """
     return self.__execute(openProject=Cmd.FilePathRequest(path=path))
コード例 #15
0
def export_multi_case_snapshots(self, grid_list_file):
    """Export snapshots for a set of cases

    Arguments:
        grid_list_file (str): Path to a file containing a list of grids to export snapshot for
    """
    return self._execute_command(
        exportMultiCaseSnapshot=Commands_pb2.ExportMultiCaseRequest(
            gridListFile=grid_list_file))
コード例 #16
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def exportSimWellFractureCompletions(self, caseId, viewName, timeStep, simulationWellNames, fileSplit, compdatExport):
     if(isinstance(simulationWellNames, str)):
         simulationWellNames = [simulationWellNames]
     return self.__execute(exportSimWellFractureCompletions=Cmd.ExportSimWellPathFraqRequest(caseId=caseId,
                                                                                           viewName=viewName,
                                                                                           timeStep=timeStep,
                                                                                           simulationWellNames=simulationWellNames,
                                                                                           fileSplit=fileSplit,
                                                                                           compdatExport=compdatExport))
コード例 #17
0
ファイル: instance.py プロジェクト: ysx1993/ResInsight
    def set_start_dir(self, path):
        """Set current start directory

        Arguments:
            path (str): path to directory

        """
        return self.__execute_command(setStartDir=Commands_pb2.FilePathRequest(
            path=path))
コード例 #18
0
def save(self, path=""):
    """Save the project to the existing project file, or to a new file

    Arguments:
        path(str): File path to the file to save the project to. If empty, saves to the active project file
    """
    self._execute_command(saveProject=Commands_pb2.SaveProjectRequest(
        filePath=path))
    return self
コード例 #19
0
def open(self, path):
    """Open a new project from the given path

    Arguments:
        path(str): path to project file

    """
    self._execute_command(openProject=Commands_pb2.FilePathRequest(path=path))
    return self
コード例 #20
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def replaceSourceCases(self, gridListFile, caseGroupId=0):
     """Replace all source cases within a case group
     
     Arguments:
         gridListFile (str): path to file containing a list of cases
         caseGroupId (int): id of the case group to replace
     
     """
     return self.__execute(replaceSourceCases=Cmd.ReplaceSourceCasesRequest(gridListFile=gridListFile,
                                                                            caseGroupId=caseGroupId))
コード例 #21
0
ファイル: view.py プロジェクト: bska/ResInsight
def export_property(self, undefined_value=0.0):
    """Export the current Eclipse property from the view

    Arguments:
        undefined_value (double): Value to use for undefined values. Defaults to 0.0
    """
    case_id = self.case().id
    return self._execute_command(
        exportPropertyInViews=Cmd.ExportPropertyInViewsRequest(
            caseId=case_id, viewIds=[self.id], undefinedValue=undefined_value))
コード例 #22
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def createLgrForCompletions(self, caseId, timeStep, wellPathNames, refinementI, refinementJ, refinementK, splitType):
     if isinstance(wellPathNames, str):
         wellPathNames = [wellPathNames]
     return self.__execute(createLgrForCompletions=Cmd.CreateLgrForCompRequest(caseId=caseId,
                                                                             timeStep=timeStep,
                                                                             wellPathNames=wellPathNames,
                                                                             refinementI=refinementI,
                                                                             refinementJ=refinementJ,
                                                                             refinementK=refinementK,
                                                                             splitType=splitType))
コード例 #23
0
def replace_source_cases(self, grid_list_file, case_group_id=0):
    """Replace all source grid cases within a case group

    Arguments:
        grid_list_file (str): path to file containing a list of cases
        case_group_id (int): id of the case group to replace
    """
    return self._execute_command(
        replaceSourceCases=Commands_pb2.ReplaceSourceCasesRequest(
            gridListFile=grid_list_file, caseGroupId=case_group_id))
コード例 #24
0
ファイル: gridcasegroup.py プロジェクト: ysx1993/ResInsight
def create_statistics_case(self):
    """Create a Statistics case in the Grid Case Group

    Returns:
        :class:`rips.generated.resinsight_classes.EclipseCase`
    """
    command_reply = self._execute_command(
        createStatisticsCase=Commands_pb2.CreateStatisticsCaseRequest(
            caseGroupId=self.group_id))
    return Case(self.channel, command_reply.createStatisticsCaseResult.caseId)
コード例 #25
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
 def replaceCase(self, newGridFile, caseId=0):
     """Replace the given case with a new case loaded from file
     
     Arguments:
         newGridFile (str): path to EGRID file
         caseId (int): case Id to replace
         
     """
     return self.__execute(replaceCase=Cmd.ReplaceCaseRequest(newGridFile=newGridFile,
                                                              caseId=caseId))
コード例 #26
0
ファイル: pdmobject.py プロジェクト: bska/ResInsight
    def _execute_command(self, **command_params):
        self.__warnings = []
        response, call = self._commands.Execute.with_call(
            Commands_pb2.CommandParams(**command_params))
        for key, value in call.trailing_metadata():
            value = value.replace(";;", "\n")
            if key == "warning":
                self.__warnings.append(value)

        return response
コード例 #27
0
def set_fracture_containment(self, template_id, top_layer, base_layer):
    """Set fracture template containment parameters

    Arguments:
        template_id(int): ID of fracture template
        top_layer (int): Top layer containment
        base_layer (int): Base layer containment
    """
    return self._execute_command(
        setFractureContainment=Commands_pb2.SetFracContainmentRequest(
            id=template_id, topLayer=top_layer, baseLayer=base_layer))
コード例 #28
0
def load_case(self, path, grid_only=False):
    """Load a new grid case from the given file path

    Arguments:
        path(str): file path to case
    Returns:
        :class:`rips.generated.generated_classes.Case`
    """
    command_reply = self._execute_command(
        loadCase=Commands_pb2.FilePathRequest(path=path, gridOnly=grid_only))
    return self.case(command_reply.loadCaseResult.id)
コード例 #29
0
ファイル: Commands.py プロジェクト: cxz/ResInsight
    def createGridCaseGroup(self, casePaths):
        """Create a Grid Case Group from a list of cases

        Arguments:
            casePaths (list): list of file path strings

        Returns:
            A case group id and name
        """
        commandReply = self.__execute(createGridCaseGroup=Cmd.CreateGridCaseGroupRequest(casePaths=casePaths))
        return (commandReply.createGridCaseGroupResult.groupId, commandReply.createGridCaseGroupResult.groupName)
コード例 #30
0
def replace(self, new_grid_file):
    """Replace the current case grid with a new grid loaded from file

    Arguments:
        new_egrid_file (str): Path to EGRID file
    """
    project = self.ancestor(rips.project.Project)
    self._execute_command(replaceCase=Cmd.ReplaceCaseRequest(
        newGridFile=new_grid_file, caseId=self.id))
    new_case = project.case(self.id)
    self.copy_from(new_case)