SCAN MIRROR POSITION Programs: sedioc.pro tilt.pro Sample Data Used: sedIOC_1.fits to sedIOC_7.fits - Each file is one telescope postion and has 12 extensions which are the different CSMM postions. There are also background extensions and stim extensions.The order is: background,stim, 12 on/off pairs, stim listIOC listIOC2 listIOC3 Running Programs: Uses idl. Purpose: To see which of the scan mirror positions (CSMM) has the most flux and deturmine where the object is along the slit. After the telescope position has been changed, the best scan mirror position and the object position will be found again. Running program: IDL>sedioc This will compile and start the program. (If you need to make changes in the code and recompile, type: IDL>.r sedioc.pro and then type again: IDL>sedioc) It will prompt you for the name of the file that has the list of names of the fits files which are the different telescope postions. The first line of this file should be the number of names in the list. An example of this is listIOC2 - which has two fits file names. Enter the name of the file with the list of names:listIOC2 After IDL has read in the fits files, the dark sky frames are subtracted using the on/off pairs. A graph with a median of all the pictures in the extensions of the first fits file will appear. You can use this to pick out the apperture width.There will be a prompt on the screen for the start and end of the apperture. A linear fit is then done to the background (rows that aren't in the apperture) of each col. The projected background is then subtracted for each of the rows that are within the apperture. Then the program will read from the header what the scan mirror postion is in arcsec. This will have to be changed from what is read from the sample data, which is in counts. Next you will see a graph of the flux in DN/sec vs the col number for all 12 CSMM postions. This is just to make sure they all look all right. You will hopefully see that all of the peaks are on the same col and the flux is (close to) zero outside the apperture. To continue type ".c" IDL>.c There will then be a graph of the flux throught the apperture vs the CSMM postion. There will be a fit to the data in a blue, dashed line. If you like this fit, type "y". If you don't, type "n" and you will see a new graph of flux vs CSMM postion number (0 to 11) with just the data. NOTE -- if the scan mirror postion of the real data is not spaced somewhat linearly, this might have to change. Choose which positions you would like to be fit, and hope that it works better than the last try. You can repeat this until you are satisfied. tilt.pro Using the scan mirror postion with the highest flux, the program will call "tilt.pro" to find the angle difference between the slit and the array. This is done by deturmining which col has the max flux for each of the rows. If there isn't enough flux to tell, then the rows can be binned, so a better fit can be made. It will also output which col has the max flux. Tilt.pro will originally fit all 24 cols for each row/bin of rows that is it fitting. It will use MPFITPEAK to fit a gaussian to the data. A plot of the data and the fit will be shown. If you do not like the fit, you can choose which cols to use, or choose to use the col from the data with the max value (r). After all of the maximum cols are found for each row/bin, then a line is fit to the data. The angle between the slit and the detector is found by taking the arctan of the slope. This will then repeat for every fits file in the list, starting with picking an aperture. When done with all of the fits files, a graph of the csmm positions for each telescope pointing is shown. Output files: seddetails has various bits of info on each file. For each DCS there is the highest flux, what col it is on, and the flux throught the aperture. It then has the calculated maximum col and the "observed" max col. It then lists the CSMM position with the highest flux, both in DCE number and in counts(arcsec), the flux through the aperture at that position, and the calculated (fitted) best CSMM postion. This will re-write every time you run sedioc.pro (So copy it to a different file if you want that info saved.) CSMMfit gives details on the fitting of the best csmm positon. (Not all that useful...) Tilt_details The slope, y-intercept and angle between the slit and the array are printed in the file, "Tilt_details". This will re-write every time you run sedioc.pro (So copy it to a different file if you want that info saved.) ********************************************************************** WAVELENGTH CALIBRATION Programs: lambdacal.pro lambdalook.pro lambdafit.pro lambdacolfit.pro Sample Data Used:ffene2.fits,ffene2.fits,fhear2.fits, fobject2.fits Running Programs: All use idl. First look at the data using lambdalook.pro IDL>lambdalook It will either ask for a filename or use the one coded in. See which columns have flux. Do they need to be binned? Then run lambdacal.pro IDL>lambdacal It will also ask for a file name or use a default one. It will show a graph of all of the flux vs the row # (wavelength) for each of the cols. Then it will ask for how many wavelenths to be fit using this file. Binning: If the flux on individual cols isn't enough to give a good signal, then binning could help. Choose the number of bins you would like. If you choose 24, each col will be its own bin. If you choose less then 24, you will be prompted to pick the beginning and end col for each bin. (Cols start at 0) Bins are able to overlap, so you can see if dividing it differently affects the outcome. Also, if the source is only on one or two cols, choose one bin and pick those cols for fitting. Setting the wavelength: You will have to know what the wavelegth of the feature is. There will be a prompt asking for it. Emission or Absorbtion: If the line is an absorbtion line, the spectra will be flipped for easier fitting. This shouldn't affect what row the peak (trough) is on. Fitting the Peak: The highest peak will automatically be fit (using a Markwardt gaussian fitting routine), but all rows will be used. A better fit can be obtained by using just the rows around the peak. Also, if the feature that you would like to fit isn't the largest, you can pick the rows around that feature. You will have the several options for fitting the line. 1. Just use the number of the peak row with the max value in that region. Select "r" 2.Say that the fit is ok. Select "y" 3.Say that the fit is not ok. Select "n" - this will allow you to pick different rows to fit. All bins after this will use the rows picked here. Pick "n" agian to switch the rows used. 4.Say that you want to skip this bin. Select "s" - if the fit is very bad or if the feature doesn't appear in this bin, this gives you the option of just skipping to the next bin. You will do this for every bin. If there's another wavelenth to be fit, the process will begin again. When everything is done, the file LambdaCal.txt will have been created. This has the wavelength, the row number and which col was used. This is the input to lambdacolfit.pro or lambdafit.pro Getting Lambda-naught and the Dispersion: lambdafit.pro - This will do a linear fit from the file "LambaCal.txt". It does not distingues between the different cols, so it just gives a lamda(0) and a dispersion for the entire array. To run it type: IDL>lambdafit lambdacolfit.pro - This outputs what lambdafit.pro does as well, but it will also give a lambda(0) and dispersion for each of the cols indiviually. This info is written in the file "LambdaCols.txt". It also uses the file "LambdaCal.txt". To run it type: IDL>lambdacolfit ********************************************************************** SAMPLE DATA ffene2.fits - for wavelength cal. - extended source in correct direction ffene3.fits - ffene2 with spectra flipped to another positon fhear2.fits - for wavelength cal. fobject2.fits - for wavelength cal. - not extended, absorbtion line sedIOC_1 to 7.fits - for slit position cal. 7 different telescope positions listIOC - list of sedIOC_1 to 7.fits for program iocmix.pro listIOC2 - only has sedIOC_1 and sedIOC_5 listIOC3 - only has sedIOC_1, sedIOC_5 and sedIOC_9