Name

center_2D - Put a off-center 2D image on image center (nx/2, ny/2).

Usage

image2, shiftx, shifty = center_2D(image1, center_method, searching_range, Gauss_radius_inner, Gauss_radius_outter, self_defined_reference)

Input

image1
off-centered image
center_method
methods to put the image into image center. ( by default, it is set as 1 )
searching_range
shifts searching is restricted to (-searching_range/2, searching_range/2). ( by default, it is set as -1, means no searching range restriction )
Gauss_radius_inner

`sigma_("""inner""")` standard deviation (in pixels) of the Gaussian function for option 2 and 3. For opiton 3, This number defines the inner hole of the donut. (by default, it is set to 2)

Gauss_radius_outer

`sigma_("""outter""")` Standard deviation (in pixels) of the Gaussian function only used for options 3. It defines the donut outter profile. (by default, it is set to 7)

self_defined_reference
Put your own input reference here, if any of the method above cannot produce qualified reference.

Output

image2
centered image
shiftx
x shift, -x applied to image_to_be_centered
shifty
y shift, -y applied to image_to_be_centered

Options

method
  1. Use phase_cog to center the image.
    • Example for option 1: >>>image2 = center_2D(image1)

      • or: >>>image2 = center_2D(image1, 20)

  2. Use Gaussian function as rough reference for centering input image.
    • Example for option 2: >>>image2 = center_2D(image1, 2, -1, 10)

      • or: >>>image2 = center_2D(image1, 2, 20, 10)

    • Centering depends on the radius of Gaussian function.
  3. Use Gaussian function to create donut shape reference for centering input image.
    • Example for option 3: >>>image2 = center_2D(image1, 3, 2, -1, 5)

      • or >>>image2 = center_2D(image1, 3, 2, 30, 5)

    • A perfect centering requires adjustment of Guassian_radius_inner, Guassian_radius_outter.
  4. Use self_defined refference.
    • Example for option 4: >>> image2 = center_2D(image1, 4, -1, 0, 0, self_reference)

      • or :>>> image2 = center_2D(image1, 4, 30, 0, 0, self_reference)

  5. cross-correlate with rotationally averaged self.
    • Example for option 5: >>>image2 = center_2D(image1, 5)

      • or: >>>image2 = center_2D(image1, 5, 30)

Description

  1. The donut reference in option 3 is produced by:
    • `"""image"""_("""ref""") =( 1/("""maximum"""_("""outter""")))*exp(   -[(x-("""nx""")/2)^2+(y-("""ny""")/2)^2]/(2*sigma_("""outter"""))) - `

`-(1/("""maximum"""_("""inner""")))*exp(-[(x-("""nx""")/2)^2+(y-("""ny""")/2)^2]/(2*sigma_("""inner""")))`

Method

Reference

Author / Maintainer

Zhong Huang

Keywords

category 1
UTILITIES

Files

utilities.py

See also

peak_search,fshift,ccf, ro_i.

Maturity

alpha
The program is tested, and works properly for the author.

Bugs

None. It is perfect.

center_2D (last edited 2013-07-01 13:12:43 by localhost)