mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-10-11 10:40:24 +02:00
Update the docstrings on all the tools files and start laying out the docs for real
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{{ fullname }}
|
||||
{{ underline }}
|
||||
|
||||
.. automodule:: {{ fullname }}
|
||||
:members:
|
||||
+3
-3
@@ -69,7 +69,7 @@ language = None
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path .
|
||||
exclude_patterns = []
|
||||
exclude_patterns = ['_build','_templates']
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
@@ -80,7 +80,7 @@ pygments_style = 'sphinx'
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'alabaster'
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
@@ -91,7 +91,7 @@ html_theme = 'alabaster'
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
# html_static_path = ['_static']
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Datasets
|
||||
========
|
||||
|
||||
.. automodule:: CDTools.datasets
|
||||
:members:
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Examples
|
||||
========
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
General Reference
|
||||
=================
|
||||
|
||||
|
||||
A note about the meaning of "array" as a type
|
||||
|
||||
A note about SI units in the package
|
||||
|
||||
Notes about special things like the probe-convention translations and the transposed basis arrays
|
||||
|
||||
|
||||
+37
-2
@@ -2,16 +2,51 @@
|
||||
Introduction to CDTools
|
||||
=======================
|
||||
|
||||
CDTools is a python library for autodifferentiation-based coherent diffractive imaging reconstructions. The core of the library is a set of simple tools built in pytorch for basic operations relevant to coherent diffraction - math operations on complex numbers, subpixel shifts, propagators, and the like. In addition, a set of database types exist to help with easily loading and saving data to/from .cxi files. Finally, a collection of ptychography models are implemented which allow for a variety of different styles of ptychographic reconstructions.
|
||||
CDTools is a python library for ptychography and CDI reconstructions, using an Automatic Differentiation based approach.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# imports
|
||||
from matplotlib import pyplot as plt
|
||||
from CDTools.datasets import Ptycho_2D_Dataset
|
||||
from CDTools.models import SimplePtycho
|
||||
|
||||
# Load the file
|
||||
dataset = Ptycho_2D_Dataset.from_cxi('ptycho_data.cxi')
|
||||
|
||||
# Generate a model from the data
|
||||
model = SimplePtycho.from_dataset(dataset)
|
||||
|
||||
# Run a reconstruction
|
||||
for i, loss in enumerate(model.Adam_optimize(10, dataset)):
|
||||
print(i, loss)
|
||||
|
||||
# And look at the results!
|
||||
model.inspect(dataset)
|
||||
model.compare(dataset)
|
||||
plt.show()
|
||||
|
||||
|
||||
CDTools makes it simple to load and inspect from 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 is straightforward to program new models for AD ptychography, which can then be used right away from the same scripting framework.
|
||||
|
||||
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.
|
||||
|
||||
Enough blabber. If you're interested, read the docs!
|
||||
|
||||
|
||||
Documentation Overview
|
||||
======================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
installation
|
||||
examples
|
||||
tutorial
|
||||
general
|
||||
datasets
|
||||
models
|
||||
tools/index
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
How to Get
|
||||
==========
|
||||
Installation
|
||||
============
|
||||
|
||||
CDTools can be downloaded from it's `MIT github page`_, and the relevant prerequisites can be downloaded via pip, conda, or most python package managers.
|
||||
|
||||
@@ -20,7 +20,7 @@ CDTools has the following prerequisites:
|
||||
* `python-dateutil <https://github.com/dateutil/dateutil/>`_
|
||||
* `h5py <https://www.h5py.org/>`_
|
||||
|
||||
All of these can be installed via pip or conda. It is required that pytorch is ilt with MKL, as that enables FFTs. Additionally, CUDA support in pytorch is recommended for running any serious reconstructions with the package. The code is written to be python 2.7+ compatible, although it is only tested in python 3.
|
||||
All of these can be installed via pip or conda. It is required that pytorch is ilt with MKL, as that enables FFTs. Additionally, installing pytorch with CUDA support is recommended for running any serious reconstructions with the package. The code is written to be python 2.7+ compatible, although it is only tested in python 3.
|
||||
|
||||
Finally, to run the tests, pytest is required, and to build the docs, sphinx and sphinx-argparse are required.
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Models
|
||||
======
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Analysis
|
||||
========
|
||||
|
||||
.. automodule:: CDTools.tools.analysis
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Cmath
|
||||
=====
|
||||
|
||||
.. automodule:: CDTools.tools.cmath
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Data
|
||||
====
|
||||
|
||||
.. automodule:: CDTools.tools.data
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Image Processing
|
||||
================
|
||||
|
||||
.. automodule:: CDTools.tools.image_processing
|
||||
:members:
|
||||
@@ -0,0 +1,17 @@
|
||||
Tools
|
||||
=====
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
cmath
|
||||
image_processing
|
||||
data
|
||||
initializers
|
||||
interactions
|
||||
propagators
|
||||
measurements
|
||||
losses
|
||||
plotting
|
||||
analysis
|
||||
projectors
|
||||
@@ -0,0 +1,5 @@
|
||||
Initializers
|
||||
============
|
||||
|
||||
.. automodule:: CDTools.tools.initializers
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Interactions
|
||||
============
|
||||
|
||||
.. automodule:: CDTools.tools.interactions
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Losses
|
||||
======
|
||||
|
||||
.. automodule:: CDTools.tools.losses
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Measurements
|
||||
============
|
||||
|
||||
.. automodule:: CDTools.tools.measurements
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Plotting
|
||||
========
|
||||
|
||||
.. automodule:: CDTools.tools.plotting
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Projectors
|
||||
==========
|
||||
|
||||
.. automodule:: CDTools.tools.projectors
|
||||
:members:
|
||||
@@ -0,0 +1,5 @@
|
||||
Propagators
|
||||
===========
|
||||
|
||||
.. automodule:: CDTools.tools.propagators
|
||||
:members:
|
||||
@@ -0,0 +1,2 @@
|
||||
Tutorial
|
||||
========
|
||||
Reference in New Issue
Block a user