Question: Ocean Temperature Plotting Write a program in PYTHON that: Prompts user to read in a file named oTemp.txt. Raise exception and terminate the program if
Ocean Temperature Plotting
Write a program in PYTHON that:
Prompts user to read in a file named oTemp.txt. Raise exception and terminate the program if file not found (i.e. file name entered wrong.)
Open the file and read in the data to a list. If a data is not a float number, raise an exception and throw it away. (you may print out an error message for each wrong data.
Multiple each of the data by 100 and save the whole data set in a new data file (out.txt).
Plot the original data as follows: (picture 1: similar not exact as that okay; picture 2: add title, x-axis and y-axis descriptions.)
oTemp.txt (with exceptions)
-0.07 -0.68 -0.26 -0.16 0.32 -0.2 -0.49 -0.5 -0.17 0 -0.52 -0.4 -0.81 -0.7 -0.37 -0.01 -0.35 -0.99 0.32 -0.27 0.21 -0.19 -0.26 -0.17 -0.21 -0.53 -0.16 -0.22 -0.27 -0.6 -0.57 -0.31 -0.82 -0.58 -0.93 -0.56 -0.54 -0.46 -0.75 -0.6 -0.72 -0.77 -0.77 -0.53 -0.5 -0.78 -0.45 -0.35 -0.64 -0.53 -0.64 -0.12 -0.97 -0.96 -1.05 -0.6 -0.6 -0.92 -0.79 -0.86 -0.63 -0.62 -1.09 -1.06 -0.6 -0.64 -0.48 -0.54 -0.75 -0.66 -0.52 -0.3 -0.69 -0.63 -0.66 -0.58 -0.67 -0.3 -0.45 -0.67 -0.32 -0.15 -0.47 -0.27 -0.39 -0.38 -0.09 -0.21 -0.29 -0.26 -0.32 -0.27 -0.46 -0.4 -0.39 -0.6 -0.43 -0.41 -0.51 -0.62 -0.75 -0.47 -0.27 -0.26 -0.58 -0.51 -0.82 -0.55 -0.61 -0.51 -0.53 -0.52 -0.46 -0.38 -0.64 -0.75 -0.39 -0.55 -0.73 -0.55 -0.49 -0.69 -0.61 -0.39 -0.58 -0.49 -0.83 -0.44 -0.69 -0.45 -0.36 -0.32 -0.38 -0.09 -0.45 -0.66 -0.53 -0.15 -0.01 -0.13 -0.22 0.04 -0.81 -0.45 0 -0.01 -0.1 -0.04 0.49 0.05 0.06 0.24 0.45 0.17 0.02 0.49 0.46 0.3 0.23 0.22 0.65 0.43 0.5.3 5#4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
