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 28)
(Do this in a non-pyraf window, or else in a pyraf window precede all the commands with a !)
  1. Make a M101 directory in your scratch space: mkdir /home/scratch/M101proj
  2. Move into that directory: cd /home/scratch/M101proj
  3. Unpack the M101 dataset: unzip /home/ASTR306/M101data.zip

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

  1. Start pyraf if you haven't already, then move to the V data directory: cd /home/scratch/M101proj/Vdata
  2. Start up a ds9 window: !ds9 &
  3. Examine one zero (open it in ds9), 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. Again, examine it, and make sure the noise characteristics make sense. How is it different from the master zero for the V data?
  9. Subtract the B master zero from the B object images

Step 3: Flat Field the data (Sep 28)
  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. (Oct 2)

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 (by right-clicking and save-as) 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 *.mag.* (don't worry if it says it cannot find files...)
  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 *.mag.*
  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, and make sure you've done a bash and source activate iraf27):
  1. Look at the photometric solution: ipython -i photsol.py, making sure to properly enter the photometry file name and filter used
  2. Write down the parameters for the photometric solution given in the cleaned fit
  3. Look at the sky solution: ipython -i skysol.py
  4. Again write down the parameters given in the plane fit (dx, dy, const, median residual, plus errors)
  5. 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 5)

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 (right click, Save As) 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 epar imexpr, changing outtype to be real.
  3. Then run the B script by saying cl < Bcalib.cl
  4. Switch to your Vdata directory and repeat for the V data.

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

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 (imcombine w//@files.lis M101V.fits).
  4. open your final images in ds9 and ooh and ahh over how pretty they are!
Compare your master image to one of the individual images. Using ds9:
  1. Load in M101V.fits
  2. Open up a new frame (Frame --> New Frame)
  3. In that new frame, load in cfzpobj04011033.fits
  4. Lock the two frames to the same ra,dec coordinate system (Frame --> Lock --> Frame --> WCS)
  5. Set the intensity scale to show a range of light levels (Scale --> Scale Parameters, and then set it to scale -5 to 3000)
  6. Set the intensity scaling to be logarithmic (Scale --> Scale Parameters --> Scale, and set it to log)
  7. Lock the scalebar (Frame --> Lock --> Scale)
  8. Lock the colorbar (Frame --> Lock --> Colorbar)
  9. now just play around with the image, zoom in, zoom out, and keep toggling back and forth between the two images using the tab key.
Step 7: Do photometry!

Here are links to my reductions of the two images (which should essentially be identical to yours). To download them, you must be coming in from a cwru domain (ie, be on the wired campus network, the Case Wireless network, or be connected through vpn).