;+ ; NAME: os_getfilter ; ; Given a header (or array of headers) ; ; INPUTS: ; KEYWORDS: ; OUTPUTS: ; ; HISTORY: ; Began 2006-04-06 14:44:54 by Marshall Perrin ;- function os_getfilter,hdrs instr = strc(sxpararr(hdrs,"INSTR",/silent)) ; handle IMAG headers. This is a little tricky since ; there are two filter wheels if1 = strc(sxpararr(hdrs,"IF1NAME",/silent)) if2 = strc(sxpararr(hdrs,"IF2NAME",/silent)) wo = where(if1 eq "Opn",woct) if woct gt 0 then if1[wo] = "" wo = where(if2 eq "Opn",woct) if woct gt 0 then if2[wo] = "" filters=if1+if2 ; handle SPEC headers wspec = where(instr eq 'spec',nspec) if nspec gt 0 then begin sf = strc(sxpararr(hdrs,"SFWNAME",/silent)) filters[wspec] = sf[wspec] endif return,filters end