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.analysis

User-facing analysis of PtyRAD model.hdf5 outputs.

ptyrad.cli

Command Line Interface (CLI) of PtyRAD, including running reconstructions, checking system information, and others

ptyrad.core

PyTorch implementaiton of ptychography models, losses, and constraints

ptyrad.init

Numpy-based general initializer for diffraction patterns, object, probe, scan patterns

ptyrad.io

Common file I/O and PtyRAD-specific load/save functions

ptyrad.optics

Aberrations, physical constants, probe, and propagator formulation

ptyrad.params

Pydantic schema models for filling defaults, and validating entries from PtyRAD params files

ptyrad.plotting

Visualization functions for summary figures

ptyrad.runtime

Runtime configurations including devices, logger, random seed, and diagnostics info (i.e. system and packages) logging.

ptyrad.solver

Public-facing PtyRADSolver and workflow-related functions

ptyrad.utils

Utility functions including time parsing, affine transformation, image processing, and dev tools