Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/c/x/CXPhasing-0.3.0/cxphasing/CXPhasing.py   CXPhasing(Download)
import CXParams as CXP
from CXData import CXData
from CXData import fft2, ifft2, angle, exp, fftshift, conj, abs
from CXData import log as nlog
import time
    def M(self, psi, det_mod):
        return ifft2(det_mod * exp(complex(0., 1.) * angle(fft2(psi))))
 
    def error(self, psi, det_mod):
        return sp.sum((abs(abs(fft2(psi)) - det_mod) ** 2.).data[0]) / sp.sum(det_mod.data[0] ** 2.)