; NAME: ; CHECKFAX ; PURPOSE: ; get the dates straight on the SXT table fax ; CATEGORY: ; CALLING SEQUENCE: ; checkfax,yymmdd ; checkfax,"sxt_fax.000630" ; INPUTS: ; input_date, the string date name (eg '000702') ; OPTIONAL (KEYWORD) INPUT PARAMETERS: ; OUTPUTS: ; prints name-related strings and issues a warning ; (if things don't jibe) ; checks to see if DPE 30 images are being obtained recently ; (this for the Nakakubo-Hara XBP survey) ; warns if there are zero loop counters. we want more data! ; checks the TRANSMITTED line of the cover page ; checks to be sure that you didn't set FFI QT HI to 3 and then edit 2 ; counts pages and compares with the total in the title page ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; The table file name must contain the date of the first pass, UT, ; according to our table-naming convention ; Pretty primitive! This could be greatly expanded. ; MODIFICATION HISTORY: ; ...18-Sep-00, HSH ; 3-sep-01, trapped yet another small bug (HSH) ; 13-sep-01, trapped yet another small bug (HSH) ;- pro checkfax, input_date, qdebug=qdebug siz = size(input_date) if siz(n_elements(siz) - 2) eq 7 then begin id = strmid(strtrim(input_date,1),8,6) datestring = id filename = '/home/sxt_co/ksc_fax/'+input_date endif else begin id = strtrim(string(input_date),1) datestring = string(input_date) filename = '/home/sxt_co/ksc_fax/'+'sxt_fax.000'+$ strtrim(string(input_date),1)+'*' endelse if keyword_set(qdebug) then message, /info, filename text = rd_tfile(findfile(filename)) tableid = grep("Table ID", text) nn = strpos(tableid, datestring) teststr1 = strmid(tableid,nn,9) teststr2 = strmid(tableid,nn,6)+' '+strmid(tableid,nn+7,2) ; ; check for 30-s Nakakubo-type exposures ; ;print,' ' ;print,'Checking for Nakakubo-type DPE = 30 images ;check_for_30s,/quiet text = rd_tfile(findfile(filename)) org = [grep(teststr1,text), grep(teststr2,text)] print,'* For "'+input_date+'", I find...' for i = 0, n_elements(org) -1 do begin cc = strpos(org(i),'ARS') print,strmid(org(i),cc-11,21) endfor if n_elements(org) lt 3 then begin print,' ' print,'Got a table-name problem, better check before the tohbans do!' print,' ' endif else begin print,' ' print,'* Found a pretty good match for table names, may be OK' print,' ' endelse ; ; check loop counters ; loopstr = grep('LOOP',text) nstr = n_elements(loopstr) if loopstr(0) ne '' then begin for i = 0, nstr-1 do begin loop2str = strmid(loopstr(i),13,1) if float(loop2str) lt 1. then begin print,"Watch out for zero loop counters..." endif else begin print,"* Loop counters look OK" print,'' endelse endfor endif transtr = grep('TRANSMITTED',text) if transtr ne '' then begin print, "* Verily, it is written..." print, transtr print,'' endif else begin print,"Don't know whether this one was TRANSMITTED or not!" endelse ; ; check for editing-on-the-wrong-table errors ; qthi = grep('QT/HIGH',text) ffi_numb = strmid(qthi,43,1) ffi_page = grep('FFI SEQUENCE1/2',text,index=index) ffi_numb_check = strmid(text(index+1),17,1) if ffi_numb ne ffi_numb_check then begin print,"" print,"* Looks like maybe you might have edited the wrong FFI table;" print," or, conceivably, perhaps you weren't editing any FFI table?" print," Or, maybe you're trying to do a dark calibration? print,"" endif ; ; count pages ; title = grep('Page',text) titlen = strlen(title) title_number = strmid(title,titlen-2,2) spt_page = grep('SYSTEM',text) spt_number = strtrim(string(n_elements(spt_page)+1),1) print,'* Number of pages on fax header: '+title_number print,' Number of pages, in actuality: '+spt_number print,' ' ; ; check for UT-JST errors ; twotimes = grep('UT',grep('JST',text)) if twotimes ne '' then begin jst = strpos(twotimes,'JST') ut = strpos(twotimes,'UT') t1 = strmid(twotimes,jst-16,16) t2 = strmid(twotimes,ut-16,16) if strmid(t2,0,1) eq '(' then t2 = strmid(t2,1,15) deltat = max(int2secarr([t2,t1]))/3600. if deltat eq 9 then begin print,'* UT/JST time conversion done successfully!' print,'' endif else begin print,"* You've blown the UT/JST time conversion yet again," print," better check the title page one more time." print,'' endelse endif if keyword_set(qdebug) then stop end