API Reference

API Reference#

PtyRAD is designed to be used primarily through params files using CLI commands or Jupyter notebooks. This section is intended for developers and advanced users interested in extending, debugging, or understanding the internal structure of the codebase.

Many of the functions and modules documented here are not part of a stable public API and may change without warning.

For typical usage, see the Using PtyRAD and Tutorials sections.

ptyrad.cli

Command line Interface of PtyRAD, including running reconstructions, checking system information, and others

ptyrad.reconstruction

Reconstruction and hypertune workflows for ptychographic reconstructions

ptyrad.initialization

Initialize measurements, object, probe, probe positions, tilts, and other variables

ptyrad.models

Optimizable model of the ptychographic reconstruction using automatic differentiation (AD)

ptyrad.forward

Physical forwad model that generates diffraction patterns from mixed-state probe/object in a fully vectorized way

ptyrad.losses

Loss functions and soft regularizations calculated using forward simulations against experimental measurements

ptyrad.constraints

Physical constraints that directly modify optimizable tensors with specified intervals of iterations

ptyrad.load

Loading functions for different file types including .mat, .hdf5, .tif, .raw, .yaml, etc.

ptyrad.save

Saving functions for PtyRAD outputs including model, arrays, params files, etc.

ptyrad.visualization

Plotting functions for output figures including forward passes, loss curves, positions, etc.

ptyrad.utils

Utility functions for logging, timing, image processing, etc.