def getIntensity(fname): wfr = Wavefront() wfr.load_hdf5(indir + fname) np.save(outdir1 + fname, wfr.get_intensity()) np.save(outdir2 + fname, wfr.as_complex_array()[0, :, :, :])
ekev = wfr.params.photonEnergy z1 = 1 z2 = 1 pix_size = wfr.get_spatial_resolution()[0] delta = 1 beta = 1 bg_val = 1 scale = 1 ####################################### wfr = Wavefront() wfr.load_hdf5("coherentSrc.h5") bl = Beamline() bl.append(Drift(2), propagation_parameters(1, 1, 1, 1, mode='normal')) bl.propagate(wfr) Pr = wfr.get_phase(slice_number=0) #% np.pi*2 Ir = wfr.get_intensity(slice_number=0) for I in [Ir, Is]: I[np.where(I == 0)] = 1e-10 results = tiePavlov(Is, Ir, ekev, z1, z2, pix_size, delta, beta, bg_val, scale) % np.pi * 2 phase = Ps - Pr plt.imshow(phase) plt.show()
#bl.append(speckle, propagation_parameters(1/50,1,1/50,1)) bl.propagate(wfr) ### PLOT 3 plot_intensity_map(wfr, cmap='bone') from matplotlib import pyplot as plt ### PLOT 4 plot_intensity_map(wfr) bl = Beamline() bl.append(Drift(4.5), propagation_parameters(1, 1, 1, 1, 'quadratic')) bl.propagate(wfr) plt.imshow(wfr.get_intensity().sum(-1), cmap='bone') ### PLOT 5 plot_intensity_map(wfr, cmap='bone') from felpy.model.detector_test import Detector ### PLOT 6 plot_intensity_map(wfr) d = Detector(6.5e-06, 6.5e-06, 2500, 2500) d.detect(wfr) ### PLOT 7 plot_intensity_map(wfr, cmap='bone')