So far today:
-read in fits file of Andrew's DR7 spectroscopic sample
-put into fits binary table
-picked out some arbitrary values for plate, fiver, and mjd
-used getspec.pro to pull out corresponding spectra from sdss
-used readsloanspec.pro to return wavelength and flux information
Voila, my first spectra plot!
(plate = 53789, mjd = 2212, fiber = 356)
Then I looked at a relatively flat section, in order to calculate its velocity
Also learned that putting $ before my commands allows me to go back to my directory/files from within idl. Very useful trick.
So next up is to write a program that connects the spectra to templates. Dylan helped me out and downloaded the templates for me. First off, I need to figure out which templates correspond to which star spectra. To do this, I need to use a chi-squared fit. From there, I'll need to use the spline function in order to shift the template and star's spectra so that the wavelength values for each occupy the same bin number. From there I can start to connect the spectra to templates with the xcorl procedure.
Notes to self:
where x is star wavelength, y is star flux, t is template flux --> should return adjusted wavelength so in same bin?
result = xcorl, star, temp, range
(-->not sure about how to use adjusted wavelength in the xcorl procedure; I think the input is should be adjusted flux, and that spline returns adjusted wavelength, which would make the spline procedure useless for xcorl.....so I definitely need to check that out)
Not quite sure about what function will make the best fit graph using a chi-squared distribution. From what I can gather, I can use the curvefit command, but definitely need to discuss with Andrew.
On another note, I also created a document that will serve as a reference list for all the codes/procedures I make. Last summer I learned the hard way that two months of coding adds up to a lot of files that you forget the purpose of. Hopefully this will help avoid this.
I couldn't have done any of this without help from Bertie, Saurav, and Dylan (and Andrew, of course)! It's great to have such wonderful resources.
things to do tomorrow morning:
-look at red part of m dwarfs (larger than 7000 A), pick a section that is relatively flat, calculate mean value --> from this, divide both template and spectra by this, and compare using where command
-look at .rv in sdss spectra -- calculate velocity change and compare to see if it is the same (Andrew's catalog says v = 18.3088?)