1. I would like to hearing from you about what you might hope to get from the class, and any information you might provide about what skills you think you have, and what skills you'd be interested in developing. In addition, I would like to hear from you if there are any specific computational projects/tools that you might have an interest in developing, perhaps over the course of the class, either related to current or past research, or just something of particular interest to you. I can't guarantee that we'll be able to provide an opportunity to work with these, but I would like, if feasible, some of the computing work we do to be relevant to you.

  2. Create a Github account if you don't already have one. Use git to check in some piece of software you have written in the past year, along with a README file that describes it. Email me the location of your github account and the name of the product you uploaded.

  3. Read the Department computing notes at http://astronomy.nmsu.edu/computing/notes

  4. Update your Department web page information, as described in the computing notes. Consider putting a link to your Github page!

  5. Go to the Numerical Recipes and consider a purchase: online, hardcopy, or both

  6. Read the Preface and first chapter of Think Python

  7. Read Chapter 2 of Think Python. Do the exercises at the end of the chapter. Do this using the iPython notebook at https://github.com/holtzmanjon/a575/ThinkPython_2.ipynb to the questions and use the execution cells to check your answers. For now, check your completed notebook into your github account, and let me know when this is done. (I think we will switch to submitting things by forking my github project, working within it, and submitting a pull request for me to be notified about that, but I have to confirm the details: if you are so inclined, look up information about this!)

  8. Determine the computing resources of your desktop, your laptop, and of the shared, public machines in the astronomy cluster: astronomy, hyades, praesepe, virgo, and of your desktop machine. Document the number of CPUs, their architecture and speed (can you figure this out in flops?), amount of memory, swap space, and disk space on each machine. Put this information into some tabular format.

  9. Read Chapter 3 of Think Python and do the exercises at the end. Note that the ``solutions" that are given assume only knowledge of information given in the book up to this point: with additional knowledge, they can probably be written much easier! Feel free to use additional knowledge if you have it.

  10. Accomplish the following tasks using a single input command line, putting the output in a separate file for each task. Put the input commands into a file so that you could edit/rerun it, and have a record of what you did. Check in input and output.

  11. If you haven't already, fork and clone my git repository for the class; merge the upstream changes, to get any new data files. The file q11/zp00.dat contains a set of model stellar isochrones (if you don't know what those are, ask someone!) for stars with solar composition. Information about what is given in the file is found in header lines at the top. While stellar spectra depend largely on the three main parameters effective temperature, surface gravity, and composition, there are some other parameters that can affect the spectra as well (e.g., microturbulence, macroturbulence, rotation, magnetic fields). In a paper by Massarotti et al, they suggest a relation for macroturbulence:

    log vmacro = 3.5 log Te +0.25 log L - 12.67

    Use awk to print the macroturbulence for Padova isochrones of ages 1 and 10 Gyr. Check in the file with your input command.

  12. The SDSS/APOGEE team creates large libraries of synthetic spectra for a region in the near-IR. To do so requires a list of all of the atomic/molecular lines in the region: you can find a current list in /home/apogee/speclib/linelists/linelist.20150714

  13. Read Chapter 4 of Think Python and do the exercises in section 4.3. Create an ipython notebook to do these, and include the directions of the exercises in markdown cells. After completing the exercises and reading the remainder of the chapter, describe what is meant by ``refactoring." Check in your notebook.

  14. Write a shell script that will determine system resources (as many as you can!) on a given machine, using commands and output processing (e.g., awk) to produce output into a LaTeX table and into an HTML table. Write another script that will execute this on multiple machines, as specified on the command line, and run this script on the public machines, using SSH kyes to avoid having to enter passwords. Add a wrapper around your LaTeX table to generate a short document, and a wrapper around your HTML table to generate a web page.

  15. Construct a short LaTeX document (paragraph or two!) that summarizes an article from astro-ph. Your document should include at least one figure and at least one reference: use bibtex for your references. Refer to the figure at least once in the text using \ref. Construct a makefile to transform the LaTeX source into a PDF file. Just this once, we're interested here more in the form than in the content!

  16. Read Chapter 5 of Think Python and do either exercise 3 or exercise 4, and the exercises 5 and 6.

  17. Read Chapter 6 of Think Python and do exercises 1 and 2, and exercise 7 or 8.

  18. Write a program that performs the following: a variable starts with a value of one. Construct a loop that executes until the variable is larger than 100. In each loop execution, calculate the factorial of the variable if the variable is less than 20. Then double the value of the variable and add one to it. Output the total number of times the loop is executed, and the sum of all of the factorials that were calculated. Make the conditions general, so that they can be set at the top of the program, or entered by the user. Make sure that you comment your program, and pay attention to nice formatting for readability.

    Do this in as many as you can of Fortran, C, Python, and IDL! Use a makefile to compile your programs (where necessary) and to execute all four.

    Bonus: compute the factorial using a recursive function.

  19. Read Chapter 7 of Think Python and do exercises 1, 2, and 3

  20. Read Chapter 8 of Think Python and do exercises 1, 2, 3, 4, and 5, and 9

  21. Check in your ASTR 565 program for computer problem 2.1. Consider writing a general function to do the integration (note that you can pass a function as an argument!), and using it for the problem at hand. Your code should have comments, and it should be formatted nicely!

  22. We will be working with isochrones, as in Q11. Start an isochrone module, with your first function a routine to read a single set of Padova isochrones (as in the q11/zp00.dat file). Python is preferred/recommended. Your function should take the filename as an argument, as well as a list of requested quantities; implement a default list of metallicity, age, effective temperature, luminosity, IMF integral, and evolutionary stage. Optionally, request a single age. The requested quantities should be returned in a structure. Your code should have comments, and it should be formatted nicely! Check in the module in an isochrones subdirectory (which you can include in your PYTHONPATH). Use the module to retrieve an an isochrone of age 1 Gyr, and write it out using formatted output; place the output file in the q22 subdirectory.

  23. Rewrite your Lane Emden program, attempting to use better computing practices as mentioned in class: fully commented, no built-in numbers (e.g., nsteps), separate integrating routine, modular implementation of integration, constant calculation, and plotting. Make sure to validate your results! Use your modified routine to systematically investigate the choice of step size on your results.

  24. Plot some HR diagrams given a set of isochrones. Make a 2x2 panel of plots. On the left panels plot effective temperature against surface gravity and bolometric magnitude for isochrones of multiple metallicities, but a single age of 1 Gyr; color code the points by metallicity. On the right panel, plot the same but for a series of ages at a single metallicity (solar); color code the points by age. Challenge: write an event handler that returns the mass of the nearest point to a mouse click or a key press.

  25. A Hess diagram is a 2-dimensional representation of a pair of stellar paramters, with the number of stars given at each of parameter pairs; for example, an HR diagram with effective temperature and magnitude as the two axes, with the number of stars at each location specified. Add a function to your isochrone module to create a Hess diagram of an isochrone, with x and y quantities specified as parameters (defaulting to effective temperature and luminosity), with optional bin sizes specified. The number of stars between two isochrone points is given by the difference between the INT_IMF values for the two points, so you could, for example, load this many stars into a rectangular region as defined by the effective temperatures and magnitudes of the two points. Create a Hess diagram for the 1 Gyr, solar metallicity isochrone, and save it as a FITS file. Display it as an image.

  26. For a specified total number of stars, and a specifed faint magnitude limit, make a realization of the Hess diagram, using Poisson random deviates to populate each bin. Process: given section of HR diagram, calculate total number of stars which, from the isochrones, is with some normalization factor; scale this number to the total number of desired stars so that you have number of stars in each bin; in each bin, draw a Poisson deviate from a distribution with the isochrone number of stars as the mean.

  27. Read Chapter 10 of Think Python and do exercises 1-5.

  28. Read the introduction of Numerical Recipes Chapter 7, and skim/browse the rest of the chapter.

  29. A historical functional form of the initial mass function (IMF, the number of stars formed as a function of stellar mass) is the Salpeter IMF, which has dN/dM $ \propto$ M-2.35. Considering such a relation with a minimum mass $ \sim$ 0.5M$\scriptstyle \odot$ and a maximum mass sim100M$\scriptstyle \odot$, write a routine based on the methodology discussed in class (no canned routines!) that generates random deviates to populate such a distribution. Use your routine to general some plots of IMFs for several different sample sizes, which you should plot in histogram form. Overlay the Salpeter function on your plots.

  30. Read the introduction of Numerical Recipes Chapter 3, and skim/browse the rest of the chapter.

  31. Read the introduction of Numerical Recipes Chapter 12, and skim/browse the rest of the chapter.

  32. Write a routine to convolve a vector of length 8192 pixels that consists of a series of delta functions spaced every 10 pixels, with a Gaussian with $ \sigma$ = 5 pixels. Do the convolution in physical space, writing the convolution integral explicitly (i.e., don't use a canned convolution routine!) Then do it in Fourier space by taking the Fourier transform of the vector and the Gaussian, multiplying them, and then Fourier transforming back (canned routines OK!). Plot both results.

  33. Read 15.0, 15.1 and 15.2 in Numerical Recipes.

  34. Read 15.4, 15.5 and 15.6 in Numerical Recipes.

  35. Read NR15.8. Get the q35 directory from my a575 git repository, and work the iPython notebook on MCMC (written by Dan Foreman-Mackey for the Local Group Astrostatistics conference, 6/15), at least for the first model.



Jon Holtzman 2015-12-11