avgb = intarr(256,256) avgc = intarr(256,256) avgd = intarr(256,256) temp = intarr(256,256) avgb = 0 avgc = 0 avgd = 0 for j = 0,9 DO BEGIN name = '../images/im400.' + string(j) name = STRCOMPRESS(name,/REMOVE_ALL) openr,1,name readu,1,temp byteorder,temp avgb = avgb + temp close,1 name = '../dk400.' + string(j) name = STRCOMPRESS(name,/REMOVE_ALL) openr,1,name readu,1,temp byteorder,temp avgd = avgd + temp close,1 ENDFOR avgb = avgb/10 openw,1,'im400.avgb' writeu,1,avgb close,1 avgd = avgd/10 openw,1,'im400.avgd' writeu,1,avgd close,1 varb = lonarr(256,256) varb = 0 varc = lonarr(256,256) varc = 0 vard = lonarr(256,256) vard = 0 FOR j = 0,9 DO BEGIN name = '../images/im400.' + string(j) name = STRCOMPRESS(name,/REMOVE_ALL) openr,1,name readu,1,temp byteorder,temp varb = varb + (LONG(temp) - LONG(avgb))*(LONG(temp) - LONG(avgb)) close,1 name = '../dk400.' + string(j) name = STRCOMPRESS(name,/REMOVE_ALL) openr,1,name readu,1,temp byteorder,temp vard = vard + (LONG(temp) - LONG(avgd))*(LONG(temp) - LONG(avgd)) close,1 ENDFOR varb = varb/9 openw,1,'im400.varb' writeu,1,varb close,1 vard = vard/9 openw,1,'im400.vard' writeu,1,vard close,1 avgc = avgb - avgd openw,1,'im400.avgc' writeu,1,avgc close,1 varc = varb + vard openw,1,'im400.varc' writeu,1,varc close,1 end