Workshop 2: quantifying spectra, weeks 3-5
In this series of workshops, you will develop the tools needed to carry out a simple analysis of spectroscopic data using python. You will not be expected to write an entire python program as part of these workshops. You will be expected to adapt the code you have been provided with, to encode appropriate formulae in python format, and to approach programming problems logically and systematically.
Workshop 2 covers the following topics and tasks:
Topic 2.1: Modelling continuum emission, part 1.
Exercise A: Measuring continuum fluxes properly
You should aim to complete these tasks within the space of one hour. If you're a competent programmer, this should be esily doable, but even if python still gives you the jitters, it shouldn't take more than two. ASK FOR HELP IF YOU'RE STUCK. This workshop builds on from workshop 1, and we will continue using these spectra and developing your skills into workshop 3. Your work will be automatically collected from both notebooks at 5pm Tuesday 6th March.
2.1 Modelling the Spectral Continuum
As we covered last time, the continuum flux -- or more properly, the intensity of the continuum -- tells us the average strength of the observed spectral emission in regions of the spectrum which are not affected by emission or absorption lines. Last week, you estimated the continuum flux by eye (hopefully at an appropriate zoom level)! This week, we're going to improve on that.
First of all, consider the two spectra plotted below, Spectrum A and Spectrum B. Look at the associated code and identify how the flux values of each spectrum are stored.
Exercise A
Use python to determine the minimum and maximum data points for the two spectra in the following spectral range: 7000-8000 angstrom. Mark these data points on your plots in a format of your choice, and note the values below. (2-5 mins)
Use python to determine the mean continuum flux of the two spectra in the following spectral range: 7000-8000 angstrom. Add a horizontal line representing these flux levels to each of your plots, and note the values below. (2-10 mins)
Use python to determine the mean continuum flux of the two spectra in the following spectral range: 4500-5500 angstrom. You will need to exclude any emission or absorption lines from your model. Add a horizontal line representing these flux levels to each of your plots, and note the values below. (5-20 mins)
Use python to determine the standard deviation of the continuum flux in the wavelength range 7000-8000 angstrom, for both spectra, and note the values below. (2-5 mins)
Use python to identify and mark any pixels more than N standard deviations away from the mean continuum flux in these region, where N is a value of your choosing. (5-20 mins)
Use python to re-evaluate the continuum flux in the wavelength range 7000-8000 angstrom, excluding any pixels at more than N standard deviations from the mean, and note the values below. (5-20 mins)
Add sufficient iteration to this process in order to obtain a stable continuum flux level. (5-20 mins)
What are your final continuum fluxes and associated uncertainties for the 4500-5500 angstrom and 7000-8000 angstrom regions of both spectra? (2-5 mins)
Hints:
Have a look at the Observable Properties of Stars notebook from PHY213 or your work on PHY241 with Stu for various methods of selecting subsets of large datasets.
numpy has a lot of useful built-in statistical functions...