mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-21 01:42:09 +02:00
Start cleaning up the repo and tidying up the example scripts
This commit is contained in:
@@ -7,23 +7,22 @@ Introduction to CDTools
|
||||
Introduction to CDTools
|
||||
-----------------------
|
||||
|
||||
CDTools is a python library for ptychography and CDI reconstructions, using an Automatic Differentiation based approach.
|
||||
CDTools is a python library for ptychography and CDI reconstructions, using an Automatic Differentiation (AD) based approach.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# imports
|
||||
import CDTools
|
||||
from matplotlib import pyplot as plt
|
||||
from CDTools.datasets import Ptycho2DDataset
|
||||
from CDTools.models import SimplePtycho
|
||||
|
||||
# Load the file
|
||||
dataset = Ptycho2DDataset.from_cxi('ptycho_data.cxi')
|
||||
dataset = CDTools.datasets.Ptycho2DDataset.from_cxi('ptycho_data.cxi')
|
||||
|
||||
# Generate a model from the data
|
||||
model = SimplePtycho.from_dataset(dataset)
|
||||
model = CDTools.models.SimplePtycho.from_dataset(dataset)
|
||||
|
||||
# Run a reconstruction
|
||||
for i, loss in enumerate(model.Adam_optimize(10, dataset)):
|
||||
for i, loss in enumerate(model.Adam_optimize(20, dataset)):
|
||||
print(i, loss)
|
||||
|
||||
# And look at the results!
|
||||
@@ -32,7 +31,7 @@ CDTools is a python library for ptychography and CDI reconstructions, using an A
|
||||
plt.show()
|
||||
|
||||
|
||||
CDTools makes it simple to load and inspect data stored in .cxi files using python scripts. Several reconstruction models for common geometries are included "out of the box". For more advanced users, it includes a bunch of modular functions for AD ptychography, which can then be used right away from the same scripting framework.
|
||||
CDTools makes it simple to load and inspect data stored in .cxi files using python scripts. Several reconstruction models for common geometries are included "out of the box". For more advanced users, it includes a modular functions for AD ptychography. These can can be used to construct new forward models.
|
||||
|
||||
The high-level interface to CDTools is built on a lower level "three-legged stool". This consists of tools to access stored data, tools to visualize data and reconstructions, and tools that implement basic operations relevant to coherent diffraction. All of these tools can be used directly alongside the high-level interface, when needed.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user