-
Notifications
You must be signed in to change notification settings - Fork 2
re extraction (MOSDEF)
When using BMEP, you click on areas of the 2D spectrum with high signal (emission lines) and add those wavelengths together. The user then fits a Gaussian with a center-guess wherever they think the object is. The re-reduction code works in the same way. The wavelengths where the user added together originally are added together again using the new 2D spectrum. A Gaussian is fit where the user previously guessed. The new guess is slightly shifted to account for the difference in position from the old 2D data to the new 2D data (this is done by subtracting the position of the star in the old 2D data from the position of the star in the new 2D data). After this process, we have a weighting profile, a center, and a width, which is all that is needed to optimally extract the spectrum.
This process can fail for a few reasons. The Gaussian fit to the profile could fail (a successful fit has a status of 1 or 3 from MPFIT). The new object position could be too different from the expected position (more than 3 pixels off). The new object width could be too different from the old width (more than 1 pixel difference). Finally, any object that had the center placed by hand rather than fit is also not re-reduced.
For the 2755 files 106 failed which is a 96.2% success rate!
There are some output files that help understand things.
-
00_extract_profile_region_info.txt - Has the original and new pixels added together to create the profile. Also has if continuum mode was on or off. This also has a comparison of the old and new widths/centers.
-
00_undone_info.txt - lists 1D spectra that were not done and a reason why
-
00_undone_slits.txt - lists the mask and slitname of each 1D object that was skipped or failed.
-
00_width_ypos_diff_info.txt - Only has the comparison of the old and new widths/centers. The order is old val, new val, (old - new). This is duplicate information because it is also in the 00_extract_profile_region_info.txt but this file doesn't have all the pixels used for the profiles.
There are some output plots for each mask:
-
0_profile_compare_[MASKNAME].ps - For each 1D spectrum, this shows the old 1D profile (black), the new 1D profile (red), new range fit with a gaussian (green), new gaussian fit (purple), old center (vertical black line), new center guess (vertical red line), and new fitted center (vertical purple line). If the fit was successful and the object was extracted then the text "EXTRACTED" is in the upper left hand corner. These plots are a really good check to make sure the profile fitting is working or not. I don't think inspecting all of these is important, but if some extraction looks funny, we could check these plots to see if the profile was not fit properly or something.
-
0_Extracted_line_comparison_[MASKNAME].ps - This is a new document that I made. For every extracted spectum, OIII and Halpha are plotted. The old data are in black and the new data are in red. This is a good way to quickly check that the extracted fluxes are at least similar. Each line is plotted twice, once without error bars, and once with error bars. The plot with error bars shifts the new data (red) slightly in the wavelength direction so that the data aren't right on top of each other.
I also made three plots for all objects:
-
0-compare_widths_ypos_all.ps - I made several plots that compare the old widths to new widths and the old y-positions to the new y-positions. The most useful of these plots are probably the 2nd and 4th. The wide x-axis in the 4th plot is because of serendips. The expected position for every object going through BMEP normally is simply the primary object position. Therefore, serendips could have very big values for (yexpect - ypos). The 5th plot is a histogram of yexpect-ypos new (y-axis of 4th plot)
-
0-compare_widths_ypos_all_prionly.ps - The same as 0-compare_widths_ypos_all.ps but for primary objects only. The new objects seem to bunch up around 0, +1, and -1. I think this might be because of some rounding that may have happened somewhere at some point.
-
0-compare_widths_ypos_all2.ps - The 4th plot in the above plots but for each mask individually.
To do this you need to:
- Make new 1D and 2D folders
- Change your paths to link to the new folder
- Put the new 2D data in the 2D folder
- Put the old 1D data in the 1D folder (the data before slitloss correction)
- Change the old 00_starinfo.txt to 00_starinfo_old.txt and put it in the 1D folder
- Extract each star normally using BMEP_mosdef
- Compile bmep and bmep_mosdef_rereduce_v05 in IDL (.com bmep and .com bmep_mosdef_rereduce_v05)
- run bmep_mosdef_rereduce_v05,twodfolder="two/d/data/path/",onedfolder="two/d/data/path/",tblpath="path/to/0d/catalog/mosdef_0d_latest.fits" (you must include all keywords and the trailing slash on the paths and the full path to 0d)
- Change your 1D folder path to point to the "000_rereduced" folder (The new data are put in a folder called 000_rereduced within the 1D folder)
- Copy over the stars from the old 1D folder to the rereduced folder
- Copy over the 00_starinfo.txt from the old 1D folder to the rereduced folder (not the 00_starinfo_old.txt)
- Reduce by hand the slits in 00_undone_slits.txt
- Run the blind extraction
- Run the getinfo command
- All done
Pictures:
red = new data
black = old data
red = new data
black = old data
These are offset slightly in wavelength so you can see the error bars.
Black = old profile
Red = new profile
Black vertical line = old center
Red vertical line = Expected new center
Green = region fit with a gaussian
Purple = new gaussian fit
Purple vertical line = new center