Scientific Computing Using Python - PHYS:4905 - Fall 2018
Python Homework #4
Due 9/4/2018
Name _______________________________________________
1. (15) Write a Python program to do a random walk in two dimensions
and plot the walk path. Each step should have a length of 1
and be randomly chosen to be in any direction with equal
probability. Have the walk stop when it has reached a distance
of 10 from its origin. Do 5 walks and plot all of them on the
same plot using different colors or line styles so that the walks
can be distinguished. Include a legend indicating the number
of steps taken in each walk.
2. (10) Write a Python program to import the HaloSat orbit data in
FITS format, plot the distance of HaloSat from the center of the
Earth as a function of time, and find the minimum and maximum of
that distance. From inspection of your results, about how far
is HaloSat above the surface of the Earth? You may treat the
Earth as a sphere.