API reference¶
This page documents the PyARPES API by generation from signatures and docstrings. You can use this and the source code to supplement the remainder of the PyARPES documentation.
Please note that this is not a complete API documentation page. Less used and internal APIs are not documented here.
Data-loading functions¶
|
Loads a piece of data using available plugins. |
|
Provides sample data for executable documentation. |
ExampleData() |
Momentum Conversion¶
Exact Forward Transforms¶
|
Forward converts all the individual coordinates of the data array. |
Utilities¶
|
Provides a Pythonic interface to fast gridded linear interpolation. |
|
Converts from the full set of standard PyARPES angles to momentum. |
|
Produces coordinates for the scan path of arr in the coordinate system of reference_arr. |
Conversion Implementations¶
You do not need to call these directly, but they are good references for anyone looking to implement a different kind of coordinate transform.
|
Infrastructure code to support a new coordinate conversion routine. |
|
A momentum converter for single ARPES (kp) cuts. |
|
Implements volumetric momentum conversion for kx-ky scans. |
|
Implements single angle photon energy scans. |
General Analysis¶
Axis Methods¶
|
Rebins the data onto a different (smaller) shape. |
|
Symmetrizes data across an axis. |
|
Clips the data so that only regions where there is substantial weight are included. |
|
Normalizes the intensity so that all values along axes other than dim_or_dims have the same value. |
|
Sorts slices of data along axis_name so that they lie in order. |
Experimental Resolution Modeling¶
|
Gives the quadrature sum estimate of the resolution of an ARPES spectrum. |
|
Calculates the thermal broadening from the temperature on the data. |
|
|
|
Estimates the energy resolution of the analyzer. |
Self-Energy¶
|
Converts MDC fit results into the self energy. |
|
Fits for the self energy of a dataset containing a single band. |
|
Estimates the bare band from a fitted dispersion. |
|
Calculates the quasiparticle mean free path in meters (meters!). |
Derivatives¶
|
Like curvature, performs a second derivative. |
|
Provides “curvature” analysis for band locations. |
|
Implements the minimum gradient approach to defining the band in a diffuse spectrum. |
Smoothing and Filtering¶
|
Coordinate aware scipy.ndimage.filters.gaussian_filter. |
|
Coordinate aware scipy.ndimage.filters.boxcar_filter. |
|
Implements a Savitzky Golay filter with given window size. |
Deconvolution¶
|
Produces a 1-dimensional gaussian point spread function for use in deconvolve_rl. |
|
Deconvolves data by a given point spread function using the iterative convolution extrapolation method. |
|
Deconvolves data by a given point spread function using the Richardson-Lucy method. |
Masks¶
|
Applies a logical mask, i.e. one given in terms of polygons, to a specific piece of data. |
|
Performs broadcasted masking along a given dimension. |
|
Converts a mask definition in terms of the underlying polygon to a True/False mask array. |
|
Converts a polygon into a mask definition. |
Fermi Surface Pockets¶
|
Produces radial slices along a Fermi surface through a pocket. |
|
Collects EDCs around a pocket. |
|
Produces EDCs distributed radially along a vector from the pocket center. |
|
Estimates pocket center, anisotropy, principal vectors, and extent in either angle or k-space. |
Background Removal¶
Shirley Backgrounds¶
Calculates a shirley background iteratively over the full energy range energy_range. |
|
Calculates and removes a Shirley background from a spectrum. |
Convex Hull Backgrounds¶
Calculates a background using the convex hull of the data (viewing the intensity as a Z axis). |
|
Removes a background according to calculate_background_hull. |
Incoherent Backgrounds¶
Removes counts above the Fermi level. |
Array Alignment¶
Subpixel Correlation Based Alignment¶
|
Returns the unitful offset of b in a for ndarrays. |
Machine Learning¶
ML Based Decompositions¶
Performs a change of basis of multidimensional data according to sklearn decomposition classes. |
|
|
Performs a change of basis of multidimensional data according to sklearn decomposition classes. |
|
Performs a change of basis of multidimensional data according to sklearn decomposition classes. |
Performs a change of basis of multidimensional data according to sklearn decomposition classes. |
|
|
Performs a change of basis of multidimensional data according to sklearn decomposition classes. |
Interactive Decomposition Browsers¶
|
A tool providing PCA decomposition exploration of a dataset. |
Deep Learning and PyTorch¶
Utilities for interpretation of results akin to those in fast.ai.
Provides utilities to interpret predictions of a model. |
|
Provides tools to introspect model performance on a single item. |
IO tools.
Reads data from a relatively portable binary format. |
|
|
Converts data to a relatively portable binary format. |
Transform pipelines.
Represents a reversible identity transform. |
|
A reversible anonymous function, so long as the caller supplies an inverse. |
|
|
Like torchvision.transforms.Compose but this operates on data & target in each transform. |
Data Generation¶
Here are tools for simulating ARPES from theoretical models, including finite statistics, resolution modeling, and detector effects.
|
Samples events from a probability distribution. |
|
Converts a point cloud (list of xy pairs) to an array representation. |
|
Implements the Marginal Fermi Liquid spectral function, more or less. |
Implements the “phase coherence” model for the BSSCO spectral function. |
|
Detector effects are callables that map a spectrum into a new transformed one. |
|
Implements power law detector nonlinearities. |
Data Loading Plugins¶
Implements data loading for the Lanzara group “Main Chamber”. |
|
Implements data loading for the Lanzara group Spin-ToF. |
|
Implements data loading for ANTARES at SOLEIL. |
|
|
Data loading for the nano-ARPES beamline “Spectromicroscopy Elettra”. |
Loads data from exported .nc format saved by xarray. |
|
Sequentially tries different loading plugins. |
|
Implements data loading at the ALS HERS beamline. |
|
Implements loading exported HDF files for ARPES data from Igor. |
|
A generic file loader for PXT files. |
|
The Kaindl Tr-ARPES high harmonic generation setup. |
|
Implements data loading at the microARPES endstation of ALS’s MAESTRO. |
|
Implements data loading at the nanoARPES endstation of ALS’s MAESTRO. |
|
Implements loading text files from the MB Scientific text file format. |
|
The MERLIN ARPES Endstation at the Advanced Light Source. |
|
Provides data loading for the Lanzara group experimental ARToF. |
Curve Fitting¶
Broadcast Fitting¶
|
Perform a fit across a number of dimensions. |
General Curve Fitting Utilities¶
|
Turns an lmfit.model.ModelResult into a dictionary with initial guesses. |
Models¶
Collect imports from categorized submodules. |
Helpful Methods for Setting Initial Parameters¶
Working with Broadcast Fit Results¶
Available as methods via .F
accessor.
Utilities related to examining curve fits. |
NorthStar Laue¶
Loading Laue data from the NorthStar DAQ program
|
Loads NorthStart Laue backscattering data. |
Plotting¶
Interactive Utilities: Qt Based¶
|
Starts the qt_tool using an input spectrum. |
|
Start the momentum conversion tool. |
Starts the fitting inspection tool using an input fit result Dataset. |
|
Starts the Brillouin zone exploration tool. |
|
General Utilities/Matplotlib Quality of Life¶
An incomplete list of useful plotting utilities from arpes.utilities.plotting
.
|
Provides workspace and date scoped path generation for plots. |
|
The PyARPES preferred figure saving routine. |
|
Generates a square-ish set of axes and hides the extra ones. |
Make a Axes instance completely invisible. |
|
Remove all axis ticks. |
|
Removes colorbars from given (or, if no given figure, current) matplotlib figure. |
|
|
Makes thick, visually striking borders on a matplotlib plot. |
Context manager that retains axis limits. |
|
|
Convenience method to plot an array with a mask over some other data. |
|
Plots a mask by using a fixed color and transparency. |
Swaps the x axis to the top of the figure. |
|
Swaps the y axis to the right of the figure. |
|
Swaps the y axis to the right of the figure and the x axis to the top. |
|
|
Conditionally escapes a string based on the matplotlib settings. |
|
Attaches better display axis labels for all axes. |
|
Annotates that a given axis was summed over by listing the integration range. |
|
Makes a summary plot with different marginal plots represented. |
Interactive Utilities: Bokeh Based¶
|
Starts the dynamic tool using dynamic_function and widgets for each arg. |
|
Presents a utility to rerun a function with different arguments and see the result of the function. |
Interactive verification of fit quality for broadcast fits. |
|
|
Tool to allow masking data by drawing regions. |
|
Tool to allow drawing paths on data, creating selections, and masking regions around paths. |
|
Two dimensional fitting band tool. |
|
Implements a 2D and 3D data browser via Bokeh. |
Interactive Utilities: Matplotlib Based¶
|
A utility allowing for selection of rectangular regions. |
|
A utility allowing for selection of points in a dataset. |
|
A tool providing PCA decomposition exploration of a dataset. |
|
A utility for assigning coordinate offsets using a live momentum conversion. |
|
A tool for initializing lineshape fitting. |
Stack Plots¶
Generates a stack plot with all the lines distinguished by offset rather than color. |
|
|
Generates a stack plot with all the lines distinguished by color rather than offset. |
Makes a stack plot but which uses scatters rather than a lineplot for each curve in the set. |
Spin-ARPES Plots¶
Plots a simple spin polarized spectrum using curves for the up and down components. |
|
|
Plots a spin spectrum using total intensity and assigning color with the spin polarization. |
Plots a spin difference spectrum. |
Count-based and ToF Plots¶
|
Makes a fill-between line plot with error bars from associated statistical errors. |
|
Makes a scatter plot of data with error bars generated from associated statistical errors. |
Reference Plots¶
|
Helpfully plots data against a reference scanning dataset. |
|
Plots the spatial content of a dataset, useful as a quick reference. |
Curve Fitting Plots¶
|
Performs a straightforward plot of the data, residual, and fit to an axis. |
|
Plots several fits onto a grid of axes. |
|
Makes a simple scatter plot of a parameter from an broadcast_fit result. |
False Color Plots¶
|
Plots a spectrum in false color after conversion to R, G, B arrays. |
Plotting with Brillouin Zones¶
|
Dimension generic BZ plot which uses the cell dimension to delegate. |
|
A dimension agnostic tool used to plot ARPES data onto a Brillouin zone. |
|
A higher order function to plot a Brillouin zone over a plot. |
|
Plots a 2D cut plane onto a Brillouin zone. |
Plot Annotations¶
|
Annotates a cut location onto a plot. |
|
Annotates a point or high symmetry location into a plot. |
|
Renders information about the experimental conditions onto a set of axes. |