OFMVOL2CSV
Parse output from Oilfield Manager (OFM) (or similar) containing production data pr. well into one CSV file. Date formats dd.mm.yyyy and YYYY-MM-DD (recommended) are supported.
usage: ofmvol2csv [-h] [-o OUTPUT] [-v] [--includefileorigin] [--version]
volfiles [volfiles ...]
Positional Arguments
- volfiles
Filenames with volumetric data. Glob-style wildcards are supported
Named Arguments
- -o, --output
Name of output CSV file
Default: “volfiles.csv”
- -v, --verbose
Be verbose
Default: False
- --includefileorigin
If this is set, a column named OFMVOLFILE will be added to identify the source file for each row.
Default: False
- --version
show program’s version number and exit
Use this to:
* Do QC and analysis on your historical production in Spotfire
* Be able to utilize Pandas for production data transformation
(scaling f.ex) ina history match setting
* Use Python and Pandas to later generate RMS events from the data,
after fixing whatever you need to fix
See also the utility csv2ofmvol.
Example
If you have a vol
-file with this data:
*METRIC
*DAILY
*HRS_IN_DAYS
*DATE *OIL *GAS *WATER *GINJ *DAYS
*Name Well_A
21.08.2003 0.00 0.00 0.00 115346.18 24.0
22.08.2003 0.00 0.00 0.00 115239.26 24.0
23.08.2003 0.00 0.00 0.00 115344.04 24.0
24.08.2003 0.00 0.00 0.00 115237.16 24.0
25.08.2003 0.00 0.00 0.00 115341.91 24.0
26.08.2003 0.00 0.00 0.00 115235.07 24.0
27.08.2003 0.00 0.00 0.00 115339.77 24.0
you can call
$ ofmvol2csv --verbose myvolfile.vol --output proddata.csv
and the file proddata.csv
will then contain:
WELL,DATE,OIL,GAS,WATER,GINJ,DAYS
WELL_A,2003-08-21,0.0,0.0,0.0,115346.18,24.0
WELL_A,2003-08-22,0.0,0.0,0.0,115239.26,24.0
WELL_A,2003-08-23,0.0,0.0,0.0,115344.04,24.0
WELL_A,2003-08-24,0.0,0.0,0.0,115237.16,24.0
WELL_A,2003-08-25,0.0,0.0,0.0,115341.91,24.0
WELL_A,2003-08-26,0.0,0.0,0.0,115235.07,24.0
WELL_A,2003-08-27,0.0,0.0,0.0,115339.77,24.0
Modifying production data
The reason for converting vol-files to CSV is to be able to utilize Pandas or other tools that reads CSV to for example modify production data.
Examples:
import pandas as pd
proddata = pd.read_csv("proddata.csv")
# Scale up all water production by 5 percent:
proddata["WATER"] = proddata["WATER"] * 1.05
proddata.to_csv("proddata-scaled.csv", index=False)
# Only include wells with non-zero oil production:
oildata = proddata.groupby("WELL").filter(lambda x: x["OIL"].sum() > 0)
oildata.to_csv("oilproducers.csv", index=False)
From CSV to vol again
See the subscript utility csv2ofmvol
to convert your modified CSV file
back to a vol-file again, for import into RMS for example.