{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Wellbore DDMS Reference APIs","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"wellbore-ddms-reference-apis","__idx":0},"children":["Wellbore DDMS Reference APIs"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#introduction"},"children":["Introduction"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#apis"},"children":["APIs"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"introduction","__idx":1},"children":["Introduction",{"$$mdtype":"Tag","name":"a","attributes":{"name":"introduction"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Wellbore DDMS Reference APIs let the user get the data of the given WellLog in the targeted reference.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"The targeted reference can be chosen between TVD and TVDSS.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"The targeted reference is computed using the data of the definitive trajectory of the Wellbore associated to this WellLog.",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"If the targeted reference is not present in the definitive trajectory of the parent wellbore, a 404 error message is returned in the response."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"apis","__idx":2},"children":["APIs",{"$$mdtype":"Tag","name":"a","attributes":{"name":"apis"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The module provide two APIs, one to get the data of the given WellLog in the targeted reference for the latest version and the other for a specific version of the WellLog."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"    /reference/v1/welllogs/{record_id}/data\n    /reference/v1/welllogs/{record_id}/version/{version}/data\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-parameters","__idx":3},"children":["API Parameters"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["{record_id}: The WellLog id"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["{version}: The version of the WellLog (only for the /version API)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["targeted_reference: The reference for which the WellLog data have to be returned. Supported values are TVD and TVDSS. Columns with the correct type (TrajectoryStationPropertyTypeID set to a TrajectoryStationPropertyType TVD or TVDSS) should be present in the associated definitive trajectory"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["offset: The number of rows that are to be skipped and not included in the result"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["limit: The maximum number of rows to be returned"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["curves: Filters curves. List of curves to be returned (in addition to MD and targeted_reference). If not set or set to None, only MD and targeted_reference are returned. The default value is set to None to maximize performances with large data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["orient: format for JSON only."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"best-practice","__idx":4},"children":["Best practice"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When retrieving large data (huge number of variables, columns and/or rows) it is a good practice to call this API only for reference (MD) and targeted reference (TVD)."," ","This can be achieved by letting the curves parameter empty."," ","It prevents unnecessary network calls and huge size of data transit between Wellbore DMS and Delfi-wdms services."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example use case: display big data using TVD"," ","Good workflow:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["call Wellbore DMS WellLog bulk api to get curves data (preferably by chunk)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["call Delfi-Wdms reference api to get MD and associated TVD (preferably by chunk) and append the TVD column to the result of Wellbore DMS call."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"code-example","__idx":5},"children":["Code example"]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        If needed install required modules\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# If needed install required modules\nimport sys\n!{sys.executable} -m pip install httpx\n!{sys.executable} -m pip install pandas\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Setup targeted environment and http client\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Setup targeted environment and http client\n\nimport httpx\nimport json\nimport pandas as pd\n\n#Authentication token\ntoken = 'your Bearer token'\n\n#evt\ndata_partition = 'opendes'\nOSDU_URL = \"https://evt.api.enterprisedata.cloud.slb-ds.com\"\nacl_domain = \"enterprisedata.cloud.slb-ds.com\"\nlegal_tag = \"opendes-default-legal\"\n\ndelfi_wdms_host = OSDU_URL + \"/api/delfi-wdms\"\nwdms_host = OSDU_URL + \"/api/os-wellbore-ddms\"\naccept_type = \"application/json\" # Can be changed to \"application/x-parquet\" to get result in parquet format\n\nheaders = {\n    'Content-Type': 'application/json', \n    'Accept': accept_type, \n    'data-partition-id':data_partition,\n    'Authorization': token\n}\n\ntransport = httpx.HTTPTransport(retries=3)\nclient = httpx.Client(transport=transport)\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Data creation for testing - Wellbore\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Data creation for testing\nwellbore = {\n    \"id\": f\"{data_partition}:master-data--Wellbore:delfiwdms-nb123456gw\",\n    \"kind\": \"osdu:wks:master-data--Wellbore:1.0.0\",\n    \"acl\": {\n      \"viewers\": [\n        f\"data.default.viewers@{data_partition}.{acl_domain}\"\n      ],\n      \"owners\": [\n        f\"data.default.owners@{data_partition}.{acl_domain}\"\n      ]\n    },\n    \"legal\": {\n      \"legaltags\": [\n        f\"{legal_tag}\"\n      ],\n      \"otherRelevantDataCountries\": [\n        \"FR\",\n        \"US\"\n      ]\n    },\n    \"data\": {\n      \"Source\": \"delfiwdms\",\n      \"DefinitiveTrajectoryID\": f\"{data_partition}:work-product-component--WellboreTrajectory:delfiwdms-nb123456gt:\",\n      \"VerticalMeasurements\": [\n            {\n                \"VerticalMeasurement\": 12155.0,\n                \"VerticalMeasurementID\": \"Total Depth MD\",\n                \"VerticalMeasurementPathID\": f\"{data_partition}:reference-data--VerticalMeasurementPath:MeasuredDepth:\",\n                \"VerticalMeasurementUnitOfMeasureID\": f\"{data_partition}:reference-data--UnitOfMeasure:ft:\"\n            },            \n            {\n                \"VerticalMeasurement\": 128.0,\n                \"VerticalMeasurementID\": \"Well Head Elevation\",\n                \"VerticalMeasurementPathID\": f\"{data_partition}:reference-data--VerticalMeasurementPath:TrueVerticalHeight:\",\n                \"VerticalMeasurementUnitOfMeasureID\": f\"{data_partition}:reference-data--UnitOfMeasure:ft:\"\n            }\n        ],\n        \"DefaultVerticalMeasurementID\": \"Well Head Elevation\"\n    }\n}\nr = client.post(wdms_host + f\"/ddms/v3/wellbores\", headers=headers, json=[wellbore])\nassert r.status_code==200\nprint('Wellbore created')\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Data creation for testing - WellLog\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Data creation for testing\nwelllog = {\n    \"id\": f\"{data_partition}:work-product-component--WellLog:delfiwdms-nb123456gw\",\n    \"kind\": \"osdu:wks:work-product-component--WellLog:1.1.0\",\n    \"acl\": {\n      \"viewers\": [\n        f\"data.default.viewers@{data_partition}.{acl_domain}\"\n      ],\n      \"owners\": [\n        f\"data.default.owners@{data_partition}.{acl_domain}\"\n      ]\n    },\n    \"legal\": {\n      \"legaltags\": [\n        f\"{legal_tag}\"\n      ],\n      \"otherRelevantDataCountries\": [\n        \"FR\",\n        \"US\"\n      ]\n    },    \"tags\": {\n      \"QualityScore\": \"Low\",\n      \"QCCompleteness\": \"High\",\n      \"QCValidity\": \"Low\"\n    },\n    \"data\": {\n      \"Name\": \"delfiwdms test wellLog\",\n      \"Source\": \"delfiwdms\",\n      \"TechnicalAssuranceID\": f\"{data_partition}:reference-data--TechnicalAssuranceType:Unsuitable:\",\n      \"WellboreID\": f\"{data_partition}:master-data--Wellbore:delfiwdms-nb123456gw:\",\n      \"TopMeasuredDepth\": 808.0,\n      \"BottomMeasuredDepth\": 812.5,\n      \"Curves\": [\n        {\n          \"CurveID\": \"DEPTH\",\n          \"CurveUnit\": f\"{data_partition}:reference-data--UnitOfMeasure:m:\",\n          \"Mnemonic\": \"DEPTH\",\n          \"LogCurveFamilyID\": f\"{data_partition}:reference-data--LogCurveFamily:Measured%20Depth:\",\n          \"NumberOfColumns\": 1\n        },\n        {\n          \"CurveID\": \"GR\",\n          \"CurveUnit\": f\"{data_partition}:reference-data--UnitOfMeasure:gAPI:\",\n          \"Mnemonic\": \"GR\",\n          \"LogCurveFamilyID\": f\"{data_partition}:reference-data--LogCurveFamily:Gamma%20Ray:\",\n          \"NumberOfColumns\": 1\n        }\n      ],\n      \"SamplingInterval\": 0.5,\n      \"ReferenceCurveID\": \"DEPTH\",\n      \"SamplingStart\": 808.0,\n      \"SamplingStop\": 812.5,\n      \"SamplingDomainTypeID\": f\"{data_partition}:reference-data--WellLogSamplingDomainType:Depth:\",\n      \"ExtensionProperties\": {}\n    }\n}\nr = client.post(wdms_host + f\"/ddms/v3/welllogs\", headers=headers, json=[welllog])\n# assert r.status_code==200 <-- it can fail if entity already created\n\nwelllog_bulks = {\"columns\":[\"DEPTH\",\"GR\"],\n                 \"index\":[0,1,2,3,4,5,6,7,8,9],\n                 \"data\":[[808.0,808.0],\n                         [808.5,808.5],\n                         [809.0,809.0],\n                         [809.5,809.5],\n                         [810.0,810.0],\n                         [810.5,810.5],\n                         [811.0,811.0],\n                         [811.5,811.5],\n                         [812.0,812.0],\n                         [812.5,812.5]]}\nr = client.post(wdms_host + f\"/ddms/v3/welllogs/{welllog['id']}/data\", headers=headers, json=welllog_bulks)\nassert r.status_code==200\nprint('WellLog created')\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Data creation for testing - Wellbore Trajectory\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Data creation for testing\nwellbore_trajectory = {\n    \"id\": f\"{data_partition}:work-product-component--WellboreTrajectory:delfiwdms-nb123456gt\",\n    \"kind\": \"osdu:wks:work-product-component--WellboreTrajectory:1.1.0\",\n    \"acl\": {\n      \"viewers\": [\n        f\"data.default.viewers@{data_partition}.{acl_domain}\"\n      ],\n      \"owners\": [\n        f\"data.default.owners@{data_partition}.{acl_domain}\"\n      ]\n    },\n    \"legal\": {\n      \"legaltags\": [\n        f\"{legal_tag}\"\n      ],\n      \"otherRelevantDataCountries\": [\n        \"FR\",\n        \"US\"\n      ]\n    },    \"data\": {\n      \"Source\": \"Techlog\",\n      \"WellboreID\": f\"{data_partition}:master-data--Wellbore:delfiwdms-nb123456gw:\",\n      \"TopDepthMeasuredDepth\": 800.0,\n      \"BaseDepthMeasuredDepth\": 809.75,\n      \"VerticalMeasurement\": {\n        \"VerticalReferenceID\": \"Well Head Elevation\"\n      },\n      \"AvailableTrajectoryStationProperties\": [\n        {\n          \"TrajectoryStationPropertyTypeID\": f\"{data_partition}:reference-data--TrajectoryStationPropertyType:MD:\",\n          \"StationPropertyUnitID\": f\"{data_partition}:reference-data--UnitOfMeasure:m:\",\n          \"Name\": \"MD\"\n        },\n        {\n          \"TrajectoryStationPropertyTypeID\": f\"{data_partition}:reference-data--TrajectoryStationPropertyType:TVD:\",\n          \"StationPropertyUnitID\": f\"{data_partition}:reference-data--UnitOfMeasure:m:\",\n          \"Name\": \"TVD\"\n        },\n        {\n          \"TrajectoryStationPropertyTypeID\": f\"{data_partition}:reference-data--TrajectoryStationPropertyType:TVDSS:\",\n          \"StationPropertyUnitID\": f\"{data_partition}:reference-data--UnitOfMeasure:m:\",\n          \"Name\": \"TVDSS\"\n        }\n      ],\n      \"ExtensionProperties\": {}\n    }\n}\nr = client.post(wdms_host + f\"/ddms/v3/wellboretrajectories\", headers=headers, json=[wellbore_trajectory])\n# assert r.status_code==200 <-- it can fail if entity already created\n\nwellbore_trajectory_bulks = {\"columns\":[\"TVD\",\"TVDSS\",\"MD\"],\n                             \"index\":[0.0,0.15,0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.5,1.65,1.8,1.95,2.1,2.25,2.4,2.55,2.7,2.85,3.0,3.15,3.3,3.45,3.6,3.75,3.9,4.05,4.2,4.35,4.5,4.65,4.8,4.95,5.1,5.25,5.4,5.55,5.7,5.85,6.0,6.15,6.3,6.45,6.6,6.75,6.9,7.05,7.2,7.35,7.5,7.65,7.8,7.95,8.1,8.25,8.4,8.55,8.7,8.85,9.0,9.15,9.3,9.45,9.6,9.75],\n                             \"data\":[[800.0,800.0,800.0],[800.15,800.15,800.15],[800.3,800.3,800.3],[800.45,800.45,800.45],[800.6,800.6,800.6],[800.75,800.75,800.75],[800.9,800.9,800.9],[801.05,801.05,801.05],[801.2,801.2,801.2],[801.35,801.35,801.35],[801.5,801.5,801.5],[801.65,801.65,801.65],[801.8,801.8,801.8],[801.95,801.95,801.95],[802.1,802.1,802.1],[802.25,802.25,802.25],[802.4,802.4,802.4],[802.55,802.55,802.55],[802.7,802.7,802.7],[802.85,802.85,802.85],[803.0,803.0,803.0],[803.15,803.15,803.15],[803.3,803.3,803.3],[803.45,803.45,803.45],[803.6,803.6,803.6],[803.75,803.75,803.75],[803.9,803.9,803.9],[804.05,804.05,804.05],[804.2,804.2,804.2],[804.35,804.35,804.35],[804.5,804.5,804.5],[804.65,804.65,804.65],[804.8,804.8,804.8],[804.95,804.95,804.95],[805.1,805.1,805.1],[805.25,805.25,805.25],[805.4,805.4,805.4],[805.55,805.55,805.55],[805.7,805.7,805.7],[805.85,805.85,805.85],[806.0,806.0,806.0],[806.15,806.15,806.15],[806.3,806.3,806.3],[806.45,806.45,806.45],[806.6,806.6,806.6],[806.75,806.75,806.75],[806.9,806.9,806.9],[807.05,807.05,807.05],[807.2,807.2,807.2],[807.35,807.35,807.35],[807.5,807.5,807.5],[807.65,807.65,807.65],[807.8,807.8,807.8],[807.95,807.95,807.95],[808.1,808.1,808.1],[808.25,808.25,808.25],[808.4,808.4,808.4],[808.55,808.55,808.55],[808.7,808.7,808.7],[808.85,808.85,808.85],[809.0,809.0,809.0],[809.15,809.15,809.15],[809.3,809.3,809.3],[809.45,809.45,809.45],[809.6,809.6,809.6],[809.75,809.75,809.75]]}\nr = client.post(wdms_host + f\"/ddms/v3/wellboretrajectories/{wellbore_trajectory['id']}/data\", headers=headers, json=wellbore_trajectory_bulks)\nassert r.status_code==200\n\nprint('Wellbore Trajectory created')\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Call to reference api\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Call to reference api\n\nparams = {\n    \"targeted_reference\": \"TVD\", # Can be TVD to get TVD or TVDSS to get the TVDSS\n    \"limit\": 3, # (optional) retrieve only 3 rows\n    \"offset\": 0, # (optional) starting at first row\n    \"curves\": \"GR\", # (optional) Additional curves to retrieve, the format is a string curve ids seprated by ','\n}\n\nr = client.get(delfi_wdms_host + f\"/reference/v1/welllogs/{welllog['id']}/data\", headers=headers, params=params)\nassert r.status_code==200\nprint(json.dumps(r.json(), indent=1)) \n\ndf = pd.read_json(json.dumps(r.json()), orient='split')\nprint(\"Dataframe view\")\ndisplay(df)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"  Dataframe view\n    {\n     \"columns\": [\n      \"DEPTH\",\n      \"GR\",\n      \"TVD\"\n     ],\n     \"index\": [\n      808.0,\n      808.5,\n      809.0\n     ],\n     \"data\": [\n      [\n       808.0,\n       808.0,\n       808.0\n      ],\n      [\n       808.5,\n       808.5,\n       808.5\n      ],\n      [\n       809.0,\n       809.0,\n       809.0\n      ]\n     ]\n    }\n\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{},"children":[{"$$mdtype":"Tag","name":"style","attributes":{"scoped":""},"children":["\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n        }\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n    .dataframe thead th {\n        text-align: right;\n    }\n"]},{"$$mdtype":"Tag","name":"table","attributes":{"border":"1","className":"dataframe"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{"style":{"textAlign":"right"}},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["DEPTH"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["GR"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["TVD"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["808.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Best practice example\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Best practice example\n\n# Call Wdms to get all columns\nparams = {\n    \"limit\": 5, \n    \"offset\": 1, \n}\nr = client.get(wdms_host + f\"/ddms/v3/welllogs/{welllog['id']}/data\", headers=headers, params=params)\nassert r.status_code==200\ndf_from_wdms = pd.read_json(json.dumps(r.json()), orient='split')\nprint(\"Dataframe from Wdms\")\ndisplay(df_from_wdms)\n\n# Get TVD from reference module\nparams = {\n    \"targeted_reference\": \"TVD\", # Can be TVD to get TVD or TVDSS to get the TVDSS\n    \"limit\": 4, \n    \"offset\": 0, \n}\n\nr = client.get(delfi_wdms_host + f\"/reference/v1/welllogs/{welllog['id']}/data\", headers=headers, params=params)\nassert r.status_code==200\n\ndf_from_reference_module = pd.read_json(json.dumps(r.json()), orient='split')\nprint(\"Dataframe from Reference module\")\ndisplay(df_from_reference_module)\n\n# Merge results\n# Drop Depth column before merging in df_from_reference_module\ndf_from_reference_module = df_from_reference_module[df_from_reference_module.columns[~df_from_reference_module.columns.isin([welllog['data']['ReferenceCurveID']])]]\n# Merge dataframe from Wdms and one from reference module\ndfres = pd.merge(df_from_wdms, df_from_reference_module, left_index=True, right_index=True)\nprint(\"Merged Dataframe\")\ndisplay(dfres)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"Dataframe from Wdms\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{},"children":[{"$$mdtype":"Tag","name":"style","attributes":{"scoped":""},"children":["\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n    .dataframe thead th {\n        text-align: right;\n    }\n"]},{"$$mdtype":"Tag","name":"table","attributes":{"border":"1","className":"dataframe"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{"style":{"textAlign":"right"}},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["DEPTH"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["GR"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["810.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["810.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["810.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["810.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["810.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["810.5"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"Dataframe from Reference module\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{},"children":[{"$$mdtype":"Tag","name":"style","attributes":{"scoped":""},"children":["\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n    .dataframe thead th {\n        text-align: right;\n    }\n"]},{"$$mdtype":"Tag","name":"table","attributes":{"border":"1","className":"dataframe"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{"style":{"textAlign":"right"}},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["DEPTH"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["TVD"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["808.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"Merged Dataframe\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{},"children":[{"$$mdtype":"Tag","name":"style","attributes":{"scoped":""},"children":["\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n    .dataframe thead th {\n        text-align: right;\n    }\n"]},{"$$mdtype":"Tag","name":"table","attributes":{"border":"1","className":"dataframe"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{"style":{"textAlign":"right"}},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["DEPTH"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["GR"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["TVD"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["808.5"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.0"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["809.5"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\n        Clean up test data\n    "]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"\n# Clean up data\nr = client.post(wdms_host + f\"/ddms/v3/records/delete\", headers=headers, json=[wellbore['id'], welllog['id'], wellbore_trajectory['id']])\nassert r.status_code==204\nprint('Data removed')\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"Data removed\n","lang":"json"},"children":[]}]}]},"headings":[{"value":"Wellbore DDMS Reference APIs","id":"wellbore-ddms-reference-apis","depth":1},{"value":"Introduction","id":"introduction","depth":2},{"value":"APIs","id":"apis","depth":2},{"value":"API Parameters","id":"api-parameters","depth":3},{"value":"Best practice","id":"best-practice","depth":3},{"value":"Code example","id":"code-example","depth":2}],"frontmatter":{"seo":{"title":"Wellbore DDMS Reference APIs"}},"lastModified":"2025-04-09T19:11:12.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/wellbore-dms/tutorial/reference","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}