pro head_format, filnam, index ; ; This is to examine date string and decide the head format for the specific date; ; the reason for this is that we have used three different types of date string format ; in the FITS header, and an user-friendly program has to be able to tell which ; format to use to extract date information for the subsequent analysis. ; ; This is the version just for the old (93/94/95) data. ; ; The input is the filename string which contains date information. ; fnam = filnam(0) fil_len = strlen(fnam) ;sign = strmid(fnam, fil_len -2, 2) ;if (sign eq 'gz') then date = strmid(fnam, fil_len - 17, 7) $ ; else date = strmid(fnam, fil_len - 14, 7) date = strmid(fnam(0), fil_len - 7, 7) day = fix(strmid(date, 5, 2)) year = fix(strmid(date, 0, 2)) if year le 93 then year = year + 1900 else year = year + 2000 mon = strmid(date, 2, 3) case mon of 'jan': month = 1 'feb': month = 2 'mar': month = 3 'apr': month = 4 'may': month = 5 'jun': month = 6 'jul': month = 7 'aug': month = 8 'sep': month = 9 'oct': month = 10 'nov': month = 11 'dec': month = 12 endcase if (year le 1999 and month le 9) or (year eq 1999 and month eq 9 and day le 6) or (year le 1998) then index = 1 ; >98dec03 and <99sep06 if (year eq 1999 and month gt 9) or (year eq 1999 and month eq 9 and day ge 13) then index = 2 ; >99sep13 and <99dec30 if (year ge 2000) then index = 3 ; >00jan11 if (year eq 2000 and month eq 1 and day eq 3) then index = 4 ; 00jan03 end