Beispiel #1
0
def fft_test():
	aux_mat = gp.prepare_aux_matrices(512)
	#p_lg = gp.gen_lg_pattern(1,10,aux_mat,5)
	#p_bg = gp.gen_blaze_grating(50,aux_mat)
	#p_swirl = gp.gen_swirl_pattern(aux_mat, dz=10, twist=10)
	#p_hg = gp.gen_hg_pattern(512, m=1, n=2)
	p_z = exp(1j*gp.phasemap(p_hg+p_bg)*2*pi)
	#imshow(gp.phasemap(p_swirl), cmap=get_cmap('binary'))
	#figure(2)
	imshow(fftpack.fftshift(abs(fftpack.fft2(p_z))), cmap=get_cmap('binary'))
	show()
Beispiel #2
0
def fft_test():
    aux_mat = gp.prepare_aux_matrices(512)
    #p_lg = gp.gen_lg_pattern(1,10,aux_mat,5)
    #p_bg = gp.gen_blaze_grating(50,aux_mat)
    #p_swirl = gp.gen_swirl_pattern(aux_mat, dz=10, twist=10)
    #p_hg = gp.gen_hg_pattern(512, m=1, n=2)
    p_z = exp(1j * gp.phasemap(p_hg + p_bg) * 2 * pi)
    #imshow(gp.phasemap(p_swirl), cmap=get_cmap('binary'))
    #figure(2)
    imshow(fftpack.fftshift(abs(fftpack.fft2(p_z))), cmap=get_cmap('binary'))
    show()
Beispiel #3
0
        self.axes = self.fig.add_axes([0, 0, 1, 1])

        layout = QtGui.QHBoxLayout()
        layout.addWidget(self.fc)
        layout.setMargin(0)
        self.setLayout(layout)

    def imshow(self, img):
        self.axes.clear()
        self.axes.axis("off")
        self.axes.imshow(img, cmap=get_cmap("binary"))
        self.fc.draw()


if __name__ == "__main__":
    import gen_pattern as gp

    qApp = QtGui.QApplication(sys.argv)
    SLM = SLMDialog()

    aux_mat = gp.prepare_aux_matrices(512)
    p_lg = gp.gen_lg_pattern(3, 3, aux_mat, 4)
    p_g = gp.gen_blaze_grating(50, aux_mat)
    pm = gp.phasemap(p_lg + p_g)
    # pm = gp.phasemap(p_lg)

    SLM.imshow(pm)
    SLM.show()

    sys.exit(qApp.exec_())
Beispiel #4
0
        self.axes = self.fig.add_axes([0, 0, 1, 1])

        layout = QtGui.QHBoxLayout()
        layout.addWidget(self.fc)
        layout.setMargin(0)
        self.setLayout(layout)

    def imshow(self, img):
        self.axes.clear()
        self.axes.axis('off')
        self.axes.imshow(img, cmap=get_cmap('binary'))
        self.fc.draw()


if __name__ == '__main__':
    import gen_pattern as gp

    qApp = QtGui.QApplication(sys.argv)
    SLM = SLMDialog()

    aux_mat = gp.prepare_aux_matrices(512)
    p_lg = gp.gen_lg_pattern(3, 3, aux_mat, 4)
    p_g = gp.gen_blaze_grating(50, aux_mat)
    pm = gp.phasemap(p_lg + p_g)
    #pm = gp.phasemap(p_lg)

    SLM.imshow(pm)
    SLM.show()

    sys.exit(qApp.exec_())