pro hlist,filelist,outlist=outlist,list=list ; program to list important fits kewords from NIRC data files ; into a summary file. Also lists to the screen if you use ; the /list option. If only the name of the input file list ; is given then you automatically get screen output. ; ; 94/8/6 JRG - UCB ; if n_params() lt 1 then begin print,'pro hlist,file_list,[outlist=summary_file],[list]' return endif file = ' ' head = ' ' ; figure out how many images, not counting blank lines openr,unit0,filelist,/get_lun if keyword_set(outlist) eq 1 then openw,unit1,outlist,/get_lun if keyword_set(outlist) eq 0 then list=1 n = 0 while eof(unit0) ne 1 do begin readf,unit0,file if (strlen(file) ne 0) then n = n+1 endwhile free_lun,unit0 tint = fltarr(n) openr,unit0,filelist,/get_lun for i=0,n-1 do begin readf,unit0,file ; print,format='($,"opening ",A," ")',file img = readfits(file,head,/silent) extract_head,head,'FILTER',filter extract_head,head,'OBJECT',object extract_head,head,'AIRMASS',airmass airmass=float(airmass) ; ; If the dcs is off the airmass can be very big! ; if float(airmass) gt 9.99 then airmass = 9.99 extract_head,head,'DATE-OBS',date_obs extract_head,head,'TINT',tint tint=float(tint) extract_head,head,'M56COAD0',coadd coadd=float(coadd) date_obs=strmid(date_obs,1,8) file=strmid(file,0,6) ; ; Look for the slash that terminates fits keyword strings ; search='/' pos=strpos(object,search) object=strmid(object,1,pos-2) pos=strpos(filter,search) filter=strmid(filter,1,pos-2) if keyword_set(outlist) eq 1 then begin printf,unit1,format='(a8,"|",a6,"|",a13,"|",a30,"|",f4.2,"|",i3,"|",f7.2)', $ date_obs,file,object,filter,airmass,coadd,tint endif if keyword_set(list) eq 1 then begin print,format='(a8,"|",a6,"|",a13,"|",a30,"|",f4.2,"|",i3,"|",f7.2)', $ date_obs,file,object,filter,airmass,coadd,tint endif endfor free_lun,unit0 if keyword_set(outlist) eq 1 then free_lun,unit1 end