FUNCTION makqlifh,unitstring ; This function returns a 128-byte string contining an ASCII-formatted ; header for the 128x128x8 bit image stored in the quick-look image ; file. The PoCa image and its associated KI-generated header bytes ; are found in a COMMON structure to avoid passing around large ; amounts of data. COMMON KI_image,header_bytes,CCD_image type_n2c=['E','A','G','B','C','D','F'] itime=INTARR(4) qlif_header=spc(128) KIh=gethd(header_bytes) STRPUT,qlif_header,STRING(KIh.misc.cam,FORMAT='(I1)'),0 STRPUT,qlif_header,STRING(KIh.misc.fw,FORMAT='(I1)'),2 STRPUT,qlif_header,STRING(type_n2c(KIh.misc.exposure_type) $ ,FORMAT='(A1)'),4 FOR j=0,3 DO itime(j)=FIX(KIh.misc.tm.(j)) STRPUT,qlif_header,STRING(itime(0),itime(1),itime(2),itime(3) $ ,FORMAT='(I2.2,2(":",I2.2),".",I2.2)'),6 STRPUT,qlif_header,STRING(KIh.misc.exp_scale*KIh.exp.exposure/1000. $ ,FORMAT='(F5.1)'),18 lowlim=pcentile(CCD_image,0.01) uplim=pcentile(CCD_image,0.99) IF KIh.misc.exposure_type EQ 5 THEN us='DN' ELSE BEGIN IF STRLEN(unitstring) GE 2 THEN us=STRMID(unitstring,0,2) ELSE BEGIN us=spc(2) STRPUT,us,unitstring,1 ENDELSE ENDELSE STRPUT,qlif_header,STRING(lowlim,us,uplim,us,FORMAT='(2(I6,A2))'),23 STRPUT,qlif_header,STRING(KIh.misc.sequence,FORMAT='(I3)'),40 RETURN,qlif_header END