polartools#
Read and process data from the APS POLAR beamline (4-ID-D).
polartools is a Python package for working with the data products of the POLAR
beamline at the Advanced Photon Source: X-ray absorption (XAS/XMCD), diffraction
(Bragg peak fitting, HKL conversions), pressure calibration from Au/Ag
standards, area-detector image processing, and import/export of Bluesky
databroker/tiled catalogs.
It also ships the beamline’s graphical tools — scan-viewer,
flyscan-dichro-gui and xmcd-gui — as console scripts, so they install and
update with the library.
Install from PyPI, conda, or source. Set up a development environment.
Load a scan, plot it, fit a peak — in five minutes.
Read SPEC, CSV, HDF5, databroker, and tiled scans into pandas DataFrames.
Edge-step normalize, compute dichroism, plot ±-field spectra.
Fit Bragg peaks (Gaussian / Lorentzian / Voigt) and convert HKL.
Au and Ag diffraction-standard pressure calibration.
Threshold, curvature extraction, and RIXS image-to-spectrum reduction.
Pack/unpack databroker catalogs, export to CSV/JSON.
scan-viewer: browse a directory of scans, plot, fit, and open the
spectrum and image windows.
flyscan-dichro-gui and the reduction behind it: CR/CL difference maps.
The bundled xmcd-gui PyQt application for interactive XMCD processing.
Auto-generated reference for every public function and class.
Getting help#
Open a discussion or file an issue on the GitHub project. Bug reports are
welcome — please include the scan number, the full traceback, and the version
of polartools you’re running (python -c "import polartools; print(polartools.__version__)").