ATMS 391: Geophysical data analysis
Homework 1: Basic usage of python and iPython notebook
Instructions
You will use this notebook to provide your answers to this assignment
Problem 1
Write a function to solve the definite integral The following will be very useful: Scipy documentation. What is the result of the integral with defined values of being , , and ? Your function must be set up to run with only one input , which is passed into the function as the first argument. Print your answers for each value of in your notebook that you turn in.
Problem 1 Rubrics:
Write the correct function, print the results, results are correct [10 points]
Don't write the correct function [-6 points] (will get partial credit if function is partial correct)
Don't print out the results [-1 point]
Incorrect answers [-3 points]
A few notes:
In the function, remember to put the return statement at the end. If you put a print statement after return statement, the function will not execute the print statement.
As stated in the instruction, your function must be set up to run with only one input . Violating this will result in losing points.
Calculting the integral using analytical solution other than using scipy also gets full mark.
Problem 2
The angular diameter (in degrees, ) subtended by an object in the sky is given by where is the radius of the object and is the distance to the object. The units of and must be the same.
(a) Create a python function to perform this calculation.
(b) Execute this function for the moon ( km, km) and sun ( km. km) using the function you wrote. Store the results into a variable for each calculation, and print the result.
(c) Calculate the ratio of the moon to the sun apparent angular diameter with the results of (b) stored in memory (i.e. not typed in!!). Print the result.
(d) Does this answer explain why we have solar eclipses? Why or why not? Answer in a markdown cell.
Yes. The ratio is nearly 1, which means during solar exlipses the moon can almost cover the sun from the view on the earth.
Problem 2 Rubrics:
(a) Correctly create the function [3 points]
(b) Correct answer, store the results to variables [3 points] (both degrees and radians are okay)
Incorrect answer [-1.5 points]
Not storing to variables [-1.5 points]
(c) Correct answer [3 points]
Don't print the result [-1.5 points]
Don't use the results in (b) stored in memory [-1.5 points]
(d) Correct answer [1 point]