mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-10 21:42:39 +02:00
0bfbc9892213bb3a7ceb644935aa579004c48835
CDTools
CDTools is a python library for ptychography and CDI reconstructions, using an Automatic Differentiation based approach.
# imports
from matplotlib import pyplot as plt
from CDTools.datasets import Ptycho_2D_Dataset
from CDTools.models import FancyPtycho
# Load the file
dataset = Ptycho_2D_Dataset.from_cxi('ptycho_data.cxi')
# Generate a model from the data
model = FancyPtycho.from_dataset(dataset)
# Run a reconstruction
for loss in model.Adam_optimize(10, dataset):
print(model.report())
# And look at the results!
model.inspect(dataset) # See the reconstructed object, probe, etc.
model.compare(dataset) # See how the simulated and measured patterns compare
plt.show()
Full installation instructions and documentation can be found here.
Have a wonderful day!
Languages
Python
100%