mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-09 21:12:42 +02:00
19 lines
546 B
Python
19 lines
546 B
Python
import CDTools
|
|
from matplotlib import pyplot as plt
|
|
|
|
# First, we load an example dataset from a .cxi file
|
|
filename = 'example_data/lab_ptycho_data.cxi'
|
|
dataset = CDTools.datasets.Ptycho2DDataset.from_cxi(filename)
|
|
|
|
# Next, we create a ptychography model from the dataset
|
|
model = CDTools.models.SimplePtycho.from_dataset(dataset)
|
|
|
|
# Now, we run a short reconstruction from the dataset!
|
|
for loss in model.Adam_optimize(20, dataset):
|
|
print(model.report())
|
|
|
|
# Finally, we plot the results
|
|
model.inspect(dataset)
|
|
model.compare(dataset)
|
|
plt.show()
|