Package API

This page lists the main modules in this package.

crystals

xoppylib.crystals Crystal diffraction tools and Bragg preprocessor file utilities

crystals.tools

Crystal diffraction tools: Bragg metric tensor, structure factors, and related utilities.

crystals.bragg_preprocessor_file_io

I/O utilities for Bragg crystal preprocessor files (read/write version 1 and 2).

crystals.create_bragg_preprocessor_file_v1

Create Bragg preprocessor files version 1 using dabax or xraylib.

crystals.create_bragg_preprocessor_file_v2

Create Bragg preprocessor files version 2 using dabax or xraylib.

crystals.mare_calc

MARE crystal diffraction calculations (structure factors, rocking curves).

decorators

xoppylib.decorators Material constants libraries decorated with xoppy calculation functions

decorators.xoppy_decorator

Mixin decorating material constants libraries (dabax/xraylib) with xoppy calculation functions.

decorators.dabax_decorated

DabaxXraylib instance decorated with xoppy calculation functions.

decorators.xraylib_decorated

xraylib decorated with xoppy calculation functions.

scattering functions

xoppylib.scattering_functions X-ray scattering functions (f0, f1/f2, cross sections, Fresnel)

scattering_functions.fresnel

Fresnel reflectivity and interface reflectivity for X-ray mirrors.

scattering_functions.f0_calc

Atomic form factor f0 calculations (legacy module, use xoppy_calc_f0 instead).

scattering_functions.f1f2_calc

Anomalous scattering factor f1/f2 calculations and mirror reflectivity.

scattering_functions.cross_calc

Absorption cross-section calculations for elements and compounds using dabax or xraylib.

scattering_functions.xoppy_calc_f0

XOPPY atomic form factor f0 calculator.

scattering_functions.xoppy_calc_f1f2

XOPPY anomalous scattering factor f1/f2 calculator.

scattering_functions.xoppy_calc_crosssec

XOPPY cross-section calculator for elements and compounds.

power

xoppylib.power Power and flux calculations for optical elements and monochromators

power.power1d_calc

1D integrated power and flux calculations for optical elements.

power.power1d_calc_monochromators

1D power and flux calculations for Bragg, Laue and multilayer monochromators.

power.power3d

3D power density calculations for synchrotron radiation sources.

power.xoppy_calc_power

XOPPY integrated power and flux calculator for optical elements.

power.xoppy_calc_power_monochromator

XOPPY power calculator for monochromator beamlines.

sources

xoppylib.sources Synchrotron radiation source calculators

sources.xoppy_bm_wiggler

XOPPY bending magnet and wiggler radiation spectrum and power calculations.

sources.xoppy_calc_black_body

XOPPY black body radiation spectrum calculator.

sources.urgentpy_spectrum

urgent_spectrum.py — URGENT Fortran faithful Python translation Walker & Diviacco, Rev.

sources.urgentpy_power_density_from_harmonics

Calculation of the power density for the individual harmonics.

sources.parse_urgent

Parsing utilities for URGENT binary output files.

srcalc

xoppylib.srcalc Mirror and grating ray-optics calculations

srcalc.srcalc

SRCALC: auxiliary functions for mirror and grating ray-optics calculations.

srcalc.beam

Beam class for shadow-like sequential ray-optics calculations.

srcalc.conic

Conic optical surface for ray tracing (mirrors and lenses).

srcalc.toroid

Toroid optical surface for ray tracing.

utilities

xoppylib Top-level utility modules

mlayer

python version of the multilayer code in shadow.

xoppy_xraylib_util

XOPPY utility functions wrapping dabax/xraylib for material constants, densities, and scattering factors.

xoppy_util

General utility functions for XOPPY: file locations, plotting helpers, and data I/O.

xoppy_run_binaries

Utilities for running XOPPY external Fortran/C binaries (URGENT, US, SRW wrappers).

fit_gaussian2d

2D Gaussian fitting utilities using scipy.optimize.