equil
This is the res2df module for processing the SOLUTION
section of
the .DATA file.
Supported keywords are EQUIL
, RSVD
, RVVD
, PBVD
and
PDVD
. Typical usage is
from res2df import equil, ResdataFiles
dframe = equil.df(ResdataFiles('MYDECK.DATA'))
Which will provide a dataframe similar to the example below. Note that the column
Z is used both for datum depth and the depth values in RSVD
tables. The
amount of columns obtained depends on the input dataset, and should be possible
to link up with the Eclipse documentation. API doc: res2df.equil.df()
EQLNUM |
KEYWORD |
Z |
PRESSURE |
OWC |
GOC |
RS |
---|---|---|---|---|---|---|
1 |
EQUIL |
2469.0 |
382.4 |
1700.0 |
0.0 |
|
2 |
EQUIL |
2469.0 |
382.4 |
1000.0 |
0.0 |
|
1 |
RSVD |
1500.0 |
184.0 |
|||
1 |
RSVD |
4000.0 |
184.0 |
|||
2 |
RSVD |
1500.0 |
184.0 |
|||
2 |
RSVD |
4000.0 |
184.0 |
The dataframe obtained can be exported to CSV using .to_csv()
for further
processing or visualization, or it can be transformed using Python (Pandas)
operations.
Transforming data
Shifting all oil-water contacts down by one meter could for example be accomplished by the operation
dframe["OWC"] = dframe["OWC"] + 1
This statement will not interfere with the RSVD
lines, as they are NaN for
this column. But still, you might want to push your Rs initialization down
one meter for compatibility, which you could do by the statements:
rsvd_rows = dframe["KEYWORD"] == "RSVD"
dframe.loc[rsvd_rows, "Z"] = dframe.loc[rsvd_rows, "Z"] + 1
Re-exporting tables to include-files
When you are done with the table, you can generate new include files from your modified data by issuing
equil.df2res(dframe, filename="solution.inc")
The last step can also be done using the csv2res
command line utility
if you dump to CSV from your Python code instead.