Name
TwoDTestFunc- Create a 2D test function or quantities related to it, where these quantities
- have analytic expressions
Usage
output = TwoDTestFunc(Size, p, q, a, b, flag=0, alpha=0)
Input
- Size
- Is the size of the image. MUST be odd.
- p
- the x-frequency
- q
- the y-frequency
- a
- the x-falloff
- b
- the y-falloff
- flag
- takes on one of 5 possible values. (0) 2D function, (1) 2D FT , (2) projection , (3) FT of projection , (4) FH
- alpha
- the projection angle (when needed)
Output
- output
- depends on flag=0,1,2,3 or 4
- ImBW, which is a sampling of side Size of the test function.
- ImBWFFT, which is a sampling of side Size of the Fourier Transform of the test function
- pofalpha, which is a sampling of the analytical projection of the test function in Real space.
- pofalphaFT, which is the analytical projection of the test function in Fourier space.
- rhoOfkm, which is a sampling of the Fourier Harmonic of the test function.
Description
Purpose: Create a nicely bounded function from which one can calculate projections analytically. The Function (flag=0) is
cos(px) cos(qy) exp(-x2 /a2 /2) exp(-y2/b2 /2)
There is an additional normalization, such that the total integral is unity. The normalization constant is
(1/ 2/ $\pi$) exp(a2 p2 /2) exp(b2 q2 /2)
The Fourier transform (flag=1) is
cosh(p r a2) cosh(q s b2) exp(-a2 r2 /2) exp(-b2 s2 /2)
The projection in Fourier space (flag=3) is (Fourier variable is v)
5* ( cosh(v(P+Q)D) + cosh(v(P-Q)D) ) exp(-v2 D2 /2)
with
D = sqrt( sin2 (alpha) b2 + cos2 (alpha) a2 )$
P = p cos(alpha) a2 /D Q = q sin(alpha) b2 /D
The projection (flag=2) is (parametrized by x)
5* ( cos(X(P+Q)) exp((P+Q)2/2) + cos(X(P-Q)) exp((P-Q)2/2) ) exp(-X2 /2) /
- sqrt( 2 pi ) D
with X=x/D
The Fourier Harmonic (flag=4) is (parametrized by k,m) when a=b
exp(-k2 b2/2) cos(m arctan (q/p)) I_m(k b2 sqrt(p2+q2))
with X=x/D
Author / Maintainer
P. R. Baldwin
Keywords
- category 1
- UTILITIES
- category 2
- SPATIAL.
Files
- util_sparx.cpp
See also
- References to relevant other routines.
Maturity
- alpha
Bugs
Only works with odd size image. flag=4 not yet implimented