; return the filename for a single date and index. ; n = 1 if it is found, otherwise zero ; datestr yymmdd ; indx and n are integers function fn1s, datestr, indx, n if strlen(datestr) eq 6 then date6 = datestr else date6 = strmid(datestr, 2, 6) dir = '/Users/layoung/data/20201128_Eris_NIRES/*/' ; s190826_0049.fits spec = dir + 's'+date6+'_' + string(indx, for='(I04)') + '.fits' fn = file_search(spec, count=n) if n eq 0 then return, '' return, fn[0] end