petrelpy.wellconnection ======================= .. py:module:: petrelpy.wellconnection .. autoapi-nested-parse:: Work with Eclipse well connection files. These are a handy export from Petrel that can get you well-specific properties. Functions --------- .. autoapisummary:: petrelpy.wellconnection.process_well_connection_file petrelpy.wellconnection.get_wellnames petrelpy.wellconnection.get_trajectory_geomodel_columns petrelpy.wellconnection.process_well_lateral petrelpy.wellconnection.get_trajectory petrelpy.wellconnection.get_well petrelpy.wellconnection.get_wellname Module Contents --------------- .. py:function:: process_well_connection_file(well_connection_file: str, wellname_to_heel: pandas.DataFrame, property_aggregates: dict[str, Any] | None = None, col_names: list[str] | None = None) -> pandas.DataFrame Get average properties along the laterals for a well connection file. :param well_connection_file: Eclipse well connection file exported from Petrel :type well_connection_file: str :param wellname_to_heel: DataFrame containing UWI,Name,Depth_Heel for each well in the connection file :type wellname_to_heel: pd.DataFrame :param property_aggregates: properties from the well connection file to extract and how to aggregate them :type property_aggregates: dict[str,Any] :param col_names: dictionary of column names in the well connection file you can check this with get_trajectory_geomodel_columns(well_connection_file) the first few are usually ['MD_ENTRY', 'GRID_I', 'GRID_J', 'GRID_K','WELL_ENTRY_X', 'WELL_ENTRY_Y','WELL_ENTRY_Z','ENTRY_FACE','MD_EXIT','WELL_EXIT_X','WELL_EXIT_Y', 'WELL_EXIT_Z','EXIT_FACE',] :type col_names: list Output: pd.DataFrame DataFrame indexed by UWI, with columns that are the keys of property_aggregates Note: vertical wells get everything included, wells not in wellname_to_heel are treated as vertical and have their wellname as their index .. py:function:: get_wellnames(wc_file: str | pathlib.Path) -> list[str] Get all the well names from a well connection file. .. py:function:: get_trajectory_geomodel_columns(fname: str | pathlib.Path) -> list[str] Get columns used for well trajectory. .. py:function:: process_well_lateral(well_string: str, wellname_to_heel: pandas.DataFrame, property_aggregates: dict[str, Any] | None = None, col_names: list[str] | None = None) -> pandas.Series Get average properties along the well lateral from the geomodel. :param well_string: portion of well connection file containing one well :type well_string: str :param wellname_to_heel: DataFrame containing UWI,Name,Depth_heel for each well in the connection file :type wellname_to_heel: pd.DataFrame :param property_aggregates: mapping from properties to aggregation methods :type property_aggregates: dict :param col_names: columns for the well trajectory :type col_names: list[str] :returns: average properties along the well's lateral :rtype: pd.Series .. py:function:: get_trajectory(well_string: str, col_names: list[str] | None = None) -> pandas.DataFrame Get trajectory for a well from the well connection file. :param well_string: well connection file portion :type well_string: str :param col_names: columns for the trajectory :type col_names: list[str] :returns: properties along the trajectory :rtype: pd.DataFrame .. py:function:: get_well(file_obj: collections.abc.Iterator[str]) Get section of well connection file for well. :param file_obj: loaded well connection file, iterated over row-by-row :type file_obj: Iterator[str] :Yields: *Iterator[str]* -- string containing well properties .. py:function:: get_wellname(well_string: str) -> str Get well's name from string. :param well_string: portion of well connection file with the well :type well_string: str :returns: well's name :rtype: str