vibesketcher.render.diffraction¶
Publication figures of powder patterns: measured against calculated (#207).
The figure is drawn from the calculated result of
vibesketcher.document.diffraction and, optionally, a measured pattern
read by vibesketcher.document.measured_patterns: the measured curve,
the calculated profile (or sticks when no profile was asked for), a row of
reflection tick marks under the curves, and provenance lines naming both
sources by their SHA-256 digests, the wavelengths and the instrument fields
as given. The calculated curve is scaled to the measured maximum for
display; the factor is printed and nothing is fitted.
The x axis is 2theta (degrees), d (angstrom) or Q = 2 pi / d (1/angstrom). A measured 2theta axis is compared in 2theta only at the calculated wavelength, and converted to d or Q only with its stated wavelength; other combinations are refused rather than shifted. Styling follows the periodic figures: white background, Arial/Helvetica, SVG with PDF/PNG through the publication extra.
Functions
|
SVG, or PDF/PNG through the publication extra. |
|
The overlay as standalone SVG (UTF-8). |
Classes
|
What the overlay shows; every choice is stated. |
Exceptions
The two patterns cannot be put on one axis faithfully. |
- class vibesketcher.render.diffraction.OverlayOptions(*, axis='two_theta_deg', x_range=None, ticks=True, label_reflections=0, width=640, height=400, title=None, provenance=True)[source]¶
Bases:
BaseModelWhat the overlay shows; every choice is stated.
- Parameters:
- model_config = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- axis: PlotAxis¶
- exception vibesketcher.render.diffraction.OverlayRefused[source]¶
Bases:
ValueErrorThe two patterns cannot be put on one axis faithfully.
- vibesketcher.render.diffraction.overlay_svg(calculated, measured=None, options=None)[source]¶
The overlay as standalone SVG (UTF-8).