![Gatan K2 Summit Скачать руководство пользователя страница 49](http://html1.mh-extra.com/html/gatan/k2-summit/k2-summit_user-manual_3717154049.webp)
K2 Summit and K2 Base Direct Detection Camera User's Guide
49
getsize(imga,width,height)
number top=margin*height, left=margin*width, bottom=height*(1-margin), right=width*(1-
margin)
setselection(imga,top, left, bottom, right)
image npssum =
modulus(realfft(imga[top,left,bottom,right]+imgb[top,left,bottom,right]))**2
image npsdiff = modulus(realfft(imga[top,left,bottom,right]-
imgb[top,left,bottom,right]))**2
number ratsize = 128
image rednpssum = realimage("",4,ratsize,ratsize)
image rednpsdiff = realimage("",4,ratsize,ratsize)
getsize(npssum,width,height)
rednpssum[trunc(ratsize*icol/width),trunc(ratsize*irow/height)]+=npssum
rednpsdiff[trunc(ratsize*icol/width),trunc(ratsize*irow/height)]+=npsdiff
image fpnrat = rednpssum/rednpsdiff - 1
fpnrat[ratsize/2-1,ratsize/2-1,ratsize/2+1,ratsize/2+1]=0
result("Average fixed pattern ratio = "+100*average("%\n")
Showimage(fpnrat)