Commit 260f82c8 authored by jansen31's avatar jansen31
Browse files

bug-fixes and naming cleanup

plt.show to actually see the plot

plt.title to explain what you are seeing
parent 05611b92
......@@ -2,26 +2,33 @@ import numpy as np
from scipy.io import loadmat
import matplotlib.pyplot as plt
inp=loadmat('../../../InputData/OrbitalTomog/coronen_homo1_fourier_noise15.mat')
imshow(inp['I2'])
# Berechnung und Speicherung als png-Datei des Supports
inp_data=loadmat('../../../InputData/OrbitalTomog/coronen_homo1_fourier_noise15.mat')
inp=inp_data["I2"]
ny,nx = inp.shape
# Autokorrelation
threshold_autocorr=0.1;
support0=np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(inp['I2'])));
cond2=(support0 < threshold_autocorr*np.amax(support0)).astype(uint);
threshold_autocorr=0.1
autocorrelation=np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(inp)))
init_support=(autocorrelation < threshold_autocorr * np.amax(autocorrelation)).astype(np.uint)
# Anfangsbedingungen
support=support0;
F0=inp['I2']**0.5;
ph_init = 2*np.pi*np.random.rand(F0.shape);
support=autocorrelation
ph_init = 2*np.pi*np.random.rand(ny,nx)
# ph_init = np.angle(np.fft.fft2(ph_init));
u0 = F0 * np.exp(1j.*ph_init);
previous = np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(u0)));
u0 = inp * np.exp(1j*ph_init)
previous = np.fft.fftshift(np.fft.ifft2(np.fft.ifftshift(u0)))
plt.figure()
plt.subplot(121)
plt.imshow(support0.real)
plt.figure(figsize=(15,4))
plt.subplot(131)
plt.imshow(inp)
plt.colorbar()
plt.title("Photoelectron spectrum")
plt.subplot(132)
plt.imshow(autocorrelation.imag)
plt.colorbar()
plt.title("Orbital autocorrelation, real part")
plt.subplot(133)
plt.imshow(init_support)
plt.colorbar()
plt.subplot(122)
plt.imshow(cond2)
plt.colorbar()
\ No newline at end of file
plt.title("Initial support")
plt.show()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment