;+ ; NAME: ; rd_1_slitoffset ; PURPOSE: (one line) ; Read a table of slit offsets ; DESCRIPTION: ; Read a table of slit offsets ; as written by wr_1_slitoffset ; tables/YYMMDD_1_slitoffset.txt ; CATEGORY: ; NIRES reduction ; CALLING SEQUENCE: ; wr_1_slitoffset, datestr, framenum, object, airmass, slitoffset, slitoffset_override ; INPUTS: ; datestr: string (YYMMDD) ; framenum: array of integers. FRAMENUM from header ; object: array of strings. OBJECT from header ; airmass: array of floats. AIRMASS from header ; slitoffset: offset to the slit as used by NSX, for each exposure, ; as calculated by nsxng_wide_profile_mash ; slitoffset_override: override to slitoffset ; OUTPUTS: ; none ; SIDE EFFECTS: ; RESTRICTIONS: ; None ; PROCEDURE: ; wrapper for nsx proceedure nsxng_wide_profile_mash ; MODIFICATION HISTORY: ; Written 2021 Dec 30, by Leslie Young, SwRI ;- function rd_1_slitoffset, datestr, framenum, object, airmass, slitoffset, slitoffset_override fn = 'tables/'+datestr+'_1_slitoffset.txt' if not isfile(fn) then return, -1 format = '(A6, X, A4, A12, A8, A16, A21)' readfmt, fn, format, date, framenum, object, airmass, slitoffset, slitoffset_override, $ /skip, /silent n = n_elements(framenum) if n ne (file_lines(fn)-1) then return, -1 return, n end