An utility facilitate extracting data from PI Vision and PDM databases.
Project description
read_pi & read_pdm
Both tools are inteded to simplify data extraction from PI as well as from PDM databases.
To use this functions, the packages pdm_tools
https://github.com/equinor/pdm-tools and tag_reader
https://github.com/equinor/tagreader-python
read_pi
Tool to facilitate downloading data from PI tags.
This function will avoid requesting more than 150000 datapoints, by automaticaly spliting the requested interval in smaller chunks and will return a concatenated dataframe with the entire requested interval.
ussage
A single function is needed:
get_data_from_PI(tags, start, end, interval, agg='AVG', pi_connection=None, verbose=False, rename=True, use_cache=False)
The tag
parameter can be an list of string tags or a string representing a tag.
The tag
parameter can also be a dict
of alias (tag readble names) and tags, like {'name': 'tag'}
. If this kind of dictionary is provided, the returned dataframe will have the column names renamed accordingly. The original names can be found in the dataframe attribute .attrs
.
Renaming the columns might be avoided by setting the rename
parameter to False
The paramaters start
and end
can be date&time representation, if a string is provided it will be converted to pd.datetime64
.
agg
paramenter indicated the requested aggregation to pass to PI.
An existing pi connection may be provided using pi_connection
. It is optional, if None
, a new connection will be created.
To speed up the data gathering, a cache of the requested data might be keep by setting the parameter use_cache
to True
.
The cache file can be deleted by calling the function clean_cache()
This funcion returns a pandas.DataFrame
read_pdm
A set of functions to facilitate extracting production and injection data from PDM database:
list_producers
list_producers(field_name:str)
The input parameter is a string representing the field name, like 'HEIDRUN'.
The function returns a pandas.DataFrame containing a list of the production wells and their start injection date and last injection date.
get_production
get_production(field_name:str, wb_uwbi:str=None, from_date:str=None, until_date:str=None, columns=None)
Parameters:
- field_name : str The only mandatory paramenter, to avoid downloading the entire company database...
- wb_uwbi : str, optional A string representing the UWBI of a well can be provided to download only the data for that well
- from_date : str, optional, in format YYYY-MM-DD A string representing a date, formated like 2024-12-31. Only data from that date on will be downloaded
- from_date : str, optional, in format YYYY-MM-DD A string representing a date, formated like 2024-12-31. Only data unil that date (included) will be downloaded
- columns : str or array-like (list), optional A string representing the column(s) name(s) to download. If several columns are indicated in a single string, they must be separated by comma (,). Optionally a list of strings may be provided.
Return
pandas.DataFrame
list_injectors
list_injectors(field_name:str)
The input parameter is a string representing the field name, like 'HEIDRUN'.
The function returns a pandas.DataFrame containing a list of the injection wells and their start injection date and last injection date.
get_injection
get_injection(field_name:str, wb_uwbi:str=None, from_date:str=None, until_date:str=None, columns=None)
Parameters:
- field_name : str The only mandatory paramenter, to avoid downloading the entire company database...
- wb_uwbi : str, optional A string representing the UWBI of a well can be provided to download only the data for that well
- from_date : str, optional, in format YYYY-MM-DD A string representing a date, formated like 2024-12-31. Only data from that date on will be downloaded
- from_date : str, optional, in format YYYY-MM-DD A string representing a date, formated like 2024-12-31. Only data unil that date (included) will be downloaded
- columns : str or array-like (list), optional A string representing the column(s) name(s) to download. If several columns are indicated in a single string, they must be separated by comma (,). Optionally a list of strings may be provided.
Return
pandas.DataFrame
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file read_pi-0.2.7-py3-none-any.whl
.
File metadata
- Download URL: read_pi-0.2.7-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f078f505355ba809a253b27d03a76089f99c7efd89b63c901ba630935ba07f8 |
|
MD5 | ea760feb34af5c3edcdaad097dbb800a |
|
BLAKE2b-256 | b7cca434ed72340fb088ee560f4ed3bc449377111ef4d931e0c258092ce84442 |