Read curves in Python
This recipe reads one curve of a well log into pandas. client is an ophiolite.Client for your project — see Build on Ophiolite for a key and the SDK.
log = next(a for a in client.assets() if a["name"] == "Gamma ray log")data = client.read(log["asset_id"], log["revision"], ["GR"])frame, meta = data.to_frame() # one column per curve, indexed by depthprint(meta.axis.unit, frame.head())The read is of that exact version: log["revision"] names it, and a newer version of the log does not change
what you read here. Missing samples stay missing (NaN), never zero; the depth unit (meta.axis.unit), curve
units and the depth reference are the source’s own declarations (data.descriptors[0]). To read a later version, list the
assets again and read its new revision.
From the item’s page. On a log’s or a stored item’s page in the Workspace, open Open in Python: it shows the
lines that read the version the page shows, exactly, with the server and project filled in. Set
OPHIOLITE_ACCESS_KEY to a project access key from your account page first; the lines never contain a key. A
connected wells table gives the lines that read your current selection.
A refusal says what to do: PermissionRefused (ask the owner to share the log with you), Unavailable (the
log or that version is not readable to you), VerificationFailed (the bytes did not match their digest; read
again). Each error carries the server’s remedy and request_id.
