Question: a ) Load the data using input _ data = np . genfromtxt ( f ilename, delimiter = ' , ' ) with the appropriate
a Load the data using inputdata npgenfromtxt ilename, delimiter with the appropriate substitution for the string filename
Note: The function will load an array with shape The data points for elevations axis of the topographic profile are stored in the first column of the
array and the longitudes axis are stored in the second column.
b Extract the measured heights elevations from the first column into a new variable heights. Also extract the corresponding longitudes from the second column into a new
variable named lons.
Calculations:
c Find the maximum and minimum heights in the profile and save them to variables max and min respectively. Also find the index position of the minimum and maximum
heights, saving those to maxidx and minidx.
Use functions npmin to find the minimum and npmax to find the maximum. Use functions np argmin to find index of the minimum and argmax to find
the index of the maximum.
d Find the two longitudes that correspond to the and min of the profile and save them to variables lonhmax and lonhmin respectively. Use a neatly formatted
string to print the longitudeheight pair for both the minimum and maximum heights to two decimal precision.
e Calculate the length of the small circle at and assign the result to a variable Lsmall. Use for the radius of the Earth.
Note: The function npcos expects its input argument to be in radians and not degrees. Use the function np deg rad to do this conversion from degrees to
radians.
f Calculate the total length of the profile in kilometres, saving your result to a variable Lprofile.
Note: You might want to calculate an intermediate quantity which is the number of km per degree of longitude at see the reading
g Using Vancouver's longitude of convert the longitudes in lons to distance in from Vancouver and save to a new variable fromvan
h Find the index position corresponding to Vancouver's location in the profile. Use the index to save the height at this point to a variable named van
Note: the array lons does not contain the exact value of so you will need to instead identify the next nearest longitude. This is similar to Part i in Question
Plotting:
i Plot the profile in units of metres for elevations against the distance from Vancouver in units of kilometres with elevations in the axis.
j Using the variables above, plot the maximum with a red circle, and the minimum with a blue circle. Also indicate the location of Vaincouver on the profile line using a green star
marker.
k Add a horizontal dashed line at sea level zero elevation on vour plot.
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
