讲解:MTMA33、syntax、python、pythonC/C++|Processing

MTMA33: INTRODUCTIONAssignment 1Background and syntax1. El Nino and its effectsThe El Nino Southern Oscillation (ENSO) results in sea surface temperature (SST) anomaliesin the Pacific Ocean. ENSO has strong local effects, especially on fisheries. Theperturbations to the circulation caused by ENSO also have far-reaching effects on weatherthroughout the tropics. These remote effects are known as ‘teleconnections’. The expectedimpact of El Nino on rainfall is shown in Figure 1.Figure 1: Typical rainfall patterns during El Nino events (map produced by the IRI)The ENSO related impact on rainfall has significant societal impact, including on themanagement of hydrological systems. In this assignment, you will investigate the effect ofENSO on the Angat reservoir in the Philippines.2. Linear regression and prediction models in pythonA common way of investigating the strength of ENSO effects is to use linear regression. Thestrength of an El Nino can be measured by the SST anomaly in the central eastern Pacific(Nino3.4 region). In this case, we are considering the effect of ENSO on reservoir level. Thiscan be ‘modelled’ as:Reservoir_level = A + B * Nino3_SST_anomaly3There are several functions in python for doing a linear regression and hence deriving A andB. These functions are in the numpy or scipy modules. For example:from scipy.stats.stats import linregressimport numpy as npX = np.array([1,3,4,5,7])Y = np.array([10,9,4,3,1])linearmodel = linregress(X,Y)linregress() returns a tuple containing a description of the linear model. If you look at thehelp function for linregress by typing help(linregress), you will find that the first twoelements of this tuple (in our example, linearmodel[0] and linearmodel[1]) are the slope (B)and intercept (A). The third and fourth elements are the correlation co-efficient and p-value(the likelihood of the null hypothesis that the slope (B) is 0).Assignment tasksEarly warning of floods or water shortages is the key to managing water resourcesefficiently. Meteorological services are regularly called on to issue early warnings of floodand drought. In this assignment, you will be investigating the teleconnection between ENSOand inflow to the Angat reservoir, near Manila in the Philippines. You will develop a linearregression model of the link between Nino3.4 SST and dam inflow and use it to estimate theimpact of a predicted El Nino.I have provided you with historical seasonal time series for Nino3.4 and inflow to thereservoir. The data are in the file “assignment1_data.txt”, which you can download fromhttp://www.met.reading.ac.uk/~swrmethn/python_teaching/assignment_data/assignment1_data.txtThe file contains four columns of data: year, month, dam inflow, Nino3.4 anomaly.Task 1Write a series of functions to extract dam inflow data and compare it against the Nino3.4anomaly for each month of the year.Can you see a relationship between the two quantities? Does this relationship varyseasonally? Investigate further, for example by using scatter plots.Present your results as a short description (maximum one page) and four plots. Note thatrestricting the number of plots is intended to assess your ability to design plots that displaydata effectively and support your description. You should also submit your code forassessment in a separate file (see below). 4Task 2Use the linregress function to devMTMA33代做、代写syntax、python编程设计调试elop a model for dam inflow for December, based onknowledge of monthly Nino3.4 SST anomalies up to the current month. How accurate doyou think your prediction model is?Present your results as a short description (maximum one page) and a maximum of twoplots. You should also submit your code for assessment.Task 3Using examples from your own code, discuss how code can be designed so that the editor ofa scientific journal, or another researcher, could understand your calculations and use thecode to reproduce your results (given the same input data). [maximum one page]Format of submissionsSubmit your written answers for all three tasks of Assignment 1 in a single PDF file that youmust upload to Blackboard under “Assignment 1”. This file should not contain the code.Most people find that the easiest way to do this is to write your assignment report in aWORD doc. Include figures generated by your code by exporting them from Spyder figurewindows as PNG images and then importing these figures into your document.Upload one Python file with your code for Task 1 and call it task1_mysurname.py (substituteyour actual surname in place of “mysurname”).Upload a second Python file with your code for Task 2 and call it task2_mysurname.py5Marking criteriaYou will be assessed on the following criteria:• Quality of code. Use the guidance on good programming practices and conventions on stylereading the Course Notes Section 4.3 and 5 (70%)• Clarity of plots, description and interpretation (30%)Criteria >72% (Distinction) 60 – 69%Assignment report writing30% of your assignment marks are allocated to plots, divided into plot description (20%) andinterpretation of results (10%). This is what we are looking for:1. The report should be written in full sentences, ensuring that the work makes sense tosomeone who has not read the question sheet. Enough detail should be given so that theanalysis could be repeated (and re-implemented) by someone who has not got access to thecode.2. Be concise. Quality not quantity. Proof read and think, “could I have got the sameinformation across more concisely?”3. The work should be proof read for basic errors (e.g., incorrect figure numbers)4. All figures / plots should be referenced within the text.5. Plots should be chosen that illustrate the key points being made in the text.6. All plots should have labeled axes, including units. The text on plots should be big enoughto read easily. All symbols should be clear and easy to differentiate. If applicable, a keyshould be provided.7. Captions should clearly describe what is plotted, but should not contain interpretation oranalysis.8. Your interpretation should clearly stem from your analysis and results – as shown in yourplots. For the highest marks, this should be put in the context of the literature. Forexample, ‘Figure 3 shows that TAMSAT underestimates high rainfall. This is consistent withMaidment et al, 2013, which demonstrates that TAMSAT underestimates the intensity ofhigh rainfall events in Uganda’.What you will not be penalized for:1. Grammatical or stylistic errors that do not detract from the meaning of the text.2. Submitting more code that you are asked for.3. Carry through errors i.e. if you make a mistake in an early part of the assignment and thismeans that all the rest of your answers are ‘wrong’, you will lose marks only for the initialerror. 转自:http://www.3daixie.com/contents/11/3444.html

你可能感兴趣的:(讲解:MTMA33、syntax、python、pythonC/C++|Processing)