Skip to content

Recent updates

billfreeman44 edited this page Sep 19, 2014 · 11 revisions

I'm not really editing this page anymore, though the commit comments should be accurate.

2014/05/30 - Fixed some issues with the reextraction program for v0.1 to v0.2 for mosdef data. Added more explicit messages when doing profile mode and extraction mode. Fully implemented the subpixel extraction. removed extensions 7-10. made W and w adjust by 0.1 not 1.0 in width. profile is now green. added mosdef keyword to redshift analyzer program.

2014/05/27 - added sub-pixel extraction algorithm to extensions 7-10. same as extensions 1-4 but they use the sub-pixel extraction algorithm. added a plot that shows exactly which columns are being left out in continuum mode. Added new feature to enable adding a message with only one number by typing k and changed manually typing a comment to be K

2014/05/20 - fixed bug where width was stored as a string if the initial fit was below the minimum width. Changed minw to be set at the top of the program, alleviating the need to check in several places and ensures it can't be a string but is a double. Added explicit error message when trying to get the redshift of two objects at the same time. This basically cannot be done because the keyboard key handling is done in a separate loop from the extraction and the flux variable is lost (except for the last one done). Changed variable type to double for manually extracted spectra (ypos and width). Manually extracted spectra have centers and widths saved as doubles now (not long) and the width defaults to the minw rather than default width. It will be default width in the case of no minw. The bmep_redshift_analyze program now needs a /mosdef keyword to work for mosdef path and by default works for the mosfire path.

2014/05/09 - Added an actual width column to extract_info program and output. it adds !!! to the end if the widths are different than the others extracted. Added support to use cont mode and regular mode when getting the profile, though this is largely irrelevant, since the profile and error are saved.

2014/05/08 - fixed crash in the X command. Added display redshift to Z command. changed wait time in X to 0.3 instead of 3 secondsmoved bmep_mosdef_getinfo to its own file. I think it should work with normal mosfire data too though. Maybe add mosdef keyword. Also created a bmep_redshift_analyze.pro. This cuts out duplicates in the 00_redshift file. It also prints out each possible redshift with the number of different lines used to get that redshift. will add more to this later.

very old changelog below:

;TODO

;1.+ add in something special about the slit star

; +enforce the width of the slit star to be the minimum width allowed

; +calc the difference between expected and actual y position,

; +use y pos difference to draw better line on 2d spectra

; +case of 2 or more slit stars? avg the data? what do.

; +external extra file to store this info?

; +note:priority is -1 or 1 for stars.

; +use this to find which are stars.

; +fix naming for 2 objects in slit

;2.+ extract object by object, not filter by filter.

; +the way i've done it is all of the objects in one filter

; +then do the next filter. This is not ideal

; +should be obj by obj

; +I need to think about how to implement this

;3. write program to re-extract objects.

; +from wavel solution, calculate pixels to bin from

; +bin the pixels, then fit a gaussian

; +use expected position as initial guess

; +check fwhm etc...

; +comparison document/plots? (width, ypos, extraction...)

; +what to do about stuff that was adjusted by hand?

; +maybe have a flag on those?

;4. write blind extraction program

; +get offset and fwhm from slit star.

; +decide on a width? 2x? 1x?

; +use the same profile for optimal weighting as slitstar

; +do the extraction and save!

; +if there is a secondary object in another slit,

; extract at that expected position

; Xmanually add in objects for blind extraction?

;5.+ for rotation or broad profiles, get all the flux.

; +maybe edit fitting program to be a little bit wider.

;6.+write if width adjusted manually? or manual center'd?

; +add in flag to not auto do this object?

;7.+ add wavel sol and all info to header. easy fix, i assume

;8.+make only essential save files. don't be lazy!!!

;9.+experiment with non-parametric width/center estimate

; +just do this at the same time as normal gaussian fit

; +only consider small region??

;10.+ to fit to a gaussian or not? that is the question?

; +brian suggests fit to a gaussian by default

; +chisqr thresh to determine if gaussian shouldn't work?

; +chi by eye?

;11. extract a sky spectrum?

; -need to wait for mariska to add sky extension to 2d

; -just extract at same position and width

;extras:

; -plot of all of the data?

; -compare box to optimal

; -compare drp to mariska 2d/1d

;

;

;

;changes:

;added CRPIX1, CRTYPE1 to fits header

;added GAUSCHI to fits header. has chi sqr of gauss fit.

;fixed case of backwards l_bins and r_bins. now are sequential always.

;removed option to chose what filter to open

;instead, when opening an object all of the filters open

;title of window includes the filter

;

;added option to do "stars" as an object,

;this searches the SlitList.txt for something with priority 1 or -1

;throws fatal error if no stars found

;Added ISSTAR to fits header, 1 if star, 0 if not, -1 if something,

;bad happened

;00_starinfo.txt is created in the 2D folder if it does not exist at startup.

;00_starinfo.txt -maskname, filtername, objname, yexpect, yactual, width

;this file is read in for each object

;added isstar keyword to fits header. also used to determine if,

;main program should write to 00_starinfo.txt.

;main program now writes to 00_starinfo.txt if object is a star

;overwrites old info if star was already in list.

;

;wrapper averages star offset and width for all things with,

;matching maskname and filtername.

;

;from now on the yexpect keyword will be the one SHIFTED,

;from the star's center. not the pure calculated one.

;

;reduced fitting width from 17 to 10 for gaussian.

;

;set default of pgauss to 1 instead of 0.

;

;30 ojects in 3 filters ~ 100 windows. Too many! maybe only do,

;first 10 then second 10...

;^ fixed this by making user enter a min number and max number and,

;program does objects between those numbers.

;

;fixed .1 being added after primary of slit with multiple objects.

;

;added in "object number" or OBJNUM to fits header

;added objnum option in program by hitting 1,2,3,4,5. This,

;sets the suffix and keyword. This will allow for a secondary

;object to be extracted if there is no obvious primary. This

;will also allow for if there are two very faint elines at different

;wavelengths one can bin separately for two different objects.

;

;got the extensions settled out...

;fixed the header to be on each extension.

;

;added comments describing each extension to fits hdr.

;

;added an auto extract flag that can be changed

;this is called AUTOEX in the fits header

;1 = yes, do the re-extraction automatically

;0 = no, do not do the re-extraction automatically.

;

;stars are skipped when doing all objects, they

;should be done already, so no sense in doing them again.

;

;confirmed for any object with a star, minimum width is applied

;

;fixed bug with min/max object num not actually working correctly.

;

;

;Issue with fits file extensions and headers NOT SOLVED completely,

;sent an email to mariska asking for help

;

;reduced width to fit gaussians to make chi sqr more reasonable (its now 8)

;

;switched the function gaussfit() for the function MPFITPEAK(),

;in the "p" calculating program. gaussfit was causing underflow,

;errors for no apparent reason.

;

;fixed the fits headers w/ mariska's help

;

;changed y midpoint calculation back to integer math.

;

;removed duplicate "objnum" from fits header

;added comments to fits header

;

;removed the filter printing as it is no longer used. (no more select by filter)

;

;added width by hand and center by hand arrays in extraction code.

;added corresponding width by hand and center by hand keywords,

;in the fits headers (WBYHAND, CBYHAND)

;

;added calculation of the first two moments of profile for comparison with

;gaussian parameters.

;added MOM1 and MOM2 to fits header, which are these moments.

;

;fixed bug if there is a secondary object in the star frame, the yshift,

;and min width would be calculated from the secondary, not the primary.

;

;program now automatically detects if the monitor width is too small and,

;adjusts the click location accordingly.

;

;confirmed that two stars works as intended (yshift is avg, minw is smallest w)

;

;wbyhand keyword seems to work ok.

;

;fixed bug with two objects being extracted if one was not found w/ a gaussian fit

;fixed bug if objects were deleted some arrays should have also been deleted,

;but were not.

;

;created program called "bmep_mosdef_getinfo" which prints information about,

;EVERYTHING extracted. (except the blind stuffs)

;

;removed wavelength headers from the 5th extension.

;added spaces to comments in fits header

;

;updated blind extraction program to consider the shift from the stars

;updated blind extraction to do optimal extraction using star profile,

;5th extension is the weighting profile.

;

;program no longer outputs .txt files of the spectra.

;

;added isstar, yexpect, wbyhand, and objnum to blind header

;

;updated prerequisite comments above bmep program

;

;added in some default values for header keywords for blind extraction

;added 'BLIND' keyword to both headers (blind and normal)

;

;added ability to adjust the width of the window of the fit to automatically,

;determine the width of the profile (from a gaussian fit)

;

;added "norepeat" flag to beginning of blind extraction program. This stops,

;the program from redoing objects that do not need to be blindly extracted.

;

;updated the crpix and other wavelength keywords for the blind extraction

;

;fixed bug with bad pixel mask not resetting for blind extraction

;fixed indexing error with optimal blind extraction

;added comparison plots to compare blind and normal extractions

;this automatically compares things blindly extracted vs non blind,

;IF THEY EXIST!

;

;alphabetized subroutines

;

;added FORWARD_FUNCTION statements to start of almost every subroutine due to,

;conflict created when I alphabetized everything.

;

;bkgnd subtracted image not plotted if state.savetext eq 0. this,

;stops creation of duplicate plot for mosfire data (since its already bkgnd subbed)

;

;swapped the sort() function in bmep_mosdef_getinfo to bsort() due to IDL lame-ness

;also fixed sorting issue in bmep_mosdef_getinfo

;

;fixed bug in blind extraction if star slit width was smaller than actual slit making the profile get messed up.

;

;put some sections of the blind extraction into their own subroutines.

;blind program creates 00_np_info.txt (non primary) that has information,

;about the non-primary objects for the purposes of blind extraction.

;

;made the 'x' key interactive instead of typing in the wavelengths.

;double tapping this key or having the first position to the right

;of the second position will cause the range to be reset

;

;The 'Z' key now guesses the redshift of an object by taking into consideration

;the z of the field, the filter, and the location of the brightest line extracted.

;This doesn't work if you extracted only wide wavelength ranges. There must be a

;line to consider.

;

;The places where you clicked to bin to get the profile are shown in red

;on the extracted profile. These are numbered (though its hard to see)

;

;The 'X' key works kind of like the 'g' key in iraf. This fits gaussian to

;the data inbetween the two points that your mouse is hovering over. if

;its a good fit you have the option to select which line this corresponds to or

;input a wavelength of a line. Then this information is saved to the headers of the

;saved fits files (still working on that last bit)

;

;changed programs with "mariska" in their name to have "mosdef" instead

;

;jan 2014

;

;added calculation of slitloss programs (bmep_calc_slitloss*)

;added more parallel arrays with information about the fit and slitloss

;parallel arrays are saved to header

;

;now the program ONLY SAVES .FITS files, including all info in hdr.

;program MUST HAVE maskname, slitname, filtername in extrainfo1,2,3

;

;now saves a 6th extension, the error in the yprofile...

;

;added sigmastar to 00_starinfo.txt. changed center value to actually calculated center.

;Added support for minw to be a float. It used to be rounded at a bunch of steps.

;

;march 2014

;

;Revamped y range to be more reasonable if zoomed in. (threshold is 300 pixels)

;

;renamed var_img to std_img to be more clear. The var_img is then calculated from this

;

;renamed starinfo.txt to be 00_starinfo.txt

;

;may 2014

;check github commit page for updates.

;

Clone this wiki locally