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 11 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 drill-bit, 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 1: Drilling fluid system. Figure source.
1
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 10-90 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 3 dimensional points that represent locations along the pipe. They would
like to be able to visualize it by plotting 2D 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 y-axis of
our chart and the east-west cross section of the pipe on the x-axis of the chart. True vertical
depth is the distance below ground level (z =0) 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 X-ray goggles
that allowed us to see the well through the ground. The y-axis for this chart should be our
distance North (Northing), and the x-axis should be the distance East (Easting) from the
coordinate (0,0). This coordinate is an arbitrary point the petroleum engineers have defined
in relation to the pipe, and is what all their 3 dimensional data is based off of.
Given a csv file containing 3D points (x,y,z) 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 East-West Crossection (ft) on the graphs
x axis. Some example plots are shown below:
2
Figure 2: Example horizontal section of a well.
Figure 3: Example vertical section of a well.
3
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 plt.show() 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 plt.savefig(filename) 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
plt.clf() 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:
1. 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.
2. A path to which you should save the horizontal section graph image.
3. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!