Skip to main content

a set of utilities to deal with results from reservoir simulators and other sources of tabulated data.

Project description

datafiletoolbox

A set of classes and utilities to read different simulation output files, text files and Excel file in certain formats.
In order to read eclipse style binaries this utility relies on libecl from equinor: https://github.com/equinor/ecl

datafiletoolbox can also read eclipse-style input data deck, but this feature is not fully developed and is still a prototype.
It can be easily read include files of properties exported from Petrel to Eclipse and return a DataFrame with the data read from the file.

It takes care of the units of the data loaded and is able to convert them into other units.
In order to keep track of the units, a subclass of Pandas, is used to return the results.

load data

The easiest way to load data is using the function loadSimulationResults:
from datafiletoolbox import loadSimulationResults
data = loadSimulationResults( *path_to_file* )

get_data

To extract data from the loaded files the instances work in an analogous way to the Python dictionaries and Pandas DataFrames.
We can request a single Series using [*key_to_extract*] or DataFrames using [[*key_to_extract*]].
The instance can also be called using (*key_to_extract*) and in this case will return a NumPy array.

keys of VIP simulation results

The data from a VIP simulation can be accessed using regular eclipse nomenclature, like 'FOPT' meaning 'Qo' of 'ROOT' or 'WGPR:WELL1' meaning 'Qg' of 'WELL1'.

keys, wells, groups, regions

The properties .keys, .wells, .groups, .regions contain tuples with their corresponding list of values available in the loaded data. The method .find_Keys() can be used to find keys related to any well, group, region, attribute, or pattern (using ? * ...)

generic keys

The key does not need to be exact, it can be:

  • a general property, like 'WOPR', and the class will return all the vectors matching the key
  • the name of a well, region or group, like 'WELL1', and the class will return all the vectors for that key
  • it can contain wildcards, like 'W?PR' or 'WELL*'

changing the index of the returned DataFrames

The default index is defined automatically based on the available data, usually the 'TIME' vector or the 'DATE' vector.
To change the index use the .set_index(key) method. It can be any key in the data.

plotting

To make a plot from an instance of loaded data, simply use the .plot(keys) method and a matplotlib plot will be generated setting the color of the lines according to the fluid or data plotted.

X axis

By default, the X axis of the plot will be the index set to the instance.

comparing different results from different simulations

To compare the results of different simulations, simply pass the variable representing the instance of the other simulation to the .plot() method. The class will extract the data from both instances of data, convert the units of the other instances if required, and display the plot:

assume data0 is an eclipse binary result and data1 is a VIP simulation results
data0.plot('FOPR', data1)
will get the data from both results (converting the key from ECL style to VIP style to extract the data), convert units of data1 to corresponding units of data0, and show the plot.

further functionalities

Many more functions are available, not detailed in this readme.
A more detailed tutorial will be available sometime, in the meanwhile, please contact the author martinaraya@gmail.com for further details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datafiletoolbox-0.52.40.tar.gz (438.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datafiletoolbox-0.52.40-py3-none-any.whl (528.8 kB view details)

Uploaded Python 3

File details

Details for the file datafiletoolbox-0.52.40.tar.gz.

File metadata

  • Download URL: datafiletoolbox-0.52.40.tar.gz
  • Upload date:
  • Size: 438.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for datafiletoolbox-0.52.40.tar.gz
Algorithm Hash digest
SHA256 61fd97927d9c6c83267a8bcad67c8ae4fe6403d966da3a95f6b072e17828641d
MD5 35e99eb4430c9acb4e590511db9f7ca7
BLAKE2b-256 d2d0f35a2b43edfc594b8b849fb3547c3dd2843e8e10b624c4457f671ed35847

See more details on using hashes here.

File details

Details for the file datafiletoolbox-0.52.40-py3-none-any.whl.

File metadata

File hashes

Hashes for datafiletoolbox-0.52.40-py3-none-any.whl
Algorithm Hash digest
SHA256 2c9f38f0ce2994549519c9c4f97971e5e7ea5c726351c7ca572af9f148342e71
MD5 fee1a8d8469943d7c9268d325491145d
BLAKE2b-256 57ed9bc14a09efd104a6ce4cce4add51a47d45efcde162aa4658db5f5538f82f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page