res2df.vfp._vfpinj
Utilities to extract the VFPINJ data from an Eclipse (input) deck. Data can be extracted from Eclipse (.Ecl format) in 3 different formats: basic_data (dictionary with basic data types), df (pandas DataFrame) or pyarrow_tables (pyarrow.Tables).
Data can be extracted from a complete deck or from individual files. Supports output both in csv format as a pandas DataFrame or in pyarrow a pyarrow.Table. Also functionality to write pandas DataFrame and pyarrow.Table to file as Eclipse .Ecl format
- res2df.vfp._vfpinj.basic_data(keyword, vfpnumbers_str=None)[source]
Read and return all data for Eclipse VFPINJ keyword as basic data types
Empty string returned if vfp table number does not match any number in list
- Parameters:
keyword – .DATA file keyword
vfpnumbers_str – String with list of vfp table numbers to extract. Syntax “[0,1,8:11]” corresponds
- res2df.vfp._vfpinj.basic_data2df(tableno, datum, rate_type, thp_type, unit_type, tab_type, flow_values, thp_values, thp_indices, tab_data)[source]
Return a pandas DataFrame from VFPINJ liftcurve data
- Parameters:
tableno (
int
) – table numberdatum (
float
) – datum depthrate_type (
VFPINJ_FLO
) – rate type used for flow valuesthp_type (
THPTYPE
) – thp type used for THP valuesunit_type (
UNITTYPE
) – unit typetab_type (
VFPINJ_TABTYPE
) – type for tabulated (record) valuesflow_values (
ndarray
) – rate values used to generate tablethp_type – thp type
thp_indices (
ndarray
) – which index in thp value table a given BHP value corresponds to (1-base)tab_data (
ndarray
) – tabulated (BHP) data (ordered as thp- and flow-values)
- Return type:
DataFrame
- res2df.vfp._vfpinj.basic_data2pyarrow(tableno, datum, rate_type, thp_type, unit_type, tab_type, flow_values, thp_values, thp_indices, tab_data)[source]
Return a pyarrow Table from VFPINJ record data
- Parameters:
tableno (
int
) – table numberdatum (
float
) – datum depthrate_type (
VFPINJ_FLO
) – rate type used for flow valuesthp_type (
THPTYPE
) – thp typeunit_type (
UNITTYPE
) – unit typetab_type (
VFPINJ_TABTYPE
) – type for tabulated (record) valuesflow_values (
ndarray
) – rate values used to generate tablethp_values (
ndarray
) – THP values used to generate tablethp_indices (
ndarray
) – THP indices for each record in tabulated datatab_data (
ndarray
) – tabulated (BHP) data (ordered according to thp- and flow-values)
- Return type:
Table
- res2df.vfp._vfpinj.df(keyword, vfpnumbers_str=None)[source]
Return a dataframes of a single VFPINJ table from a .DATA file
Data from the VFPINJ keyword are stacked into a Pandas Dataframe
- Parameters:
keyword – .DATA file keyword
vfpnumbers_str – String with list of vfp table numbers to extract. Syntax “[0,1,8:11]” corresponds to [0,1,8,9,10,11].
- res2df.vfp._vfpinj.df2basic_data(dframe)[source]
Return basic data type for VFPINJ from a pandas dataframe.
Return format is a dictionary all data in VFPINJ in basic data types (str, int, float, numpy.array)
- Parameters:
dframe (
DataFrame
) – pandas DataFrame for VFPINJ- Return type:
Dict
[str
,Any
]
- res2df.vfp._vfpinj.df2res(dframe, comment=None)[source]
Creates a include file content string representing single VFPINJ Eclipse input from a dataframe
All data for the keywords VFPINJ will be returned.
- Parameters:
dframe (
DataFrame
) – Dataframe containing complete description of single VFPINJ inputcomment (
Optional
[str
]) – Text that will be included as comment
- Return type:
str
- res2df.vfp._vfpinj.pyarrow(keyword, vfpnumbers_str=None)[source]
- Return a pyarrow Table of a single VFPINJ table from a .DATA file
If no VFPINJ table found, return None
- Parameters:
keyword – .DATA file keyword
vfpnumbers_str – String with list of vfp table numbers to extract. Syntax “[0,1,8:11]” corresponds to [0,1,8,9,10,11].
- res2df.vfp._vfpinj.pyarrow2basic_data(pa_table)[source]
Return basic data type for VFPINJ from a pyarrow.Table.
Return format is a dictionary all data in VFPINJ in basic data types (str, int, float, numpy.array)
- Parameters:
pa_table (
Table
) – pyarrow Table with data for VFPINJ- Return type:
Dict
[str
,Any
]