# edtools.find_beam_center

Functions:

 `find_beam_center`(img[, sigma, m, kind]) Find the center of the primary beam in the image img The position is determined by summing along X/Y directions and finding the position along the two directions independently. `find_peak_max`(arr, sigma[, m, w, kind]) Find the index of the pixel corresponding to peak maximum in 1D pattern arr. `read_adsc`(fname) read in the file. `readheader`(infile) read an adsc header. `swap_needed`(header) `translate_image`(arr, shift) Translate an image according to shift. `write_adsc`(fname, data[, header]) Write adsc format.
edtools.find_beam_center.find_beam_center(img: ~numpy.ndarray, sigma: int = 30, m: int = 100, kind: int = 3) -> (<class 'float'>, <class 'float'>)

Find the center of the primary beam in the image img The position is determined by summing along X/Y directions and finding the position along the two directions independently.

Uses interpolation by factor m to find the coordinates of the pimary beam with subpixel accuracy.

edtools.find_beam_center.find_peak_max(arr: ~numpy.ndarray, sigma: int, m: int = 50, w: int = 10, kind: int = 3) -> (<class 'float'>, <class 'float'>)

Find the index of the pixel corresponding to peak maximum in 1D pattern arr.

First, the pattern is smoothed using a gaussian filter with standard deviation sigma The initial guess takes the position corresponding to the largest value in the resulting pattern A window of size 2*w+1 around this guess is taken and expanded by factor m to to interpolate the pattern to get the peak maximum position with subpixel precision.

edtools.find_beam_center.main()
edtools.find_beam_center.read_adsc(fname: str) -> (<built-in function array>, <class 'dict'>)

read in the file.