Obtain data using lmsal cutout or via the homemad cutout procedure.
restore, 'data_save_file.sav'
data_save_file should contain the data-cube (data), index structure (index), and an array of where the prepped .fits files are for each image (filenames).
hacked_autosm,filenames,data,index,left_x,min_y,'stack.fits'
left_x,min_y give the lower left pixel location for virtual slit. 'stack.fits' is the files that is created. 'stack.fits_slitpos' is created for use later.
stack_time_average,'stack.fits','stack_avg.fits'
Input is file from previous step. Output is 'stack_avg.fits' and 'stack_avg.fits_ave_info' is created for use later.
select_loops,'stack_avg.fits','loopfile.sav'
Input is file from previous step. Output is 'loopfile.sav'. Usually get a wonky error in this procedure saying a procedure is an "undefined variable," but a work-around is described here.
restore, 'loopfile.sav'
locate_bresenham_slit,'stack.fits_slitpos','stack_avg.fits_ave_info','toBeSavedFolder/',loops=loops,bst=bst
'stack.fits_slitpos' and 'stack_avg.fits_ave_info' are by-products created in earlier procedures. 'toBeSavedFolder/' is where the images will be saved (remember to include the slash at the end). loops and bst come from the 'loopfile.sav'