vibe-sketcherDocumentation

vibesketcher.document.measured_xrdml

PANalytical / Malvern Panalytical XRDML measured patterns, read fail-closed (#278).

Written from the published XML schemas, XRDMeasurement 1.0 to 2.4 (Malvern Panalytical, Data Collector download; T. Degen, NOBUGS 2002, arXiv:physics/0210067). No third-party reader is used and the schema files are not bundled. The evaluation and the maintainer’s approval are in docs/powder_formats.md and #273.

What is read, with the element names of the schema:

  • the namespace http://www.xrdml.com/XRDMeasurement/<version>, which must be a published version;

  • one xrdMeasurement with measurementType Scan or Repeated scan and one scan chosen by index when there are several, whose scanAxis is 2Theta or Gonio. The status of the file, the measurement and the scan must all be Completed;

  • usedWavelength (kAlpha1, kAlpha2, kBeta, ratioKAlpha2KAlpha1 and the intended line). The schema makes it optional; a 2theta pattern without it is refused. The intended line (K-Alpha 1, K-Alpha 2, K-Beta, or K-Alpha for the unresolved doublet, recorded at Kalpha1) gives the recorded wavelength;

  • the positions of axis="2Theta" in degrees, as startPosition/endPosition (constant steps: step = (end - start) / (points - 1)) or listPositions;

  • the data: intensities (schema 1.x: already multiplied by the beam-attenuation factor) or counts (2.0 onward: “not yet corrected for beam attenuator- or divergence factors”). Counts are read only when every attenuation factor and divergence correction is 1, or absent; otherwise the file is refused rather than corrected by a guess;

  • the counting time (commonCountingTime or countingTimes), the tube (anodeMaterial, tension, current), the scan mode, the header’s source and startTimeStamp, and comment entries, kept as given.

Any document type declaration or entity declaration is refused before parsing, so the parse stays bounded.

Module Attributes

VERSIONS

Published schema versions (XRDMeasurement*.xsd in the Data Collector download).

INTENDED

The intended line -> the usedWavelength element that is the recorded wavelength.

Functions

read_xrdml(data, name[, scan])

The 2theta points, intensities and file metadata of one XRDML scan.

Exceptions

XrdmlRefused(message[, code])

The XRDML file cannot be read faithfully; code says why.

vibesketcher.document.measured_xrdml.VERSIONS = ('1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '2.0', '2.1', '2.2', '2.3', '2.4')

Published schema versions (XRDMeasurement*.xsd in the Data Collector download).

vibesketcher.document.measured_xrdml.INTENDED = {'K-Alpha': 'kAlpha1', 'K-Alpha 1': 'kAlpha1', 'K-Alpha 2': 'kAlpha2', 'K-Beta': 'kBeta'}

The intended line -> the usedWavelength element that is the recorded wavelength.

exception vibesketcher.document.measured_xrdml.XrdmlRefused(message, code='diffraction.xrdml_refused')[source]

Bases: ValueError

The XRDML file cannot be read faithfully; code says why.

Parameters:
Return type:

None

vibesketcher.document.measured_xrdml.read_xrdml(data, name, scan=None)[source]

The 2theta points, intensities and file metadata of one XRDML scan.

Returns {"x", "intensity", "wavelength_angstrom", "metadata", "header", "intensity_unit"}; refuses with a coded XrdmlRefused.

Parameters:
Return type:

dict[str, Any]