Reference/API
Baseline-determination
Please refer to the tutorial on baseline-determination for some examples.
baseline_dt |
Iterative method of baseline-determination based on the dual-tree complex wavelet transform. |
baseline_dwt |
Iterative method of baseline determination, based on the discrete wavelet transform. |
dtcwt |
1D Dual-tree complex wavelet transform [1]_ along an axis. |
idtcwt |
1D Inverse dual-tree complex wavelet transform [1]_ along an axis. |
available_dt_filters |
Iterable of available wavelet filters compatible with the dual-tree complex wavelet transform. |
available_first_stage_filters |
Iterable of available wavelet filters compatible with the first stage of dual-tree complex wavelent transform. |
Structure manipulation
Structure manipulation is done through the following classes:
Crystal |
The Crystal class is a set-like container that represent crystalline structures. |
Atom |
Container object for atomic data. |
Bases classes
The Lattice
class allows for manipulating lattice information separately from
atomic information.
Utilities
To help with fleshing out unit cell atoms from symmetry operators:
Parsers
Structure parsers are used to build Crystal
instances, mostly through Crystal
class methods.
CIFParser |
Collection of methods that parses CIF files based on cif2cell. |
CODParser |
Collection of methods that parses CIF files retrieved from the Crystallography Open Database. |
PDBParser |
Collection of methods that parses PDB files. |
Time-series Analysis
Time-series exploration and analysis.
Time-zero tracking
Measurement of time-shifts between physically-equivalent time traces:
register_time_shift |
Measure the time shift between a time trace and a reference trace by normalized cross correlation. |
register_time_shifts |
Measure the time shifts between time traces and a reference by cross-correlation. |
Robust statistics
mad |
Element-wise median absolute deviation (MAD) of a signal. |
Image Analysis
Combine the routines below with
npstreams to process diffraction data in parallel. Refer
to the tutorial on image manipulation
for some examples.
Symmetry
nfold |
Returns an images averaged according to n-fold rotational symmetry. |
reflection |
Symmetrize an image according to a reflection plane. |
Polycrystalline diffraction
azimuthal_average |
This function returns an azimuthally-averaged pattern computed from an image, e.g. |
powder_center |
Finds the center of a powder diffraction pattern by comparing the correlation between the input and its image. |
Calibrations
powder_calq |
Determine the scattering vector q corresponding to a polycrystalline diffraction pattern and a known crystal structure. |
Image alignment
align |
Align a diffraction image to a reference. |
ialign |
Generator of aligned diffraction images. |
diff_register |
Register translation of diffraction patterns by masked normalized cross-correlation. |
shift_image |
Shift an image. |
itrack_peak |
Generator function that tracks a diffraction peak in a stream of images. |
Correlations
xcorr |
Cross-correlation between two N-dimensional arrays. |
mnxc2 |
Masked normalized cross-correlation (MNXC) between two images or stacks of images. |
Image noise
snr_from_collection |
Signal-to-noise ratio (SNR) on a per-pixel basis, for images in a collection. |
isnr |
Streaming, pixelwise signal-to-noise ratio (SNR). |
triml |
Trim values in an array that fall below (i.e. |
trimr |
Trim values in an array that fall above (i.e. |
Simulation
structure_factor |
Computation of the static structure factor for electron diffraction. |
affe |
Atomic form factors for electrons, for neutral atoms. |
powdersim |
Simulates polycrystalline diffraction pattern. |
electrostatic |
Electrostatic potential from a crystal calculated on a real-space mesh, assuming an infinite crystal. |
pelectrostatic |
Projected electrostatic potential from a crystal calculated on a real-space mesh, assuming an infinite crystal in x and y. |
bounded_reflections |
Returns iterable of reflections (hkl) with norm(G) < nG |
Visualization
potential_map |
Compute the electrostatic potential from powder diffraction data. |
Plot Utilities
spectrum_colors |
Generates a set of RGB colors corresponding to the visible spectrum (i.e. |
rgb_sweep |
Generate a set of RGB colors as a linear sweep between two RGB colors source and dest. |
Array Utilities
mirror |
Reverse array over many axes. |
repeated_array |
Create a composite array from repeated copies of an array |
cart2polar |
Transform cartesian coordinates to polar coordinates. |
polar2cart |
Transform polar coordinates to cartesian coordinates. |
cart2spherical |
Transform cartesian coordinates into spherical coordinates . |
spherical2cart |
Transform spherical coordinates into cartesian coordinates. |
plane_mesh |
Generate a spatial mesh for a plane defined by two vectors. |
Electron Properties
electron_wavelength |
Relativistic wavelength \(\lambda\) of an accelerated electron. |
electron_velocity |
Relativistic velocity \(v_e\) of an accelerated electron. |
interaction_parameter |
Interaction parameter from relativistic electron wavelength. |
lorentz |
Relativistic factor \(\gamma\), defined as \(\gamma = \frac{1}{\sqrt{1 - v^2/c^2}}\) |
Thin Film Optical Properties
film_optical_coefficients |
Calculate the reflection, transmission, and absorption coefficients of a thin-film (possibly on a substrate). |