;+ ; NAME: ; do_1_slitoffset ; PURPOSE: (one line) ; Calculate slit offsets ; DESCRIPTION: ; Calculate slit offsets as defined by nsx ; CATEGORY: ; NIRES reduction ; CALLING SEQUENCE: ; do_1_slitoffset ; INPUTS: ; none ; OUTPUTS: ; none ; SIDE EFFECTS: ; RESTRICTIONS: ; tables directory must exist ; PROCEDURE: ; wrapper for nsx proceedure nsxng_wide_profile_mash ; MODIFICATION HISTORY: ; Written 2021 Dec 30, by Leslie Young, SwRI ;- pro do_1_slitoffset ; TASK Identify the orders ; Find the SlitOffset ; Write the SlitOffset file 'tables/YYMMDD_1_slitoffset.txt ; and the diagnostic YYMMDD_1_id_orders_SlitOffset_v_airmass.png YYMMDD_1_id_orders_SlitOffset_v_framenum.png datestr = datestr6_pwd() NCP = nsxng_load_ncp() redo = 0 c = nsxng_constants() ; load NSX contants (were globals) ncp = nsxng_load_ncp() ; load NSX edge of slit polynomials shortlognight, datestr, sets_, nset_, /noprint indx = where( strtrim(sets_.obstype,2) eq 'Object', nset) if nset eq 0 then stop sets = sets_[indx] ; Look at shifts framenumstart = sets[0].framenum0 framenumend = sets[nset-1].framenum0 + sets[nset-1].n - 1 nd = 1+framenumend-framenumstart framenum = indgen(nd) + framenumstart d = rdsets(datestr, framenumstart, nd, /img) for id = 0, nd-1 do begin img = d[id] nsxng_wide_profile_mash, img, ncp, /silent d[id] = img endfor indxseq = where(d.object ne 'HD7983') indxseq = where(d.object ne 'HD7983' and d.object ne 'HD6038') SlitOffset_median = median(d[indxseq].slitoffset) str_SlitOffset_median = datestr+' SlitOffset_median ' +string(SlitOffset_median) print, datestr, ' SlitOffset_median ', SlitOffset_median slitoffset_override = replicate(SlitOffset_median, nd) wr_1_slitoffset, datestr, framenum, d.object, d.airmass, d.slitoffset, slitoffset_override end