Question: Write python code for this prompt: Introduction In this assessment you will implement a Python program to open and parse a formatted data file, do
Write python code for this prompt: Introduction
In this assessment you will implement a Python program to open and parse a formatted
data file, do some minor manipulation of the data, and finally plot that data in a pair of
graphs.
The Week jupyer notebook reading will be the most helpful if you feel like you are
missing something dealing with the pyplot module.
Problem
When drilling wells water oil, geothermal, natural gas, etc. a primary component of
the drilling process is the fluid circulating system. The drilling fluid, called mud serves
numerous functions: cooling, cleaning, and lubricating the drillbit, transporting cuttings
small pieces of rock cut by the bit from downhole to the surface, and providing hydrostatic
pressure to prevent formation fluids from entering the wellbore, etc.
Figure : Drilling fluid system. Figure source.
A primary purpose of the drilling mud is to transmit downhole data to the surface through
pressure pulses. This process is called mud pulse telemetry. One of the most important
pieces of data transported to the surface is the Directional Survey data, which provides
the location of the bit, and is used to track the wells path through the Earth. Surveys are
taken often while drilling, with anywhere from ft between survey stations, and provide
information about the inclination and azimuth of the pipe that is the angles that represent
the direction of the pipe
Imagine that several petroleum engineers have drilled a well, and have used mud pulse
telemetry to provide Directional Survey data for the well. Using this, theyve derived a csv
file with a series of dimensional points that represent locations along the pipe. They would
like to be able to visualize it by plotting D images of both the vertical section and horizontal
section of the pipe.
The vertical section is the view of the well as if we were looking at a side view through
the Earth, facing directly north. We have TVD true vertical depth info on the yaxis of
our chart and the eastwest cross section of the pipe on the xaxis of the chart. True vertical
depth is the distance below ground level z of the pipe.
The horizontal section is the view of the well as if we were looking at a top view, that
is if we were in a helicopter looking down onto the surface of the Earth with Xray goggles
that allowed us to see the well through the ground. The yaxis for this chart should be our
distance North Northing and the xaxis should be the distance East Easting from the
coordinate This coordinate is an arbitrary point the petroleum engineers have defined
in relation to the pipe, and is what all their dimensional data is based off of
Given a csv file containing D points xyz plot the vertical and horizontal sections of
the pipe. The dimensions given will be in feet. The x y and z axis will be defined as follows:
Positive x points East
Positive y points North
Positive z points vertically upwards
The name of each graph should be the name of the data file without the csv file extension
followed by the type of graph horizontal section or vertical section For the horizontal
section, the axis titles should be Northing NS ft on the graphs y axis, and Easting
EW ft on the graphs x axis. For the vertical section, the axis titles should be True
Vertical Depth ft on the graphs y axis, and EastWest Crossection ft on the graphs
x axis. Some example plots are shown below:
Figure : Example horizontal section of a well.
Figure : Example vertical section of a well.
Plot Management
Plots with pyplot are handled a little differently than constructs we have seen in the
past. While plots are not stored in an accessible variable, changes to them are retained
unless explicitly cleared.
The pltshow function makes the current plot visible. It is very convenient for debug
ging, but be sure not to use it in your final submission.
The pltsavefigfilename function saves the current plot to the filename provided.
This function is what your program should use to generate the two graph image files re
quested.
Pyplot is flexible enough to allow multiple plots to be saved and shown at once. In
our case though, this is an obstacle as we only want to generate one plot at a time. After
your first plot is created and saved, and before starting to generate another, you should use
pltclf to clear the current plot. This ensures no elements if your first plot are retained
into the second.
Input
Three lines will be provided as user input:
A path to an input csv file containing the survey data. This data file contains three
columns with one row of headers. Each row contains the x y and z coordinates, in
that order, represented by floats.
A path to which you should save the horizontal section graph image.
A path to which you should save the vertical section graph image.
Output
Your program will not produce any text output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
