Question: Problem 1 ( 2 0 marks ) : Reading, plotting, and analysing data from a file. Read in the contents of the file 'rev 2
Problem marks: Reading, plotting, and analysing data from a file.
Read in the contents of the file 'revdat' into a RecArray. This is a data file containing results from a spacecraft called Cassini: the magnetometer measurements from two orbits around Saturn in The columns are dayofyear since and three field components in spherical polar coordinates leftBr Btheta Bvarphiright Make the following plot:
Plot Br versus day of year since with cyan dots.
Limit the time date axis to between to days, and the y axis to between to
Label the axes appropriately and add a title and a legend.
Add a dotted green horizontal line at Br
Plot a quadratic regression line of best fit with a polynomial of second order in blue, and print the coefficients of the fit.
Introduce an array of days from to egldots For each of the days, calculate the daily mean of Br and also its daily maximum. Call these arrays Brmean and Brmax, respectively. Use array slicing and Boolean TrueFalse to select the data for this.
Plot Brmean and Brmax versus day of the year on the same panel as the data above with red crosses and a blue doshdat line, respectively, labelling the data appropriately.
Calculate the mean of Brmax and print it to the third significant digit using the format method.
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
