pro pr_his_index, index, allout, $ quiet=quiet, loud=loud, longform=longform, qstop=qstop, $ dark=dark, leak=leak, synleak=synleak, second=second, $ despiked=despiked, destreaked=destreaked, ncomposite=ncomposite, $ vignette=vignette, descatter=descatter, $ registered=registered, ssc_norm=ssc_norm, res_norm=res_norm, $ only_flags=only_flags ;+ ;NAME: ; pr_his_index ;PURPOSE: ; To print out the information from the SXT history index ;SAMPLE CALLING SEQUENCE: ; pr_his_index, index ; pr_his_index, index, /longform ;INPUT: ; index - The index ;OPTIONAL KEYWORD INPUT: ; longform - If set, then give full GET_INFO2 information on ; each of the dark and leak images used ;OPTIONAL OUTPUT: ; allout, string with normal pr_his_index output. This inhibits ; writing to screen. For index array allout concatenates all ; into big 1D variable with each line of output a variable. ;Keyword OUTPUT - ; The following keywords are OUTPUT booleans which indicate whether ; implied processing was (1) or was not (0) done for each input index: ; dark, leak, synleak, second, despiked, destreaked, vignette, descatter ; registered, ssc_norm res_norm ; ; ncomposite (output) - number of images if composite ; only_flags - (input switch) - if set, dont bother which text or tty ; output - ie, only output state flags are of interest ; (will run faster for large number of input index records) ;HISTORY: ; Written 1994 by M.Morrison ; 20-Mar-95 (MDM) - Modified to report information on Vignette ; ~1-Mar-99 S.L.Freeland - add despike/destreak, some formatting ; 22-sep-99 S.L.Freeland - add DC ORBIT CORRECT check ; [high bit = 2^15 in index.HIS.q_dark_sub ; 23-sep-99 S.L.Freeland - Colum Blem history check ; [low bit = 1 in index.HIS.q_extra(1,nn) ] ; 10-Jan-2000 S.L.Freeland - 2nd order leak correction check ; 16-jan-2004 S.L.Freeland - Scattering his (sxt_decon...) ; 14-Jul-2004 S.L.Freeland - exposure normalization flg/algorithm ; 29-Sep-2004 S.L.Freeland - externalize info via keyword flags ; and add /ONLY_FLAGS keyword and funct ; (for use by sxt_index2filename for ; example)s ; 5-oct-2004 S.L.Freeland - enable leak type (synthetic vs terminator) ; 13-dec-2004 S.L.Freeland - check/verbalize LOW8 restor ; 20-oct-2005 Aki Takeda - omit some blanks in output strings, to avoid ; truncated info found in FITS header. ; 21-oct-2005 Aki Takeda - carry milisec info for SSC history. ; 15-dec-2005 Aki Takeda - omit 'Exposure normalization' information. ; - add unit in the 'Exposure duration' line ; - add a new line, 'Intensity units: .....' ; 22-jan-2006 Aki Takeda - modify 'Intensity units' proper for movies. ; 29-jul-2009 Aki Takeda - modify 'Intensity units' proper for the case, ; /exp_norm is on. ; 19-aug-2009 LWA - Clarified header. Deleted restriction. ; ;- ; only_flags=keyword_set(only_flags) ; flag only mode needout=1-only_flags loud=keyword_set(loud) or n_params() lt 2 loud=loud and (1-only_flags) quiet=(1-loud) or keyword_set(quiet) qlong = keyword_set(longform) ; ; dark=dark, leak=leak, synleak=synleak, second=second, $ ; despiked=despiked, destreaked=destreaked, ncomposite=ncomposite, $ ; registered=registered, ssc_norm=ssc_norm, res_norm=res_norm nind=n_elements(index) dark=intarr(nind) leak=intarr(nind) synleak=leak second=leak despiked=leak destreaked=leak ncomposite=leak registered=leak ssc_norm=leak res_norm=leak vignette=leak descatter=leak info = get_info2(index, /noninteractive) n = n_elements(index) allout='' for iimg=0,n-1 do begin if only_flags then allout='' ; avoid concatenation slowdown index0 = index(iimg) if loud then print, info(iimg) if iimg gt 0 then allout=[allout,''] ; image delimeter if (his_exist(index0)) then begin ;---------------------------------------- Dark Subtraction ---------------------------------------- ; lin = ' Dark Subtraction: ' lin = ' Dark Subtraction: ' ; AkT(20-oct-2005) dchist=gt_tagval(index0,/q_dark_sub,missing=0.) ver = (dchist and '7fff'x)/1000. orbit=(dchist and 2^15) ne 0 if (ver ne 0) or (max(index0.his.day_dark) ne 0) then begin lin = lin + '(dark_sub,Ver:' + string(ver, format='(f6.3)') + ')' ss = where(index0.his.day_dark ne 0, nn) times = anytim2ints(rotate([[index0.his.time_dark], [index0.his.day_dark]],4)) if (nn eq 0) then begin lin = lin + ' Scalar ' + 'Value = ' + strtrim(index.his.time_dark(0),2) if loud then print, lin allout=[allout,strtrim(lin,2)] end else begin ; if (nn eq 1) then lin = lin + ' One Img ' $ ; else lin = lin + ' Interp ' if (nn eq 1) then lin = lin + ' One Img ' $ else lin = lin + ' Interp ' ; AkT(20-oct-2005) lin0 = string(bytarr(strlen(lin))+32b) for i=0,nn-1 do begin ; if (i eq 0) then lin = lin + ' ' $ ; else lin = lin0 + ' and ' if (i eq 0) then lin = lin + ' ' $ else lin = lin0 + 'and ' ; AkT(20-oct-2005) if (qlong) then begin rd_obs, times(i), times(i), bcs, sxtf, /nobcs, /quiet lin = lin + get_info2(sxtf(0), /noninteractive) end else begin lin = lin + fmt_tim(times(i)) end if loud then print, lin allout=[allout,strtrim(lin,2)] end end undeterm= (ver lt 3.27) and (ver gt 3.10) lin=' DC Orbit Correction: ' + $ ([(['Disabled','Enabled'])(orbit),'Undeterminant'])(undeterm) if loud then print,lin allout=[allout,strtrim(lin,2)] dark(iimg)=1 end else begin lin = lin + 'NONE PERFORMED' if loud then print, lin allout=[allout,strtrim(lin,2)] end ; columb blemish correction dcblem=gt_tagval(index0,/q_extra,missing=[0.,0]) chkdcb=(dcblem(1,0) and 1)(0) if chkdcb then begin lin=' Column Blem Correction Applied ' if loud then print,lin allout=[allout,strtrim(lin,2)] endif ; ; -------------------------- Clean/despike ------------- ; algorithm=index0.his.q_extra(0,*) AND '7'x destreaked(iimg)=algorithm and '1'x despiked(iimg) =(algorithm and '6'x) ne 0 cleantypes=str2arr('NONE applied,Despiked: (de_spiker.pro),Despiked: (sigma_filter.pro),sxt_kleen.pro,Despiked: (sxt_clean.pro),Despiked: (sxt_clean.pro) & Destreaked: (sxt_xsaa.pro') cleaninfo=cleantypes(algorithm) level=string(index0.his.extra1(0,*),format='(f5.1)') ss=where(algorithm eq 0,sscnt) if sscnt gt 0 then level(ss)='N/A' outinfo=' ' + strjustify(['Clean Algorithim', cleaninfo]) + $ ' ' + ['N_SIGMA',level] if loud then more,['',outinfo,''] allout=[allout,cleaninfo + ' Level/N_Sigma = ' + level] ;---------------------------------------- Leak Subtraction ---------------------------------------- lin = ' Leak Subtraction: ' lkhist=gt_tagval(index0,/q_leak_sub,missing=0.) ver = (lkhist and '7fff'x)/1000. socorrect=(lkhist and 2^15) ne 0 second(iimg)=socorrect if (ver ne 0) then begin lin = lin + ' (leak_sub.pro Ver:' + string(ver, format='(f6.3)') $ ; + ') ' + ') ' ; AkT(20-oct-2005) times = anytim2ints([index0.his.time_leak, index0.his.day_leak]) synthetic_sfc=ssw_deltat(times,index0) eq 0 if (qlong) then begin rd_obs, times, times, bcs, sxtf, /nobcs, /quiet lin = lin + get_info2(sxtf(0), /noninteractive) end else begin lin = lin + fmt_tim(times) end if loud then print, lin allout=[allout,strtrim(lin,2)] lin= ' Leak Dbase Type: ' + (['Terminator','Synthetic'])(synthetic_sfc) if loud then print, lin allout=[allout,strtrim(lin,2)] lin= ' Second Order Leak Correction? ' + $ ([' NONE ' ,' YES (sxt_deleak.pro)'])(socorrect) if loud then print,lin allout=[allout,strtrim(lin,2)] leak(iimg)=1 synleak(iimg)=synthetic_sfc end else begin lin = lin + 'NONE PERFORMED' if loud then print, lin allout=[allout,strtrim(lin,2)] end if loud then print,'' ; ;-------------------------------- de-SCATTER ------------------------- dconver=index0.his.extra2(1) descatter(iimg)=dconver ne 0. sver=string(dconver,format='(f4.1)') lin=' Image Deconvolution? ' + $ ([' NONE ' ,' YES (sxt_decon.pro Ver: '+sver +' )'])(dconver ne 0.) dflags=index0.his.spare(3) delta=dflags and '1'x wings=(dflags and '2'x) ne 0 moffat=(dflags and '4'x) ne 0 mstring=(['',' Moffat'])(moffat) + (['','Only'])(1-delta) dstring=(['',' Delta'])(delta) wstring=(['',' Wings'])(wings) dstrings=arr2str(strarrcompress([dstring,wstring,mstring]),' + ') lin=lin + (['',dstrings])(dconver ne 0.) if loud then print,lin allout=[allout,strtrim(lin,2)] ;---------------------------------------- Composite Image ---------------------------------------- ; lin = ' Composite Image Creation: ' lin = ' Composite Creation:' ; AkT(20-oct-2005) lin0 = string(bytarr(strlen(lin))+32b) ; AkT(20-oct-2005) ver = index0.his.q_composite/1000. if (ver ne 0) then begin lin = lin + ' (sxt_composite.pro Ver:' + string(ver, format='(f6.3)')+')' ss = where(index0.his.day_compos ne 0, nn) times = anytim2ints(rotate([[index0.his.time_compos], [index0.his.day_compos]],4)) ; lin0 = string(bytarr(strlen(lin))+32b) lin = lin + ' # Images Used: ' + strtrim(nn,2) ncomposite(iimg)=nn if loud then print, lin allout=[allout,strtrim(lin,2)] for i=0,nn-1 do begin lin = lin0 + 'Img' + strtrim(i+1,2) + ': ' if (qlong) then begin rd_obs, times(i), times(i), bcs, sxtf, /nobcs, /quiet lin = lin + get_info2(sxtf(0), /noninteractive) end else begin ; lin = lin + fmt_tim(times(i)) lin = lin + fmt_tim(times(i),/ms) ; AkT(21-oct-2005) end if loud then print, lin allout=[allout,' ' + strtrim(lin,2)] end end else begin lin = lin + 'NONE PERFORMED' if loud then print, lin allout=[allout,strtrim(lin,2)] end ; ;---------------------------------------- Vignette Correction ---------------------------------------- lin = ' Vignette Correction: ' ver = index0.his.qflat_field/1000. if (ver ne 0) then begin lin = lin + 'Ver:' + string(ver, format='(f6.3)') + ' ' lin = lin + 'Technique: ' + strtrim(index0.his.flat_tech,2) if loud then print, lin allout=[allout,strtrim(lin,2)] vignette(iimg)=1 end else begin lin = lin + 'NONE PERFORMED' if loud then print, lin allout=[allout,strtrim(lin,2)] end ; ; ------------------ LOW8 Restore Check ------- low8rest=index0.his.time_12bit(1,*) ne 0 if low8rest then begin timcomp={time:index0.his.time_12bit(1,0),day:index0.his.day_12bit(1,0)} lin=' LOW8 Restored using COMP image: ' + $ anytim(timcomp,/vms,/trunc) if loud then print,lin allout=[allout,strtrim(lin,2)] endif ; no report if nothing since ~rare ; ; --------------------- registration ----------- regist = total(abs(index0.his.arcsec_shift)) ne 0 or $ index0.his.q_roll_corr ne 0 registered(iimg)=regist lin= ' Registration: ' + (['NONE','Yes'])(regist) if loud then print, lin allout=[allout,strtrim(lin,2)] ;---------------------------------------- Exposure and Resolution ---------------------------------------- fmt = '(f12.1)' lin = ' Exposure Duration (millisec): Original= ' + string(gt_expdur(index0, /orig), format=fmt) + $ ' New= ' + string(gt_expdur(index0), format=fmt) if loud then print, lin allout=[allout,strtrim(lin,2)] ; lin = ' Pixel Resolution: Original= ' + gt_res(index0, /str, /orig) + $ ' New= ' + gt_res(index0, /str) if loud then print, lin allout=[allout,strtrim(lin,2)] ; lin = ' Exposure Normalization: ' ; ( 15-dec-2005 commented out by AkT ) ntype=gt_tagval(index0,'q_exp_norm',missing=0) case 1 of gt_expdur(index0) ne 1000. : nstr='NONE PERFORMED' else: begin nstr=(['DN/Sec/Full-Res Pixel (inferred)', $ 'DN/Sec/Full-Res Pixel (explicit)', $ 'DN/Sec/Image-Pixel (explicit)'])(ntype) ssc_norm(iimg)=ntype eq 2 res_norm(iimg)=ntype lt 2 endcase endcase ; lin=lin+nstr ; (15-dec-2005 commented out by AkT) lin=' Intensity units: ' ; (22-jan-2006 AkT) ; if regist eq 0 then ustr=' DN/Image-Pixel/Exposure-Duration' $ ; else ustr=' Arbitrary logarithmic scale ' ; (AkT) if regist eq 1 then ustr=' Arbitrary logarithmic scale ' $ ; (29-jul-2009 AkT) else begin ; (AkT) case ntype of ; (AkT) 1 : ustr=' DN/Full-Res-Pixel/Exposure-Duration' ; (AkT) 2 : ustr=' DN/Image-Pixel/Exposure-Duration' ; (AkT) else : ustr=' DN/Image-Pixel/Exposure-Duration' ; (AkT) endcase ; (AkT) endelse ; (AkT) ; lin=lin+ustr ; (AkT) if loud then print,lin allout=[allout,strtrim(lin,2)] end end allout=allout(1:*) ; eliminate initial record ; if (keyword_set(qstop)) then stop end ; ; ; ;Qregistered Qrolled QHelioTracked Sun Center Value Coordinates (CCD and/or Helio and/or Angle) ;ProgVer ; Shape Sub Pixel Shift Amount ;Orig New ; ;-------------------------------------------------------------------------------------------------------------------------------- ;Future: ;Q12Bit Reconstruct Images Used ; dd-mmm-yy hh:mm:ss dd-mmm-yy hh:mm:ss