function enhance_mem, image, fwhm=fwhm, $ magnification=magnification, maxit=maxit, reg=reg :+ ; NAME: enhance_mem ; PURPOSE: Enhance image using the maximum entropy method deconvolution ; CALLING SEQUENCE: ; New_Image = Enhance_Mem(Old) ; ; ; OPTIONAL KEYWORD INPUTS: ; FWHM Full width half maxium of the assumed PSF (default=2.0) ; REG A regulation parameter. The default is 0.05. A smaller value ; produces a sharper image, but with bigger noises. ; MAXIT The maximum iteration number (default=8) ; MAGNIFICATION the magnification factor of the output image (default=1) ; ; EXPLANATION: ; This function is an easy-to-use implementation of the routine ; mem96 which is a maxium entropy method deconvolution routine ; developed by J. Chae in 1996. It assumes a radially symmetric ; point spread function whose 2-d FFT is given by an exponetial function. ; The PSF seems to work in most cases in image enhancement of ; qualitiative purposes. ; HISTORY: ; developed by J. Chae in 1999. ; ;- if n_elements(magnification) ne 1 then magnification=1 if n_elements(maxit) eq 0 then maxit=8 if n_elements(reg) eq 0 then reg=0.05 s=size(image) x=(findgen(s(1))-s(1)/2)#replicate(1, s(2)) y=replicate(1, s(1))#(findgen(s(2))-s(2)/2) if n_elements(fwhm) eq 0 then fwhm=2.0 a=fwhm/1.55 k = shift(2*!pi*sqrt((x/s(1))^2+(y/s(2))^2), -s(1)/2, -s(2)/2) mtf = exp(-a*k) nx=2^fix(alog(s(1))/alog(2.)) nx=nx*(1+(s(1) gt nx)) ny=2^fix(alog(s(1))/alog(2.)) ny =ny*(1+(s(2) gt ny)) mem96, congrid(image, nx, ny, cubic=-0.5), x, $ otf=congrid(mtf, nx, ny, cubic=-0.5), $ /quiet, maxit=maxit, reg=reg return, congrid(x, s(1)*magnification, s(2)*magnification, $ cubic=-0.5) end