;+ ; NAME: getircalfilter ; PURPOSE: ; Given a FITS header, returns a string describing the current IRCAL filter. ; ; NOTES: ; This could be *either* the FILTER1 or FILTER2 FITS keyword, depending. ; ; INPUTS:afits header ; KEYWORDS: ; OUTPUTS: a string ; ; HISTORY: ; Began 2005-03-03 12:16:34 by Marshall Perrin ;- function getircalfilter, header ;todo add error checking on header - is it a header, is it from IRCAL dims = (size(header))[0] if dims eq 1 then begin ; single FITS header fw1 = sxpar(header,"FILTER1") fw2 = sxpar(header,"FILTER2") if strc(fw2) eq "Open" then return,fw1 if strc(fw2) eq "Wollaston" then return,fw1 if strc(fw1) eq "Open" then return,fw2 return,strc(fw1)+"-"+strc(fw2) endif else begin ; stack of FITS headers n = (size(header))[2] out = strarr(n) for i=0L,n-1 do begin out[i] = getircalfilter(header[*,i]) endfor return,out endelse end