Commit d7e71f66 authored by jansen31's avatar jansen31
Browse files

typos

parent 34f505a8
......@@ -11,7 +11,8 @@ class DegenerateOrbital(PlanarMolecule):
def getDefaultParameters():
defaultParams = {
'experiment_name': '2D ARPES',
'data_filename': '..\Inputdata\OrbitalTomog\\2020_10_27_coronene_Homo1+2_ARPES_2e6counts_corrected_80x80.tif',
'data_filename': '..\\Inputdata\\OrbitalTomog'
+ '\\2020_10_27_coronene_Homo1+2_ARPES_2e6counts_corrected_80x80.tif',
'from_intensity_data': True,
'object': 'real',
'degeneracy': 2, # Number of degenerate states to reconstruct
......@@ -143,11 +144,11 @@ class DegenerateOrbital(PlanarMolecule):
def plot_guess(self, u, name=None, show=True, interpolate_and_zoom=False, figsize=(12, 3)):
""""Given a list of fields, plot the individual fields and the combined intensity"""
prop = self.propagator(self) # This is not a string but the indicated class itself, to be instanciated
prop = self.propagator(self) # This is not a string but the indicated class itself, to be instantiated
u_hat = prop.eval(u)
fourier_intensity = np.sqrt(np.sum(abs(u_hat) ** 2, axis=0))
if interpolate_and_zoom:
u_show = self.interp_zoom_field(u)
u_show = interp_zoom_field(u)
else:
u_show = u
fig, ax = plt.subplots(1, len(u) + 2, figsize=figsize, num=name)
......@@ -165,15 +166,16 @@ class DegenerateOrbital(PlanarMolecule):
plt.show()
return fig
def interp_zoom_field(self, u, interpolation=2, zoom=0.5):
"""
interpolate a field and zoom in to the center
"""
nt, ny, nx = u.shape
zmy = int(ny * zoom) // 2
zmx = int(nx * zoom) // 2
zoomed = u[:, zmy:ny - zmy, zmx:nx - zmx]
interpolated = np.array([fourier_interpolate(u_i, factor=interpolation) for u_i in zoomed])
def interp_zoom_field(u, interpolation=2, zoom=0.5):
"""
interpolate a field and zoom in to the center
"""
nt, ny, nx = u.shape
zmy = int(ny * zoom) // 2
zmx = int(nx * zoom) // 2
zoomed = u[:, zmy:ny - zmy, zmx:nx - zmx]
interpolated = np.array([fourier_interpolate(u_i, factor=interpolation) for u_i in zoomed])
return interpolated
return interpolated
......@@ -13,7 +13,8 @@ class OrthogonalOrbitals(PlanarMolecule):
def getDefaultParameters():
defaultParams = {
'experiment_name': '2D ARPES',
'data_filename': '..\Inputdata\OrbitalTomog\\2020_10_27_coronene_Homo_stack_ARPES_2e6counts_corrected_80x80.tif',
'data_filename': '..\\Inputdata\\OrbitalTomog'
+ '\\2020_10_27_coronene_Homo_stack_ARPES_2e6counts_corrected_80x80.tif',
'from_intensity_data': False,
'object': 'real',
'constraint': 'sparse real',
......@@ -261,7 +262,7 @@ def interp_zoom_field(u, interpolation=2, zoom=0.5):
nt, ny, nx = u.shape
cm = center_of_mass(np.sum(abs(u) ** 2, axis=0))
to_shift = (0, -1*int(np.round(cm[0] - ny / 2)), -1*int(np.round(cm[1] - nx / 2)))
to_shift = (0, -1 * int(np.round(cm[0] - ny / 2)), -1 * int(np.round(cm[1] - nx / 2)))
centered = np.roll(u, to_shift, axis=(0, 1, 2))
zmy = int(ny * zoom) // 2
......
Markdown is supported
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