vibe-sketcherDocumentation

Measured powder formats: an evaluation

This page is a plan, not a feature (#273). Measured patterns are read only from two-column XY or CSV with a stated axis (see Measured patterns). This page evaluates the six vendor and program formats that are refused today: XRDML, BRML, Bruker RAW, Rigaku RAS, Philips UDF and GSAS. For each one it asks:

  • whether the format is open or documented, and where;

  • whether a reader exists under a licence compatible with MPL-2.0;

  • what metadata the format carries;

  • what a fail-closed import would have to refuse.

No reader is adopted without the maintainer’s approval. The recommendations below are proposals. Each source was checked on 22 November 2026 and is listed at the end. Where only third-party code describes a format, this page says so. A future reader has to be written from a specification or from files the project owns, not from GPL or LGPL code.

Summary

Format

Open or documented

Compatible reader

Recommendation

PANalytical XRDML (.xrdml)

Yes: published XML schemas 1.0 to 2.4

None needed: write one from the schema

Implemented (#278), specification-based, fail-closed; see XRDML

GSAS powder data (.gsa, .gss, .fxye)

Yes: the GSAS manual (LAUR 86-748)

None needed: write one from the manual

Implemented (#279), constant-step CONS banks only; see GSAS

Rigaku RAS (.ras)

No public specification; ASCII with block markers

xrayutilities (GPL-2.0+) and GSAS-II (Argonne licence) only

Defer: ask Rigaku for the specification

Bruker BRML (.brml)

No: an undocumented ZIP of XML parts

GSAS-II (Argonne licence) only

Keep refusing; convert to XY with the instrument software

Bruker RAW v1–v4 (.raw)

Partly: v3 in a vendor manual; v4 not found

xylib (LGPL-2.1+) only

Keep refusing; convert to XY with the instrument software

Philips UDF (.udf)

No public specification; ASCII key–value lines

xylib (LGPL-2.1+) only

Keep refusing (a legacy format)

None of the existing readers is under a licence AGENTS.md lists as compatible (Apache-2.0, BSD, MIT, MPL). GPL is excluded outright. LGPL and the GSAS-II licence would each need the maintainer’s decision. The maintainer has already declined an LGPL dependency once (dispersion corrections, #243). The two formats worth implementing are the two with a public specification.

PANalytical XRDML

Documentation. XRDML is XML validated by a schema that Malvern Panalytical publishes. Versions 1.0 to 2.4 are in one download on the Data Collector product page. The page calls the format “fully open”. It also says that ownership and copyright of the schemas stay with Malvern Panalytical, and it gives no licence for the schema files themselves. Reading the schema to write a reader is therefore fine, but the XSD files should not be bundled without permission. Version 2.4 has the target namespace http://www.xrdml.com/XRDMeasurement/2.4. The format was introduced by T. Degen (NOBUGS 2002, arXiv:physics/0210067).

Readers. xylib (LGPL-2.1+) and xrayutilities (GPL-2.0+) read XRDML; neither can be adopted. A reader written from the schema needs only the Python standard library’s XML parser. Document type declarations and entities would have to be refused to keep the parse bounded.

Metadata (element names from the 2.4 schema):

  • the wavelengths: usedWavelength with kAlpha1, kAlpha2, kBeta, ratioKAlpha2KAlpha1 and the intended wavelength type;

  • the tube: xRayTube, anodeMaterial, tension, current;

  • incidentBeamPath and diffractedBeamPath;

  • sample;

  • each scan’s scanAxis, mode and status;

  • positions per axis, as startPosition/endPosition or listPositions;

  • commonCountingTime or countingTimes;

  • commonBeamAttenuationFactor or beamAttenuationFactors;

  • the data as counts (2.0 and later) or intensities (every version).

The schema states that counts are “not yet corrected for beam attenuator- or divergence factors”. With constant steps only the start and end positions are stored, and the step follows from the number of points.

A fail-closed import would refuse:

  • a file whose namespace is not one of the published versions;

  • a measurement or scan whose status is not Completed;

  • several scans, unless one is chosen by index;

  • a scan axis other than 2θ (2Theta or Gonio), such as rocking curves and reciprocal-space maps;

  • a missing usedWavelength, which the schema makes optional, when the axis is 2θ;

  • a positions count that does not match the data count;

  • per-point beam-attenuation or divergence factors that are not 1, unless applying them is a stated choice;

  • any DTD or entity declaration.

Every stated field would be kept as provenance, as XY imports keep theirs.

Recommendation: implement first. Approved and done in #278; see XRDML. It is the only vendor format with a published, versioned specification. It carries the wavelength and the counting time the overlay rules need. It is common on PANalytical and Malvern Panalytical instruments.

GSAS powder data

Documentation. The formats are described in the GSAS manual: A. C. Larson and R. B. Von Dreele, General Structure Analysis System (GSAS), Los Alamos National Laboratory Report LAUR 86-748. That report is public, and archived copies are available. A file has a title line, an optional instrument-parameter line, and one or more BANK records, each followed by its data. The BANK record gives the number of channels, the binning type with its coefficients, and the data layout (STD, ESD, ALT, FXY, FXYE). The binning type is CONS for constant steps. An earlier version of this page said CONST; the manual (pp. 217–220) spells it CONS. Other types include COND, CONQ, EDS, LOG6, LPSD, RALF, SLOG and TIME_MAP. For constant-wavelength data, the 2θ values and steps are in centidegrees. The manual also uses CONS for time-of-flight data, in microseconds, and energy-dispersive data, in keV, and the data file does not say which applies.

Readers. GSAS-II reads all of these, but its licence is not one of the listed ones. It is royalty-free and requires source with binaries, and distributing a derivative work grants the copyright holder permission to include the changes in GSAS-II. A reader written from the manual needs no dependency.

Metadata. Little beyond the data. The wavelength is not in the data file. It lives in the separate instrument-parameter file (.prm/.instprm), which the data file can only name.

A fail-closed import would refuse:

  • time-of-flight and energy-dispersive banks (TIME_MAP, EDS), whose axes are not 2θ;

  • binnings other than CONS, at first;

  • a bank whose channel count does not match its data;

  • a request with several banks and none chosen;

  • a 2θ overlay without a wavelength stated by the user, as for XY.

ESD columns would become the esd of the stored pattern.

Recommendation: implement second, for constant-wavelength CONS banks in STD, ESD, FXY and FXYE. Approved and done in #279; see GSAS. It is documented and plain text, and common in refinement workflows. Its lack of a wavelength is handled the way XY already handles it.

Rigaku RAS

Documentation. No public specification was found. The files are ASCII, written by Rigaku’s SmartLab Guidance software. Third-party readers describe the structure:

  • a *RAS_DATA_START line;

  • header lines between *RAS_HEADER_START and *RAS_HEADER_END, each a *KEY "value" pair;

  • data rows between *RAS_INT_START and *RAS_INT_END;

  • one header and data block per scan when a file holds several scans.

Header keys seen in readers include *MEAS_SCAN_AXIS_X_INTERNAL, *MEAS_SCAN_STEP, *MEAS_SCAN_SPEED, *MEAS_DATA_COUNT and *MEAS_SCAN_START_TIME. The data rows have three columns: the angle, the intensity and a third one. One reader names the third column att, and its meaning is not documented anywhere found. No wavelength key was confirmed from a source.

Readers. xrayutilities (GPL-2.0+) and GSAS-II (Argonne licence); neither can be adopted.

A fail-closed import would refuse a third column whose meaning is not stated, several scans with none chosen, and a 2θ overlay without a stated wavelength. Every header line would be kept as given.

Recommendation: defer. Ask Rigaku for the format description. Until then, a reader would rest on guessed column meanings. Users can convert to XY with the instrument software, as the current refusal says.

Bruker BRML

Documentation. None. BRML is a ZIP archive of XML parts. The scan lives in RawData*.xml entries, some of which hold set-up data rather than the scan. The open readers infer field meanings from example files. The GSAS-II reader uses ScanInformation (ScaleAxisInfo with Start, Stop and Increment; MeasurementPoints; TimePerStepEffective) and comma-separated Datum rows. Its comments note that the intensity sits “in column 4 most of the time” and in column 3 in at least one file. It does not read a wavelength. Users have reported files with several data sets that it cannot open.

Readers. GSAS-II only (Argonne licence).

A fail-closed import would have to refuse most real files. It cannot know which column holds the intensity or where the wavelength is without a specification.

Recommendation: keep refusing. Convert to XY with the instrument software, as the refusal already says. Reconsider if Bruker publishes a description.

Bruker RAW

Documentation. RAW is binary, in four versions identified by their first bytes: RAW (v1), RAW2 (v2), RAW1.01 (v3) and RAW4.00 (v4). According to the xylib source, version 3 follows the file-structure specification in Appendix A of the DIFFRAC^plus XCH V.5.0 User’s Manual (Bruker, 2002), which is a vendor manual. No public description of version 4 was found. The UK National Archives’ PRONOM registry lists versions 1 and 2 by their signatures only.

Readers. xylib (LGPL-2.1+) reads v1 to v4. According to its source, the header carries:

  • the wavelengths: K_ALPHA1 and K_ALPHA2 in v1, and ALPHA1, ALPHA2, ALPHA_RATIO and USED_LAMBDA in v3 and v4;

  • the start angles and step;

  • the time per step;

  • the anode material.

A fail-closed import would refuse v4 without a specification, and any block whose scan type is not a 2θ scan.

Recommendation: keep refusing. The current format has no public specification, and its one reader is LGPL. Convert to XY with the instrument software.

Philips UDF

Documentation. No public specification was found. UDF is an ASCII format from the Philips PC-APD era. A file starts with SampleIdent. Header lines are Key, value,/ pairs, for example ScanStepSize and DataAngleRange. RawScan starts the intensity values, which run to a final /. Beyond the start angle and the step, the keys that a reader would need were not confirmed from any source, the wavelength key among them.

Readers. xylib only (LGPL-2.1+).

A fail-closed import would refuse a file without a stated start angle and step, and a 2θ overlay without a stated wavelength.

Recommendation: keep refusing. It is a legacy format with no public specification and one LGPL reader. Convert to XY with the instrument software.

What approval would start

The proposals are, in order:

  1. a specification-based XRDML reader;

  2. a GSAS constant-wavelength reader, built the same way.

Each would come with its refusals above, provenance like the XY reader’s, SDK/CLI/REST/MCP routes and test files made by the project. Rigaku would be asked for the RAS description. BRML, RAW and UDF stay refused, with the export route in the message. No third-party reader or new dependency is proposed.

Sources

  • Malvern Panalytical, Data Collector product page, XRDML schema 2.4 and all previous versions (download; ownership and copyright statement).

  • T. Degen, “XrdML, a new way to store (and exchange) X-ray powder diffraction measurement data”, NOBUGS 2002, arXiv:physics/0210067.

  • A. C. Larson and R. B. Von Dreele, General Structure Analysis System (GSAS), Los Alamos National Laboratory Report LAUR 86-748.

  • GSAS-II licence (UChicago Argonne, LLC), the LICENSE file of the GSAS-II repository; GSAS-II importers G2pwd_fxye, G2pwd_BrukerBRML and G2pwd_rigaku (documentation pages).

  • xylib (M. Wojdyr et al.), repository README (format list; LGPL-2.1+) and the bruker_raw.cpp and philips_udf.cpp sources (format descriptions).

  • xrayutilities, xrayutilities.io.rigaku_ras and panalytical_xml module sources (GPL-2.0+).

  • The National Archives (UK), PRONOM entries fmt/1120 and fmt/1121 (DIFFRACplus raw data formats 1 and 2).

  • GSAS-II mailing list, “Bruker brml files” (2022) and “Bug in BRML file import” (2024).