2nd year Practicum

Exercising your python skills

 

This problem set is meant to exercise your python skills after the introductory lecture and to prepare for the rest of the course.

 

Download problem set text.

Task 1 - photometry and colours of stars

 

General information:

 

The goals of this problem set are to:

 

  • Learn to handle fluxes, magnitudes and spectra and the relationship between these.
  • Learn to measure magnitudes from a calibrated CCD image.
  • Learn how to estimate the uncertainty on flux measurements.
  • Learn how to handle colour-colour diagrams.
  • Compare stellar spectra with spectra of black bodies.
  • Gain more practical experience with python.

 

The assessment will pay attention to

  • The actual correctness of the calculation.
  • The structure and clarity and carefulness of the report.

 

The actual problem set text is in Dutch, you are encouraged to provide the write-up in English but you are allowed to hand it in in Dutch.

 

Downloads

 

Download the Task 1 description

 

Download the slides of the first presentation.

 

The data for this task are provided in a comma-separated-variables (CSV) file. It is straightforward to read these into python using "csv.reader" in the csv library.

import csv

fname='star.list.csv'

my_data=csv.reader(open(fname,'r'))

 

firstLine = my_data.next()

This opens the file and then reads the first line (the header line in this case) into the variable firstLine. You can then continue to loop over all lines using next(). You can also use the loadtxt routine in numpy to read in more efficiently. My personal preference is to use the pandas library and use the read_csv function there, but this is more advanced.

 

As described in the task description, the python package sp.py contains routines to find objects and do aperture photometry on them. Note that this is written for python 2.7 - if you are using python3 you might want to use the version kindly provided by Daniel Gomon called sp-python3-Gomon.py - make sure to rename this to sp.py before you use it.

 

Data needed for this task

 

You do need some various data sets for this problem set:

 

  • Spectra of stars (a gzipped tar file). To unpack this file you can for instance use the Linux command: tar xvfz spectra.tar.gz. After you have unpacked the file you should have several files. The files are all CSV files (even though their name does not end in .csv). Each file contains two columns. The first column is the wavelength in Ångström (Angstrom hereafter) and the second the flux density in erg/cm2/s/Angstrom.
  • List of filenames and spectral types from these stars.
  • The spectrum of Vega. Notice: For this spectrum the wavelength is given in nanometers and the flux density in erg/cm2/s/Hz.
  • CCD exposures in the B and V filters. These are in in FITS format.

Task 2

 

The aim of this problem set is to

 

  • Learn to carry out a  χ2 fit.
  • Learn to interpret the results of the fit.
  • Learn how you can estimate the uncertainties on a  χ2 fit.
  • Analyse radial velocity measurements to estimate the basic parameters of exo-planets.

 

In the grading, emphasis will be placed on

  • Correctness of your analysis.
  • How you carried out, used and interpreted the χ2 fit.
  • The structure, clarity and presentation of your report.

 

Downloads:

 

The description of problem set 2.

 

Data required for the calculation:

 

The original radial velocity measurements from 1995.