def elliptical(): """Generate a test image with random ellipses and background noise.""" im = TestImage(shift=True, nx=1000, ny=1000) im.addEllipseRandom(nEllipse=100, value=5) im.addNoise(sigma=1) im.hanningFilter() #im.zeroPad() im.calcAll(min_npix=2, min_dr=1) im.plotMore() pylab.savefig('elliptical.%s' %(figformat), format='%s' %(figformat)) # Invert from ACovF 1d without phases im.invertAcovf1d() im.invertAcovf2d(useI=True) im.invertPsd2d(useI=True) im.invertFft(useI=True) im.showImageAndImageI() pylab.savefig('elliptical_invert.%s' %(figformat), format='%s' %(figformat)) pylab.close() return
im.hanningFilter() im.zeroPad() im.calcAll() im.plotAll(title='Ring') # ellipses, grid im = TestImage() im.addEllipseGrid(gridX=80, gridY=80, semiX=20., semiY=40., angle=45.) im.hanningFilter() im.zeroPad() im.calcAll() im.plotAll(title='Ellipse, grid') # ellipses, random locations im = TestImage() im.addEllipseRandom(value=5) im.hanningFilter() im.zeroPad() im.calcAll() im.plotAll(title='Ellipse, random') # ellipses, random locations, with noise #im = TestImage() #im.addEllipseRandom(value=5) im.addNoise() #im.zeroPad() im.calcAll() im.plotAll(title='Ellipse, random, with noise') pylab.show()