M101 Project

In this project, we will take raw(ish) data from the Burrell Schmidt telescope and produce a surface brightness profile and color map of the nearby spiral galaxy M101.

After the data reduction and analysis is complete, you will write an ApJ-style paper writing up not just the analysis, but giving the scientific context and interpreting your results in light of other studies of M101 and of galaxies in general. Here are the details of the writeup assignment.


Step 1: Getting Raw Data (Sep 24)

  1. Make a directory called M101proj: mkdir M101proj
  2. Move into that directory: cd M101proj
  3. Make directories called Bdata and Vdata: mkdir Bdata Vdata
  4. Copy B data into directories: cp /astroweb_data/ASTR306/M101/B2009/* Bdata/
  5. Copy V data into directories: cp /astroweb_data/ASTR306/M101/V2010/* Vdata/

Step 2: Do Zero/Bias subtraction (Sep 24)

  1. Move into V directory: cd Vdata/
  2. Start pyraf: ur_setup followed by pyraf followed by !ds9 &
  3. Examine one zero, and use imexamine to work out the readnoise in ADU, use the gain (2.5 e-/ADU) to convert that to readnoise in electrons.
  4. Combine individual zeros to make master zero: imcombine pzero*.fits Zero combine=median reject=ccdclip rdnoise=<your number> gain=2.5 lsigma=3 hsigma=3
  5. Look at and imexam the master zero -- does it look reasonable? How does its noise level look? How does the pattern look?
  6. Subtract the Zero from the object images:
  7. Now move into the B directory: cd ../Bdata
  8. Repeat steps 3-6 to make the Master Zero for the B data and subtract it from the B object images

Step 3: Flat Field the data (Sep 24)
  1. in each directory (B and V), do the following imarith z//@objects.lis / <Flatname> fz//@objects.lis
  2. examine a few flattened images using ds9. Do they look flat?

Step 4: Photometric zeropoints, color terms, and sky background estimation. (Sep 29, Oct 1)

Image Processing Assignments
fzpobj0419029 (B)
fzpobj0419030 (B) fzpobj0419031 (B) fzpobj0419032 (B) fzpobj0419038 (B)
fzpobj0419039 (B) fzpobj0419040 (B) fzpobj0419041 (B) fzpobj0411033 (V)
fzpobj0411035 (V)
fzpobj0411036 (V) fzpobj0411042 (V) fzpobj0411043 (V) fzpobj0411044 (V) fzpobj0411045 (V)

(Important: where you see
<imagename> in the steps below, do NOT include the .fits extension in the imagename!)
  1. Download the SDSS photometry file (SDSS_M101.dat) and the python code to do photometric calibration (photsol.py) and sky estimation (skysol.py). Download these files into both your B and V data directories.
  2. Pick a flattened frame to work on. Open it in ds9 and look at it!
  3. Load the pyraf photometry packages:
  4. imexamine the image to work out what a good aperture radius would be, then epar qphot and set the following parameters
  5. Remove any old photometry files you may have lying around: !rm SDSS.coo mags.dat *.mags.*
  6. Transform the SDSS calibrating stars from RA,dec to image x,y coordinates: wcsctran SDSS_M101.dat SDSS.coo <imagename> inwcs="world" outwcs="logical" verbose-
  7. Have pyraf do the photometry: qphot <imagename> coords=SDSS.coo
  8. Make an text table of the pyraf photometry: pdump <imagename>.mag.1 "ID,XCEN,YCEN,MAG,MERR,MSKY" yes > mags.dat
  9. Merge it with the SDSS file line by line: !sed /^#/d SDSS.coo | paste -d\  mags.dat - | grep -v INDEF > <imagename>.phot
  10.  Delete intermediate files: !rm SDSS.coo mags.dat *.mags.*
  11. Repeat steps 5-10 for each image you are working on, making sure to look at each image first.
Now, let's examine the photometry files to get the photometric solution and sky model. We do this outside of pyraf in a regular terminal window (make sure you are in the directory where your data and photometry files are):
  1. Make sure you've done a ur_setup in the terminal window you're about to work in
  2. Look at the photometric solution: ipython -i photsol.py, making sure to properly enter the photometry file name and filter used
  3. Write down the parameters for the photometric solution given in the cleaned fit
  4. Look at the sky solution: ipython -i skysol.py
  5. Again write down the parameters given in the plane fit (dx, dy, const, median residual, plus errors)
  6. Repeat steps 1-4 for each image, watching the data carefully to catch any bad data

Step 5: Apply sky subtraction and photometric scaling (Oct 1)

Since we have 8 images each in B and V, and photometric solutions for each one, we can work out the average zeropoint in each set as well as the average color term. We will use these for the photometric solution. These values (along with their scatter, given in parentheses) are:

B filter
3.704 (0.022)
3.514 (0.022)
0.160 (0.006)
0.289 (0.021)

So we first need to sky subtract each image and then scale them in intensity to a common photometric zeropoint (which is just the average zeropoint listed above), based on the information collected in Step 4.
  1. Download the calibrations scripts Bcalib.cl and Vcalib.cl and put them in your B and V data directory, respectively.
  2. in pyraf, cd to your B directory and run the B script by saying cl < Bcalib.cl
  3. Repeat for the V data.

Step 6: Combinie individual images into final form. (Oct 6)

First, fix some things from last time. imexpr turned the images into double-precision images, which is unnecessary accuracy and doubles the storage size of the images. Also, we gotta fix the sky oversubtractions. Do the following in the B data directory:
  1. cd to your Bdata directory
  2. chpix c*.fits c*.fits real
  3. cl < /astroweb_data/ASTR306/Bfix.cl
  4. do the same in your Vdata directory (using Vfix.cl)
OK, now we need to register the images to match spatially:
  1. In pyraf in your B directory, make a list of the calibrated files !ls -1 c*.fits > files.lis
  2. register each image to the reference image by saying wregister @files.lis /astroweb_data/ASTR306/M101ref.fits w//@files.lis boundary="constant" constant=-999
  3. Wait.
  4. go to your V directory and repeat steps 1-3
Finally the images are ready to be combined.
  1. Do an epar imcombine and set the following parameters:
  2. cd into your B directory and combine the images: imcombine w//@files.lis M101B.fits
  3. do the same in your V directory.
  4. open your final images in ds9 and ooh and ahh over how pretty they are!

Step 6: Doing Surface Photometry (Oct 6, 8)
  1. If you don't already have the final images on your computer or in your linux account, get them from here:
  2. Convert from counts (in B and V) to color and magnitude using the method described in class.
  3. Once you have your final observed magnitudes and colors, remember as the last step to correct them for galactic extinction and reddening -- you can find the appropriate values via NED.