Well Properties#
This section focuses on retrieving well property values from a Well Properties Container. To generate well properties, you can extract them from a document (see Results Extraction in Document Management), run an IPTA (see IPTA ), run an IRTA (see IRTA ), or add them manually using the Well Flat View (see KAPPA-Automate Modes) etc.
Reading Well Properties Values#
To read well properties, first locate your well property container within your well:
import kappa_sdk as ka
import datetime as dt
connection = ka.Connection("https://your-ka-instance.com", verify_ssl=False)
field = next(x for x in connection.get_fields() if x.name == "Field")
well = next(x for x in field.wells if x.name == "Well")
well_property_container = next(x for x in well.well_property_containers if x.name == "Master")
Once you have retrieved the well property container, you have several options:
Retrieve all well properties values at a specific date:
well_properties_at_date = well_property_container.get_well_properties(dt.datetime.now())
Note
If you don’t specify a date, it returns the most recent value for each well property.
Retrieve all values for a specific numeric well property:
well_property_values = well_property_container.get_well_property_values("WellPropertyAlias")
dates = well_property_values.dates
values = well_property_values.values
Retrieve all values for a specific non-numeric well property:
non_numeric_well_propert_values = well_property_container.get_non_numeric_well_property_values("WellPropertyAlias")
non_numeric_well_property_values_dates = non_numeric_well_propert_values.dates
non_numeric_well_property_values_values = non_numeric_well_propert_values.values
Note
You can use the same parameters as the kappa_sdk.Data.read() method, such as unit, from_time, etc.
Warning
For both methods, you must use the property’s alias rather than its name to retrieve values.
Deleting Well Property Values#
You can delete values for a given well property over a time range using delete_well_property_values().
Warning
When deleting values from a master container, if a deleted value has an origin, all other well property values sharing that same origin and the same timestamp will also be deleted. Values without an origin are deleted individually. This behavior does not apply to non-master containers.
Well Properties Catalog#
To find a well property’s alias, you need to access the well properties catalog.
The system maintains a global well properties catalog that serves as a template when creating new fields. Each field receives a copy of this catalog, which you can then customize by adding field-specific well properties.
While the UI provides the easiest way to find well property aliases, you can also access them through the SDK.
Use the kappa_sdk.Connection object for the global catalog and the kappa_sdk.Field object for a field’s catalog:
global_well_properties_catalog = connection.well_properties_catalog
field_well_properties_catalog = field.well_properties_catalog
The catalog is a list of kappa_sdk.WellProperty objects that you can iterate through:
for well_property in field_well_properties_catalog:
print(f"Well Property Alias: {well_property.alias}")
print(f"Well Property Name: {well_property.name}")
Note
You can add new properties to either catalog by appending a new kappa_sdk.WellProperty instance, just as you would append an element to a list.
Well Events#
Well events are a specific type of well property. You can access them in the same way you access any other well property, but you can also access a well event from
kappa_sdk.Well.
events = well.events
You can also add or remove a list of events:
list_of_events = [ka.WellEvent(dt.datetime.now(), "Test Value", "Well Event Alias")]
well.add_well_event(list_of_events)
well.delete_well_event(list_of_events)