def image_test_rings(): rings = 10 mod = 50 detector = detector_factory("Titan") sigma = detector.pixel1 * 4 shape = detector.max_shape ai = AzimuthalIntegrator(detector=detector) ai.setFit2D(1000, 1000, 1000) r = ai.rArray(shape) r_max = r.max() chi = ai.chiArray(shape) img = numpy.zeros(shape) modulation = (1 + numpy.sin(5 * r + chi * mod)) for radius in numpy.linspace(0, r_max, rings): img += numpy.exp(-(r - radius) ** 2 / (2 * (sigma * sigma))) return img * modulation
def image_test_rings(): rings = 10 mod = 50 detector = detector_factory("Titan") sigma = detector.pixel1 * 4 shape = detector.max_shape ai = AzimuthalIntegrator(detector=detector) ai.setFit2D(1000, 1000, 1000) r = ai.rArray(shape) r_max = r.max() chi = ai.chiArray(shape) img = numpy.zeros(shape) modulation = (1 + numpy.sin(5 * r + chi * mod)) for radius in numpy.linspace(0, r_max, rings): img += numpy.exp(-(r - radius)**2 / (2 * (sigma * sigma))) return img * modulation
def image_test_rings(): "Creating a test image containing gaussian spots on several rings" rings = 10 mod = 50 detector = detector_factory("Titan") sigma = detector.pixel1 * 4 shape = detector.max_shape ai = AzimuthalIntegrator(detector=detector) ai.setFit2D(1000, 1000, 1000) r = ai.rArray(shape) r_max = r.max() chi = ai.chiArray(shape) img = numpy.zeros(shape) modulation = (1 + numpy.sin(5 * r + chi * mod)) for radius in numpy.linspace(0, r_max, rings): img += numpy.exp(-(r - radius) ** 2 / (2 * (sigma * sigma))) img *= modulation img = add_noise(img, 0.0) return img
def image_test_rings(): "Creating a test image containing gaussian spots on several rings" rings = 10 mod = 50 detector = detector_factory("Titan") sigma = detector.pixel1 * 4 shape = detector.max_shape ai = AzimuthalIntegrator(detector=detector) ai.setFit2D(1000, 1000, 1000) r = ai.rArray(shape) r_max = r.max() chi = ai.chiArray(shape) img = numpy.zeros(shape) modulation = (1 + numpy.sin(5 * r + chi * mod)) for radius in numpy.linspace(0, r_max, rings): img += numpy.exp(-(r - radius)**2 / (2 * (sigma * sigma))) img *= modulation img = add_noise(img, 0.0) return img