EMSA/MAS MSA (ISO 22029)¶
Status: Supported (scoped) · Vendor: EMSA / MAS / ISO · Extensions:
.msa
EMSA/MAS .msa is the single-spectrum ASCII interchange format from the
Microscopy Society of America / European Microbeam Analysis Society, standardised
as ISO 22029. It is used mainly for EDS/EELS microanalysis spectra, where the X
axis is typically energy in eV. nirs4all-formats reads it as an adjacent, narrow
text format so these files can be probed and disambiguated.
Instruments & software¶
Written by electron-microscopy and microanalysis software (EDS / EELS / WDS
acquisition packages) following the EMSA/MAS specification and ISO 22029:2022.
Committed fixtures include ISO 22029:2022 compliance examples and the classic
EMSA example1/example2 spectra.
File structure¶
Plain ASCII with two parts:
Header — label/value records each beginning with a single
#, e.g.#FORMAT,#TITLE,#NPOINTS,#XUNITS,#YUNITS,#XPERCHAN,#OFFSET,#CHOFFSET,#DATATYPE. Repeated keys (including multi-line#TITLEand#COMMENT) are kept. The data section begins after#SPECTRUMand ends at#ENDOFDATA.Data — either
#DATATYPE: XYexplicit X/Y pairs, or#DATATYPE: Yordinate-only arrays. Numeric payloads may be comma-, semicolon-, tab- or whitespace-separated, including scientific notation.
The reader sniffs files with an .msa extension or an EMSA/MAS marker that also
contain #FORMAT.
What nirs4all-formats extracts¶
Signal — one
SpectralRecordwith a single signal named from#YLABEL(defaultsignal). Signal type is inferred from the Y label/units; anintensitylabel with no recognised optical type maps toRawCounts, otherwiseUnknown.Axis — for
XYdata the X column is the axis; forYdata the axis is reconstructed asOFFSET + (index + CHOFFSET) * XPERCHAN. The kind/unit follow#XUNITS: energyeV, wavenumbercm-1, wavelengthnm, elseindex.Metadata — the full header (with repeated keys preserved) is stored under
metadata.emsa_mas.Provenance & warnings — source file + SHA-256, reader name/version; a
#NPOINTSconsistency check truncates extra values with a provenance warning.
Variants & support status¶
Variant |
Status |
Notes |
|---|---|---|
|
Supported |
Explicit energy/value pairs. |
|
Supported |
Axis from |
Scientific-notation payloads |
Supported |
Parsed in either data type. |
Multi-line |
Supported |
Repeated header keys preserved. |
Invalid date/time, empty fields |
Supported (preserved) |
Kept verbatim for reference comparison; not yet validated. |
Limitations & known gaps¶
Date/time and other ISO 22029 metadata fields are not yet validated; invalid metadata is preserved rather than flagged. Stricter validation would be emitted as warnings, not hard failures.
EDS/EELS signal families are currently typed as
RawCounts/Unknown; whether they deserve dedicatedSignalTypevariants is undecided.Only single-spectrum
.msafiles are handled (the format itself is single-spectrum).
Reference readers¶
rsciio.msa from the HyperSpy / RosettaSciIO stack is the reference loader.
Full-array conformance reports against it are still to be added.
Samples & validation¶
Fixtures live under samples/ and are covered by golden summaries in
crates/nirs4all-formats/tests/goldens/; the probe reports format emsa-mas-msa at
Confidence::Definite. Committed control values:
File |
Data type |
Points |
Axis |
Value control |
|---|---|---|---|---|
|
|
21 |
energy |
|
|
|
21 |
energy |
|
|
|
21 |
scientific notation |
golden summary |
|
|
21 |
multi-line title metadata |
golden summary |
|
examples |
variable |
metadata/date variants |
golden summaries |
|
|
20 |
invalid date/empty fields preserved; extra payload row truncated with warning |
golden summaries |
|
|
80 |
energy |
|
|
minimal |
1 |
|
|