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

All Samples(3)  |  Call(2)  |  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.)
        det_mod.simulate_diffraction_patterns(sample)
        probe_det_mod.init_data('probe')
        probe_det_mod.data = [abs(fft2(probe_det_mod.data[0]))]
 
        det_mod.save(CXData.processed_filename_string.format('det_mod'))