mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-30 13:52:10 +02:00
.
This commit is contained in:
+11
-1
@@ -451,6 +451,16 @@ class CDIModel(t.nn.Module):
|
||||
|
||||
"""
|
||||
|
||||
print('base models inspect: checking the object')
|
||||
a = self.obj.detach()
|
||||
def saveobj(a, filename):
|
||||
a = np.abs(a)
|
||||
plt.imshow(a)
|
||||
plt.savefig('filename')
|
||||
f = ['base_a.png', 'base_b.png', 'base_c.png', 'base_d.png']
|
||||
comp = [a[i, j, :, :] for i, j in zip([0, 0, 1, 1], [0, 1, 0, 1])]
|
||||
for i in range(4):
|
||||
saveobj(comp[i], f[i])
|
||||
first_update = False
|
||||
if update and hasattr(self, 'figs') and self.figs:
|
||||
figs = self.figs
|
||||
@@ -585,7 +595,7 @@ class CDIModel(t.nn.Module):
|
||||
if logarithmic:
|
||||
sim_data =np.log(sim_data)/np.log(10)
|
||||
meas_data = np.log(meas_data)/np.log(10)
|
||||
|
||||
|
||||
if not updating:
|
||||
axes[0].set_title('Simulated')
|
||||
axes[1].set_title('Measured')
|
||||
|
||||
@@ -92,6 +92,13 @@ class PolarizedFancyPtycho(FancyPtycho):
|
||||
obj = t.stack((obj, obj), dim=-4)
|
||||
print('object', type(obj), obj.shape)
|
||||
model.obj.data = obj
|
||||
print('polarized fancy ptycho from datset obj')
|
||||
a = obj.detach()
|
||||
plt.imshow(np.real(a[0, 0, :, :]))
|
||||
plt.show()
|
||||
plt.imshow(np.real(a[0, 1, :, :]))
|
||||
plt.show()
|
||||
|
||||
# tensor vs tensor.data
|
||||
return model
|
||||
|
||||
@@ -130,6 +137,7 @@ class PolarizedFancyPtycho(FancyPtycho):
|
||||
shift_probe=True, multiple_modes=True, polarized=True)
|
||||
|
||||
analyzed_exit_waves = polarization.apply_linear_polarizer(exit_waves, analyzer)
|
||||
# print('POLARIZED FANCY PTYCHO INTERACTION OBJ')
|
||||
|
||||
return analyzed_exit_waves
|
||||
|
||||
|
||||
Reference in New Issue
Block a user