PRO fixbin,header,image,top4th=top4th,verbose=verbose imsize=SIZE(image) ncols=FIX(imsize(1)) nrows=FIX(imsize(2)) KIh=gethd(header) trouble=(nrows NE KIh.exp.rows/KIh.exp.pbin) OR $ (mean(image(*,nrows/16:nrows/4-1)) GT 1.5*mean(image(*,nrows/4:nrows-1))) IF trouble THEN BEGIN tmp=REBIN(REFORM(image(*,0:nrows/4-1),nrows/2,nrows/2),nrows,nrows,/SAMPLE) IF KEYWORD_SET(top4th) THEN lastrow=nrows/4-1 ELSE lastrow=nrows-1 div=4 image(0,0)=tmp(*,0:lastrow)/div sizebytes=BYTE(N_ELEMENTS(image),0,4) BYTEORDER,sizebytes,/LSWAP BYTEORDER,sizebytes header(84)=sizebytes header(102)=BYTE(MAX(image,MIN=imagemin),0,2) header(104)=BYTE(imagemin,0,2) header(282)=BYTE(KIh.exp.cols/ncols,0,2) header(284)=BYTE(KIh.exp.rows/nrows,0,2) ENDIF ELSE IF KEYWORD_SET(verbose) THEN $ MESSAGE,'No action taken',/INFORMATIONAL RETURN END