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
xrdMeasurementwithmeasurementTypeScanorRepeated scanand onescanchosen by index when there are several, whosescanAxisis2ThetaorGonio. Thestatusof the file, the measurement and the scan must all beCompleted;usedWavelength(kAlpha1,kAlpha2,kBeta,ratioKAlpha2KAlpha1and theintendedline). 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
positionsofaxis="2Theta"in degrees, asstartPosition/endPosition(constant steps: step = (end - start) / (points - 1)) orlistPositions;the data:
intensities(schema 1.x: already multiplied by the beam-attenuation factor) orcounts(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 (
commonCountingTimeorcountingTimes), the tube (anodeMaterial,tension,current), the scanmode, the header’ssourceandstartTimeStamp, and comment entries, kept as given.
Any document type declaration or entity declaration is refused before parsing, so the parse stays bounded.
Module Attributes
Published schema versions (XRDMeasurement*.xsd in the Data Collector download). |
|
The intended line -> the usedWavelength element that is the recorded wavelength. |
Functions
|
The 2theta points, intensities and file metadata of one XRDML scan. |
Exceptions
|
The XRDML file cannot be read faithfully; |
- 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:
ValueErrorThe XRDML file cannot be read faithfully;
codesays why.
- 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 codedXrdmlRefused.