Examples of how to do all of these problems can be found in the lecture notebooks. You shouldn't need to download any data to complete the homework (unless you want to use one of the images we used from class. In that case, the data can be found in the GIT repository under the "data" directory. If you are not using the GIT repository directly on your machine, it is very easy to set up and the best way to have access to all the class material. In order to copy our class repository to your machine you can follow these simple commands:
That will make a directory called "scientific-pythin-training-2012/" and download all the files to it. - if you want to update the files later, issue the command "git pull"
Using the methods we discussed in class, write a function that satisfies these conditions:
Input is a filename of science image (FITS file), this can be any FITS file you like.
Output is a PDF file with the image scaled reasonably for its content with a scaled colorbar representing the display range
Run the function to make sure it works and submit a copy of the PDF file produced. Call it username_part1.pdf
Create a module. Name it anything you like. Place the function from Part 1 inside of it.
Add a new function that satisfies these conditions:
Add a __author__
global variable at the top of the file and assign it to your name. This is for identification by the grader. Example:
__author__
= 'Dr Evil'
Include documentation and an example of how to run the function inside the module
Modify the module from Part 2 so that you can either import it or call it from your command line prompt. You can make this as simple or complex as you like, as long as it works.
For example, if your module is called "findstars.py", you should be able to execute it from this notebook like this:
!findstars.py imagename.fits
Execute your command line script below to make sure it works. Save the ascii table that is the output to a text file.
If the above was easy, try making a module which contains a few useful functions for your everyday work. Some examples might be:
Email your solutions to sosey[at]stsci.edu with the subject: session4 homework
Send me this notebook and the files module.py and username_sources.dat.
Identify that you wrote the module by including an __author__
assignment.