ts_ids_components.xrd package#
Submodules#
Module contents#
This module contains components for X-ray diffraction (XRD) IDSs.
X-ray diffraction#
XRD instruments measure the diffraction pattern of a crystalline material by scanning a detector (or the sample) through a range of 2-theta angles while recording the diffracted X-ray intensity. Each crystalline form produces a distinct pattern determined by its crystal lattice, so XRD is commonly used to assess the solid form (e.g. polymorph, salt, hydrate) of an active pharmaceutical ingredient or formulation.
These components are shared across XRD instruments from different vendors (e.g. Bruker, Malvern Panalytical, Rigaku), which report the same underlying scan parameters and measurement geometry using different raw file formats and raw value conventions.
Method components#
The XrdScan component
(defined in ts_ids_components.xrd.method) holds the scan and optics
parameters common to an XRD measurement, including the 2-theta scan range,
step size, detector, and X-ray source settings. Its geometry field is a
XrdGeometry, bundling
the raw scan-mode value alongside its standardized
XrdGeometryMode
translation – see the “Vendor value normalization” note on
XrdGeometryMode for vendor-specific translation rules required before raw
values can be assigned to the fields below. Its measurement_status
field is a XrdMeasurementStatus, bundling the raw
lifecycle-state value alongside its standardized
XrdMeasurementStatusMode translation, using
the same raw/standardized shape as XrdGeometry.
System, sample, and run components#
XrdSystem (defined in
ts_ids_components.xrd.system) extends the generic
System component with the
fields common to XRD instruments: a human-readable system name and serial
number.
XrdRun (defined in
ts_ids_components.xrd.run) extends the generic
Run component with a standardized
measurement start/end timestamp.
XrdSample (defined in
ts_ids_components.xrd.sample) extends the generic
Sample component with no
additional fields.
Multiple measurements per file#
A single raw XRD file can contain more than one independent measurement –
e.g. a Rigaku .rasx file can hold several repeat measurements (each with
its own scan conditions and its own start/end timestamp), and the Malvern
Panalytical Empyrean format can hold multiple <scan> elements within one
<xrdMeasurement>. Because of this, XrdScan, XrdRun, XrdSystem,
and XrdSample each carry a pk
(UUIDPrimaryKey) so a
consuming IDS can declare them as top-level arrays (e.g. methods: List[XrdScan],
runs: List[XrdRun], systems: List[XrdSystem], samples: List[XrdSample],
following the platform-wide methods/runs/systems/samples
top-level naming convention) rather than a single object per file, and
datacubes can reference the specific system/sample involved via
fk_system/fk_sample rather than relying on a file-wide singleton.
Two-theta scan datacube components#
TwoThetaScanDatacube
(defined in ts_ids_components.xrd.datacube) holds one 2-Theta
Scan’s raw per-point data: every value recorded at each step, not just
intensity, with 2-theta itself as the datacube’s one dimension. See that
module’s docstring for the rationale behind this shape, and for why scan
modes where a different axis is the primary scan variable (rocking curves,
pole figures, reciprocal space maps) aren’t supported by this class.
Raw two-theta scan datacube preservation#
RawTwoThetaScanDatacube
(defined in ts_ids_components.xrd.datacube_raw) is an exact
structural replica of TwoThetaScanDatacube, built from string-preserving
RawXrdDimension/
RawXrdMeasure
elements instead of the parsed Dimension/XrdMeasure types, so the
exact original raw text and unit strings can always be recovered independent
of parser correctness. See that module’s docstring for the full rationale.
- Model Anode[source]#
Bases:
IdsElementX-ray tube anode (target) material and its characteristic emission wavelengths. The anode material fixes which wavelengths the tube radiates (e.g. a copper anode always radiates Cu K-alpha1/K-alpha2/K-beta), so these are grouped on one class rather than split across sibling fields on XraySource. Every vendor reports k_alpha1/k_alpha2/k_beta as explicit values (Bruker’s
WaveLengthAlpha1/WaveLengthAlpha2/WaveLengthBeta, Rigaku’sWavelengthKalpha1/WavelengthKalpha2/WavelengthKbeta, and Empyrean’susedWavelength/kAlpha1/kAlpha2/kBeta). Each uses RawValueRawUnit rather than a plain float so the parser always has somewhere to put the raw value/unit strings it read.k_alpha2_over_k_alpha1_ratio is reported less consistently: Bruker and Empyrean report it (
WaveLengthRatio,ratioKAlpha2KAlpha1), but Rigaku doesn’t report an equivalent value.Show JSON schema
{ "description": "X-ray tube anode (target) material and its characteristic emission\nwavelengths. The anode material fixes which wavelengths the tube radiates\n(e.g. a copper anode always radiates Cu K-alpha1/K-alpha2/K-beta), so\nthese are grouped on one class rather than split across sibling fields on\n`XraySource`. Every vendor reports `k_alpha1`/`k_alpha2`/`k_beta` as\nexplicit values (Bruker's\n``WaveLengthAlpha1``/``WaveLengthAlpha2``/``WaveLengthBeta``, Rigaku's\n``WavelengthKalpha1``/``WavelengthKalpha2``/``WavelengthKbeta``, and\nEmpyrean's ``usedWavelength/kAlpha1``/``kAlpha2``/``kBeta``). Each uses\n`RawValueRawUnit` rather than a plain float so the parser always has\nsomewhere to put the raw value/unit strings it read.\n\n`k_alpha2_over_k_alpha1_ratio` is reported less consistently: Bruker and\nEmpyrean report it (``WaveLengthRatio``, ``ratioKAlpha2KAlpha1``), but\nRigaku doesn't report an equivalent value.", "type": "object", "properties": { "material": { "description": "Anode (target) material of the X-ray tube, e.g. 'Cu' for copper.", "type": [ "string", "null" ] }, "k_alpha1": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-alpha1 emission line -- the stronger of the two K-alpha lines emitted by this anode material." }, "k_alpha2": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-alpha2 emission line -- the weaker of the two K-alpha lines emitted by this anode material." }, "k_alpha2_over_k_alpha1_ratio": { "$ref": "#/definitions/RawValueRawUnit", "description": "Relative intensity of the K-alpha2 line to the K-alpha1 line." }, "k_beta": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-beta emission line, less intense than K-alpha and used less often as the primary analysis line." } }, "additionalProperties": false, "definitions": { "RawValueRawUnit": { "additionalProperties": false, "description": "A `RawValueUnit` that also preserves the unit exactly as reported\nbefore normalization (e.g. Bruker/Empyrean's own `Unit`/`unit`\nattributes, Rigaku's sibling `<XUnit>` elements), independent of\nwhether the parser's normalization to `unit` was correct -- the same\nrationale that already justifies `raw_value` on `RawValueUnit` applies\nequally to units: a genuinely different raw string (e.g. Bruker's `\"\u00c5\"`\nvs. Empyrean's `\"Angstrom\"` for the same physical unit) can be\nmis-normalized or unexpected just as easily as a value can.\n\n`unit` is deliberately left as a plain nullable string, not a `Literal` --\nthe platform convention is that the task script, not the IDS schema,\ndecides what unit string gets written, so a future instrument or\nconfiguration reporting a different unit for the same physical quantity\ndoesn't require an IDS schema change. Do not subclass this to fix `unit`\nto a `Literal` -- that would reintroduce exactly the constraint this\ndesign avoids.", "properties": { "value": { "description": "A numerical value.", "type": [ "number", "null" ] }, "unit": { "description": "Unit for the numerical value.", "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed value from the primary data.", "type": [ "string", "null" ] }, "raw_unit": { "description": "The raw, untransformed unit string from the primary data.", "type": [ "string", "null" ] } }, "required": [ "value", "unit", "raw_value" ], "type": "object" } } }
- Validators:
- field k_alpha1: RawValueRawUnit#
Wavelength of the K-alpha1 emission line – the stronger of the two K-alpha lines emitted by this anode material.
- field k_alpha2: RawValueRawUnit#
Wavelength of the K-alpha2 emission line – the weaker of the two K-alpha lines emitted by this anode material.
- field k_alpha2_over_k_alpha1_ratio: RawValueRawUnit#
Relative intensity of the K-alpha2 line to the K-alpha1 line.
- field k_beta: RawValueRawUnit#
Wavelength of the K-beta emission line, less intense than K-alpha and used less often as the primary analysis line.
- Model Detector[source]#
Bases:
IdsElementX-ray detector used to measure diffracted intensity.
Show JSON schema
{ "description": "X-ray detector used to measure diffracted intensity.", "type": "object", "properties": { "name": { "description": "Name or model of the detector.", "type": [ "string", "null" ] } }, "additionalProperties": false }
- Validators:
- Model RawTwoThetaScanDatacube[source]#
Bases:
IdsElementAn exact structural replica of TwoThetaScanDatacube <ts_ids_components.xrd.datacube.TwoThetaScanDatacube> – the same one two_theta dimension plus per-vendor named measures – built from
RawXrdDimension/RawXrdMeasureinstead ofDimension/ XrdMeasure, so every scale/value entry is the exact original raw string (not a parsed float) and every unit is the exact original raw unit string (not the canonicalized unit name). See the module docstring above for why this exists. Linked to its source scan/run/system/sample by fk_method/fk_run/fk_system/fk_sample (rather than by matching list order with datacubes), and directly to its parsed counterpart by fk_datacube.Show JSON schema
{ "description": "An exact structural replica of `TwoThetaScanDatacube\n<ts_ids_components.xrd.datacube.TwoThetaScanDatacube>` -- the same one\n`two_theta` dimension plus per-vendor named measures -- built from\n:py:class:`RawXrdDimension`/:py:class:`RawXrdMeasure` instead of\n:py:class:`Dimension <ts_ids_core.schema.dimension.Dimension>`/\n`XrdMeasure`, so every `scale`/`value` entry is the exact original raw\nstring (not a parsed float) and every `unit` is the exact original raw\nunit string (not the canonicalized unit name). See the module docstring\nabove for why this exists. Linked to its source scan/run/system/sample\nby `fk_method`/`fk_run`/`fk_system`/`fk_sample` (rather than by matching\nlist order with `datacubes`), and directly to its parsed counterpart by\n`fk_datacube`.", "type": "object", "properties": { "fk_method": { "@foreign_key": "/properties/methods/items/properties/pk", "description": "Foreign key to the scan (in `methods`) this raw data was parsed from.", "type": "string" }, "fk_run": { "@foreign_key": "/properties/runs/items/properties/pk", "description": "Foreign key to the run (in `runs`) this raw data was parsed from.", "type": "string" }, "fk_system": { "@foreign_key": "/properties/systems/items/properties/pk", "description": "Foreign key to the system (in `systems`) this raw data was parsed from.", "type": "string" }, "fk_sample": { "@foreign_key": "/properties/samples/items/properties/pk", "description": "Foreign key to the sample (in `samples`) this raw data was measured on.", "type": "string" }, "fk_datacube": { "@foreign_key": "/properties/datacubes/items/properties/pk", "description": "Foreign key to the parsed datacube (in `datacubes`) this raw data was parsed from.", "type": "string" }, "name": { "type": "string" }, "description": { "type": [ "string", "null" ] }, "dimensions": { "items": { "$ref": "#/definitions/RawXrdDimension" }, "maxItems": 1, "minItems": 1, "type": "array" }, "measures": { "items": { "$ref": "#/definitions/RawXrdMeasure" }, "maxItems": 1, "minItems": 1, "type": "array" } }, "additionalProperties": false, "required": [ "fk_method", "fk_run", "fk_system", "fk_sample", "fk_datacube", "name", "dimensions", "measures" ], "definitions": { "RawXrdDimension": { "additionalProperties": false, "description": "A dimension of a :py:class:`RawTwoThetaScanDatacube`. Structurally identical to\n:py:class:`Dimension <ts_ids_core.schema.dimension.Dimension>` (name,\nunit, scale), except `scale` holds the exact original raw strings a\ndatacube's dimension was parsed from (not parsed floats), and `unit`\nholds the exact original raw unit string (not the canonicalized unit\nname used on `TwoThetaScanDatacube <ts_ids_components.xrd.datacube.TwoThetaScanDatacube>`'s\nown dimension).", "properties": { "name": { "description": "Name of the dimension, matching the corresponding `TwoThetaScanDatacube` dimension by name (e.g. 'two_theta').", "type": [ "string", "null" ] }, "unit": { "description": "Unit exactly as it appears in the raw file, unconverted.", "type": [ "string", "null" ] }, "scale": { "description": "Dimension scale values exactly as they appear in the raw file, unconverted.", "items": { "type": [ "string", "null" ] }, "type": "array" } }, "required": [ "name", "unit", "scale" ], "type": "object" }, "RawXrdMeasure": { "additionalProperties": false, "description": "A measure of a :py:class:`RawTwoThetaScanDatacube`. Structurally identical to\n:py:class:`XrdMeasure <ts_ids_components.xrd.datacube.XrdMeasure>` (name,\nunit, value), except `value` holds the exact original raw strings a\nmeasure was parsed from (not parsed floats), and `unit` holds the exact\noriginal raw unit string (not the canonicalized unit name used on\n`XrdMeasure`).", "properties": { "name": { "description": "Name of the measure, matching the corresponding `XrdMeasure` by name (e.g. 'intensity').", "type": [ "string", "null" ] }, "unit": { "description": "Unit exactly as it appears in the raw file, unconverted.", "type": [ "string", "null" ] }, "value": { "description": "Per-point measure values exactly as they appear in the raw file, unconverted.", "items": { "type": [ "string", "null" ] }, "type": "array" } }, "required": [ "name", "unit", "value" ], "type": "object" } } }
- Validators:
consistent_scale_and_value_lengths»all fieldstwo_theta_dimension_and_intensity_measure_present»all fields
- field dimensions: List[RawXrdDimension]#
- Constraints:
min_length = 1
max_length = 1
- field fk_datacube: str#
Foreign key to the parsed datacube (in datacubes) this raw data was parsed from.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_method: str#
Foreign key to the scan (in methods) this raw data was parsed from.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_run: str#
Foreign key to the run (in runs) this raw data was parsed from.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_sample: str#
Foreign key to the sample (in samples) this raw data was measured on.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_system: str#
Foreign key to the system (in systems) this raw data was parsed from.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field measures: List[RawXrdMeasure]#
- Constraints:
min_length = 1
max_length = 1
- validator consistent_scale_and_value_lengths » all fields[source]#
Mirrors ts_ids_core.schema.DataCube.consistent_number_of_dimensions, which RawTwoThetaScanDatacube doesn’t inherit (it isn’t a DataCube subclass, since its fields are string-typed rather than float-typed): every measure’s value must have as many entries as the dimension’s scale, so a raw parser bug producing a truncated or misaligned per-point array is caught at validation time rather than silently stored as valid IDS data.
- Validates:
all fields
- Model RawValueRawUnit[source]#
Bases:
RawValueUnitA RawValueUnit that also preserves the unit exactly as reported before normalization (e.g. Bruker/Empyrean’s own Unit/unit attributes, Rigaku’s sibling <XUnit> elements), independent of whether the parser’s normalization to unit was correct – the same rationale that already justifies raw_value on RawValueUnit applies equally to units: a genuinely different raw string (e.g. Bruker’s “Å” vs. Empyrean’s “Angstrom” for the same physical unit) can be mis-normalized or unexpected just as easily as a value can.
unit is deliberately left as a plain nullable string, not a Literal – the platform convention is that the task script, not the IDS schema, decides what unit string gets written, so a future instrument or configuration reporting a different unit for the same physical quantity doesn’t require an IDS schema change. Do not subclass this to fix unit to a Literal – that would reintroduce exactly the constraint this design avoids.
Show JSON schema
{ "description": "A `RawValueUnit` that also preserves the unit exactly as reported\nbefore normalization (e.g. Bruker/Empyrean's own `Unit`/`unit`\nattributes, Rigaku's sibling `<XUnit>` elements), independent of\nwhether the parser's normalization to `unit` was correct -- the same\nrationale that already justifies `raw_value` on `RawValueUnit` applies\nequally to units: a genuinely different raw string (e.g. Bruker's `\"\u00c5\"`\nvs. Empyrean's `\"Angstrom\"` for the same physical unit) can be\nmis-normalized or unexpected just as easily as a value can.\n\n`unit` is deliberately left as a plain nullable string, not a `Literal` --\nthe platform convention is that the task script, not the IDS schema,\ndecides what unit string gets written, so a future instrument or\nconfiguration reporting a different unit for the same physical quantity\ndoesn't require an IDS schema change. Do not subclass this to fix `unit`\nto a `Literal` -- that would reintroduce exactly the constraint this\ndesign avoids.", "type": "object", "properties": { "value": { "description": "A numerical value.", "type": [ "number", "null" ] }, "unit": { "description": "Unit for the numerical value.", "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed value from the primary data.", "type": [ "string", "null" ] }, "raw_unit": { "description": "The raw, untransformed unit string from the primary data.", "type": [ "string", "null" ] } }, "additionalProperties": false, "required": [ "value", "unit", "raw_value" ] }
- Validators:
- Model RawXrdDimension[source]#
Bases:
IdsElementA dimension of a
RawTwoThetaScanDatacube. Structurally identical toDimension(name, unit, scale), except scale holds the exact original raw strings a datacube’s dimension was parsed from (not parsed floats), and unit holds the exact original raw unit string (not the canonicalized unit name used on TwoThetaScanDatacube <ts_ids_components.xrd.datacube.TwoThetaScanDatacube>’s own dimension).Show JSON schema
{ "description": "A dimension of a :py:class:`RawTwoThetaScanDatacube`. Structurally identical to\n:py:class:`Dimension <ts_ids_core.schema.dimension.Dimension>` (name,\nunit, scale), except `scale` holds the exact original raw strings a\ndatacube's dimension was parsed from (not parsed floats), and `unit`\nholds the exact original raw unit string (not the canonicalized unit\nname used on `TwoThetaScanDatacube <ts_ids_components.xrd.datacube.TwoThetaScanDatacube>`'s\nown dimension).", "type": "object", "properties": { "name": { "description": "Name of the dimension, matching the corresponding `TwoThetaScanDatacube` dimension by name (e.g. 'two_theta').", "type": [ "string", "null" ] }, "unit": { "description": "Unit exactly as it appears in the raw file, unconverted.", "type": [ "string", "null" ] }, "scale": { "description": "Dimension scale values exactly as they appear in the raw file, unconverted.", "items": { "type": [ "string", "null" ] }, "type": "array" } }, "additionalProperties": false, "required": [ "name", "unit", "scale" ] }
- Validators:
- field name: str | None#
Name of the dimension, matching the corresponding TwoThetaScanDatacube dimension by name (e.g. ‘two_theta’).
- Model RawXrdMeasure[source]#
Bases:
IdsElementA measure of a
RawTwoThetaScanDatacube. Structurally identical toXrdMeasure(name, unit, value), except value holds the exact original raw strings a measure was parsed from (not parsed floats), and unit holds the exact original raw unit string (not the canonicalized unit name used on XrdMeasure).Show JSON schema
{ "description": "A measure of a :py:class:`RawTwoThetaScanDatacube`. Structurally identical to\n:py:class:`XrdMeasure <ts_ids_components.xrd.datacube.XrdMeasure>` (name,\nunit, value), except `value` holds the exact original raw strings a\nmeasure was parsed from (not parsed floats), and `unit` holds the exact\noriginal raw unit string (not the canonicalized unit name used on\n`XrdMeasure`).", "type": "object", "properties": { "name": { "description": "Name of the measure, matching the corresponding `XrdMeasure` by name (e.g. 'intensity').", "type": [ "string", "null" ] }, "unit": { "description": "Unit exactly as it appears in the raw file, unconverted.", "type": [ "string", "null" ] }, "value": { "description": "Per-point measure values exactly as they appear in the raw file, unconverted.", "items": { "type": [ "string", "null" ] }, "type": "array" } }, "additionalProperties": false, "required": [ "name", "unit", "value" ] }
- Validators:
- Model TwoThetaScanDatacube[source]#
Bases:
DataCubeBase for 2-Theta Scan datacubes. See the module docstring above for the raw file evidence behind this shape. Carries a pk so its raw counterpart (RawTwoThetaScanDatacube <ts_ids_components.xrd.datacube_raw.RawTwoThetaScanDatacube>) can link directly back to it – see
ts_ids_components.xrd.datacube_raw. Also carries four foreign keys, linking each datacube to the scan (in methods, seets_ids_components.xrd.method) via fk_method, the run (in runs, seets_ids_components.xrd.run) via fk_run, the system (in systems, seets_ids_components.xrd.system) via fk_system, and the sample (in samples, seets_ids_components.xrd.sample) via fk_sample.Show JSON schema
{ "description": "Base for 2-Theta Scan datacubes. See the module docstring above for the\nraw file evidence behind this shape. Carries a `pk` so its raw\ncounterpart (`RawTwoThetaScanDatacube\n<ts_ids_components.xrd.datacube_raw.RawTwoThetaScanDatacube>`) can link\ndirectly back to it -- see :py:mod:`ts_ids_components.xrd.datacube_raw`.\nAlso carries four foreign keys, linking each datacube to the scan (in\n`methods`, see :py:mod:`ts_ids_components.xrd.method`) via `fk_method`,\nthe run (in `runs`, see :py:mod:`ts_ids_components.xrd.run`) via\n`fk_run`, the system (in `systems`, see\n:py:mod:`ts_ids_components.xrd.system`) via `fk_system`, and the sample\n(in `samples`, see :py:mod:`ts_ids_components.xrd.sample`) via\n`fk_sample`.", "type": "object", "properties": { "name": { "type": "string" }, "measures": { "items": { "$ref": "#/definitions/XrdMeasure" }, "maxItems": 1, "minItems": 1, "type": "array" }, "dimensions": { "items": { "$ref": "#/definitions/Dimension" }, "maxItems": 1, "minItems": 1, "type": "array" }, "pk": { "@primary_key": true, "description": "Primary key for this datacube, referenced by the raw datacube (in `datacubes_raw`) preserving its untouched source text.", "type": "string" }, "fk_method": { "@foreign_key": "/properties/methods/items/properties/pk", "description": "Foreign key to the scan (in `methods`) that produced this datacube. A single raw file can contain multiple independent scans, e.g. repeat measurements sharing one autosampler batch submission.", "type": "string" }, "fk_run": { "@foreign_key": "/properties/runs/items/properties/pk", "description": "Foreign key to the run (in `runs`) that produced this datacube.", "type": "string" }, "fk_system": { "@foreign_key": "/properties/systems/items/properties/pk", "description": "Foreign key to the system (in `systems`) that produced this datacube.", "type": "string" }, "fk_sample": { "@foreign_key": "/properties/samples/items/properties/pk", "description": "Foreign key to the sample (in `samples`) this datacube was measured on.", "type": "string" }, "description": { "type": [ "string", "null" ] } }, "additionalProperties": false, "required": [ "name", "measures", "dimensions", "pk", "fk_method", "fk_run", "fk_system", "fk_sample" ], "definitions": { "Dimension": { "additionalProperties": false, "description": "A dimension of a DataCube", "properties": { "name": { "type": [ "string", "null" ] }, "unit": { "type": [ "string", "null" ] }, "scale": { "items": { "type": [ "number", "null" ] }, "type": "array" } }, "required": [ "name", "unit", "scale" ], "type": "object" }, "XrdMeasure": { "additionalProperties": false, "description": "A single named per-point quantity in a :py:class:`TwoThetaScanDatacube`\n(e.g. ``\"theta\"``, ``\"omega\"``, ``\"intensity\"``, ``\"weight\"``,\n``\"effective_time_per_step\"``), sharing the datacube's one\n:py:data:`TWO_THETA_SCAN_DIMENSION_NAME` dimension. See the module\ndocstring above for why any axis that covaries with 2-theta -- rather\nthan varying independently of it -- is modeled as a measure rather than\na second dimension.", "properties": { "name": { "type": [ "string", "null" ] }, "unit": { "type": [ "string", "null" ] }, "value": { "items": { "type": [ "number", "null" ] }, "type": "array" } }, "required": [ "name", "unit", "value" ], "type": "object" } } }
- Validators:
two_theta_dimension_and_intensity_measure_present»all fields
- field fk_method: str#
Foreign key to the scan (in methods) that produced this datacube. A single raw file can contain multiple independent scans, e.g. repeat measurements sharing one autosampler batch submission.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_run: str#
Foreign key to the run (in runs) that produced this datacube.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_sample: str#
Foreign key to the sample (in samples) this datacube was measured on.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field fk_system: str#
Foreign key to the system (in systems) that produced this datacube.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
ids_field_arg = primary_key
pk_reference_field = @foreign_key
- field measures: List[XrdMeasure]#
- Constraints:
min_length = 1
max_length = 1
- field pk: str#
Primary key for this datacube, referenced by the raw datacube (in datacubes_raw) preserving its untouched source text.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
- validator two_theta_dimension_and_intensity_measure_present » all fields[source]#
Every TwoThetaScanDatacube’s one dimension must be two_theta, and intensity must be present as a measure. This is the precise criterion for what this component supports: any 2-Theta Scan, i.e. any scan with 2-theta as its dimension and intensity as a measure, not specifically pharma powder XRD. See the module docstring above for the scan modes (rocking curves, pole figures, reciprocal space maps – primary dimension is omega, phi, or a reciprocal-space grid, not 2-theta) this intentionally doesn’t support.
- Validates:
all fields
- Model UsedWavelength[source]#
Bases:
_RawAndStandardizedValueWhich emission line a scan’s 2-theta axis is reduced against, and the corresponding numeric wavelength. Malvern Panalytical Empyrean reports this explicitly and specifically (
usedWavelength’sintendedattribute, e.g."K-Alpha 1"or"K-Alpha"for the weighted average); Rigaku also reports it explicitly but more coarsely (WaveType, e.g."Ka", which doesn’t distinguish K-alpha1 from the weighted average). Bruker’s raw files carry no equivalent field at all – only the anode’s physical emission-line constants (Anode), with nothing indicating which one a given scan’s reduction actually used; a Bruker task script should leave this unset rather than guess.wavelength is carried alongside value/raw_value rather than looked up on Anode, since the K-alpha-weighted case is not any single line stored there.
Show JSON schema
{ "description": "Which emission line a scan's 2-theta axis is reduced against, and the\ncorresponding numeric wavelength. Malvern Panalytical Empyrean reports\nthis explicitly and specifically (``usedWavelength``'s ``intended``\nattribute, e.g. ``\"K-Alpha 1\"`` or ``\"K-Alpha\"`` for the weighted\naverage); Rigaku also reports it explicitly but more coarsely\n(``WaveType``, e.g. ``\"Ka\"``, which doesn't distinguish K-alpha1 from the\nweighted average). Bruker's raw files carry no equivalent field at\nall -- only the anode's physical emission-line constants (`Anode`), with\nnothing indicating which one a given scan's reduction actually used; a\nBruker task script should leave this unset rather than guess.\n\n`wavelength` is carried alongside `value`/`raw_value` rather than looked\nup on `Anode`, since the K-alpha-weighted case is not any single line\nstored there.", "type": "object", "properties": { "value": { "description": "Standardized emission line, translated from `raw_value`.", "example_values": [ "k_alpha1", "k_alpha_weighted", "k_alpha2", "k_beta" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed used-wavelength indicator from the primary data.", "type": [ "string", "null" ] }, "wavelength": { "$ref": "#/definitions/RawValueRawUnit", "description": "Numeric wavelength corresponding to `value`, used for 2-theta-to-d-spacing conversion." } }, "additionalProperties": false, "required": [ "value", "raw_value" ], "definitions": { "RawValueRawUnit": { "additionalProperties": false, "description": "A `RawValueUnit` that also preserves the unit exactly as reported\nbefore normalization (e.g. Bruker/Empyrean's own `Unit`/`unit`\nattributes, Rigaku's sibling `<XUnit>` elements), independent of\nwhether the parser's normalization to `unit` was correct -- the same\nrationale that already justifies `raw_value` on `RawValueUnit` applies\nequally to units: a genuinely different raw string (e.g. Bruker's `\"\u00c5\"`\nvs. Empyrean's `\"Angstrom\"` for the same physical unit) can be\nmis-normalized or unexpected just as easily as a value can.\n\n`unit` is deliberately left as a plain nullable string, not a `Literal` --\nthe platform convention is that the task script, not the IDS schema,\ndecides what unit string gets written, so a future instrument or\nconfiguration reporting a different unit for the same physical quantity\ndoesn't require an IDS schema change. Do not subclass this to fix `unit`\nto a `Literal` -- that would reintroduce exactly the constraint this\ndesign avoids.", "properties": { "value": { "description": "A numerical value.", "type": [ "number", "null" ] }, "unit": { "description": "Unit for the numerical value.", "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed value from the primary data.", "type": [ "string", "null" ] }, "raw_unit": { "description": "The raw, untransformed unit string from the primary data.", "type": [ "string", "null" ] } }, "required": [ "value", "unit", "raw_value" ], "type": "object" } } }
- Validators:
- field raw_value: str | None#
The raw, untransformed used-wavelength indicator from the primary data.
- field wavelength: RawValueRawUnit#
Numeric wavelength corresponding to value, used for 2-theta-to-d-spacing conversion.
- Model XraySource[source]#
Bases:
IdsElementX-ray tube settings common across XRD vendors.
Show JSON schema
{ "description": "X-ray tube settings common across XRD vendors.", "type": "object", "properties": { "anode": { "$ref": "#/definitions/Anode", "description": "Anode (target) material and its characteristic emission wavelengths." }, "voltage": { "$ref": "#/definitions/RawValueRawUnit", "description": "Generator voltage applied to the X-ray tube." }, "current": { "$ref": "#/definitions/RawValueRawUnit", "description": "Generator current applied to the X-ray tube." }, "used_wavelength": { "$ref": "#/definitions/UsedWavelength", "description": "Which anode emission line this scan's 2-theta axis is reduced against. Not reported by every vendor -- see `UsedWavelength`." } }, "additionalProperties": false, "definitions": { "Anode": { "additionalProperties": false, "description": "X-ray tube anode (target) material and its characteristic emission\nwavelengths. The anode material fixes which wavelengths the tube radiates\n(e.g. a copper anode always radiates Cu K-alpha1/K-alpha2/K-beta), so\nthese are grouped on one class rather than split across sibling fields on\n`XraySource`. Every vendor reports `k_alpha1`/`k_alpha2`/`k_beta` as\nexplicit values (Bruker's\n``WaveLengthAlpha1``/``WaveLengthAlpha2``/``WaveLengthBeta``, Rigaku's\n``WavelengthKalpha1``/``WavelengthKalpha2``/``WavelengthKbeta``, and\nEmpyrean's ``usedWavelength/kAlpha1``/``kAlpha2``/``kBeta``). Each uses\n`RawValueRawUnit` rather than a plain float so the parser always has\nsomewhere to put the raw value/unit strings it read.\n\n`k_alpha2_over_k_alpha1_ratio` is reported less consistently: Bruker and\nEmpyrean report it (``WaveLengthRatio``, ``ratioKAlpha2KAlpha1``), but\nRigaku doesn't report an equivalent value.", "properties": { "material": { "description": "Anode (target) material of the X-ray tube, e.g. 'Cu' for copper.", "type": [ "string", "null" ] }, "k_alpha1": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-alpha1 emission line -- the stronger of the two K-alpha lines emitted by this anode material." }, "k_alpha2": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-alpha2 emission line -- the weaker of the two K-alpha lines emitted by this anode material." }, "k_alpha2_over_k_alpha1_ratio": { "$ref": "#/definitions/RawValueRawUnit", "description": "Relative intensity of the K-alpha2 line to the K-alpha1 line." }, "k_beta": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-beta emission line, less intense than K-alpha and used less often as the primary analysis line." } }, "type": "object" }, "RawValueRawUnit": { "additionalProperties": false, "description": "A `RawValueUnit` that also preserves the unit exactly as reported\nbefore normalization (e.g. Bruker/Empyrean's own `Unit`/`unit`\nattributes, Rigaku's sibling `<XUnit>` elements), independent of\nwhether the parser's normalization to `unit` was correct -- the same\nrationale that already justifies `raw_value` on `RawValueUnit` applies\nequally to units: a genuinely different raw string (e.g. Bruker's `\"\u00c5\"`\nvs. Empyrean's `\"Angstrom\"` for the same physical unit) can be\nmis-normalized or unexpected just as easily as a value can.\n\n`unit` is deliberately left as a plain nullable string, not a `Literal` --\nthe platform convention is that the task script, not the IDS schema,\ndecides what unit string gets written, so a future instrument or\nconfiguration reporting a different unit for the same physical quantity\ndoesn't require an IDS schema change. Do not subclass this to fix `unit`\nto a `Literal` -- that would reintroduce exactly the constraint this\ndesign avoids.", "properties": { "value": { "description": "A numerical value.", "type": [ "number", "null" ] }, "unit": { "description": "Unit for the numerical value.", "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed value from the primary data.", "type": [ "string", "null" ] }, "raw_unit": { "description": "The raw, untransformed unit string from the primary data.", "type": [ "string", "null" ] } }, "required": [ "value", "unit", "raw_value" ], "type": "object" }, "UsedWavelength": { "additionalProperties": false, "description": "Which emission line a scan's 2-theta axis is reduced against, and the\ncorresponding numeric wavelength. Malvern Panalytical Empyrean reports\nthis explicitly and specifically (``usedWavelength``'s ``intended``\nattribute, e.g. ``\"K-Alpha 1\"`` or ``\"K-Alpha\"`` for the weighted\naverage); Rigaku also reports it explicitly but more coarsely\n(``WaveType``, e.g. ``\"Ka\"``, which doesn't distinguish K-alpha1 from the\nweighted average). Bruker's raw files carry no equivalent field at\nall -- only the anode's physical emission-line constants (`Anode`), with\nnothing indicating which one a given scan's reduction actually used; a\nBruker task script should leave this unset rather than guess.\n\n`wavelength` is carried alongside `value`/`raw_value` rather than looked\nup on `Anode`, since the K-alpha-weighted case is not any single line\nstored there.", "properties": { "value": { "description": "Standardized emission line, translated from `raw_value`.", "example_values": [ "k_alpha1", "k_alpha_weighted", "k_alpha2", "k_beta" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed used-wavelength indicator from the primary data.", "type": [ "string", "null" ] }, "wavelength": { "$ref": "#/definitions/RawValueRawUnit", "description": "Numeric wavelength corresponding to `value`, used for 2-theta-to-d-spacing conversion." } }, "required": [ "value", "raw_value" ], "type": "object" } } }
- Validators:
- field current: RawValueRawUnit#
Generator current applied to the X-ray tube.
- field used_wavelength: UsedWavelength#
Which anode emission line this scan’s 2-theta axis is reduced against. Not reported by every vendor – see UsedWavelength.
- field voltage: RawValueRawUnit#
Generator voltage applied to the X-ray tube.
- class XrdEmissionLine(value)[source]#
-
Which of an anode’s characteristic emission lines (see Anode) a scan’s 2-theta axis is reduced against for angle-to-d-spacing conversion (Bragg’s law).
K_ALPHA_WEIGHTEDis the intensity-weighted average of the K-alpha1/K-alpha2 doublet, used when the two lines aren’t resolved separately (e.g. no monochromator isolating K-alpha1 alone).
- Model XrdGeometry[source]#
Bases:
_RawAndStandardizedValueScan mode/geometry for an XRD measurement. See
XrdGeometryModefor the per-vendor raw-file lookup and translation rules used to populate value from raw_value.Show JSON schema
{ "description": "Scan mode/geometry for an XRD measurement. See :py:class:`XrdGeometryMode`\nfor the per-vendor raw-file lookup and translation rules used to\npopulate `value` from `raw_value`.", "type": "object", "properties": { "value": { "description": "Standardized scan mode, translated from `raw_value`.", "example_values": [ "Coupled Reflection (Bragg-Brentano)", "Detector Scan (Uncoupled)", "Grazing Incidence (GIXRD)", "X-ray Reflectivity (XRR)", "Transmission (Capillary / Debye-Scherrer)", "Transmission (Flat-Sheet Coupled)", "Rocking Curve (\u03c9-Scan)", "Phi Scan (\u03d5-Scan)", "Psi Scan (\u03c8-Scan)", "Reciprocal Space Mapping (RSM)", "Grazing-Incidence Small-Angle X-ray Scattering (GISAXS)" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed scan mode/geometry value from the primary data.", "type": [ "string", "null" ] } }, "additionalProperties": false, "required": [ "value", "raw_value" ] }
- Validators:
- class XrdGeometryMode(value)[source]#
-
Standardized scan mode for an XRD measurement – a bare Reflection/Transmission/Capillary split isn’t specific enough, since e.g.
COUPLED_REFLECTIONandDETECTOR_SCANare both reflection-geometry measurements but are different scan modes with different physics (and different absorption-correction requirements).Vendor value normalization#
Each vendor reports scan mode using a different raw value, which must be translated to one of these values in the task script (not passed through verbatim):
COUPLED_REFLECTION:Bruker: the
DataRoute/ScanInformationelement’sScanName/VisibleNameattributes, e.g.ScanName="LockedCoupled",VisibleName="Coupled TwoTheta/Theta".Rigaku: the raw
AttachmentHeadelement’sSelectedUnitattribute, e.g."ASC10_Reflection".Malvern Panalytical: the
<scan>element’sscanAxisattribute, e.g.scanAxis="Gonio".
TRANSMISSION_CAPILLARY:Rigaku: the same
AttachmentHeadelement’sSelectedUnitattribute as above, e.g."Capillary".Malvern Panalytical: the
<scan>element’sscanAxisattribute, e.g.scanAxis="2Theta".
TRANSMISSION_FLAT_SHEET:Malvern Panalytical: the
<scan>element’sscanAxisattribute, e.g.scanAxis="2Theta-Omega".
The remaining modes (
DETECTOR_SCAN,GRAZING_INCIDENCE,X_RAY_REFLECTIVITY,ROCKING_CURVE,PHI_SCAN,PSI_SCAN,RECIPROCAL_SPACE_MAPPING,GISAXS) have no raw-field mapping documented here yet.Only
COUPLED_REFLECTION,DETECTOR_SCAN,GRAZING_INCIDENCE,X_RAY_REFLECTIVITY,TRANSMISSION_CAPILLARY, andTRANSMISSION_FLAT_SHEETvary 2-theta and are supported byTwoThetaScanDatacube; the remaining modes vary a different primary axis (omega, phi, psi, or a reciprocal-space grid) and have no datacube component defined here – seets_ids_components.xrd.datacubefor why.
- Model XrdMeasure[source]#
Bases:
MeasureBaseA single named per-point quantity in a
TwoThetaScanDatacube(e.g."theta","omega","intensity","weight","effective_time_per_step"), sharing the datacube’s oneTWO_THETA_SCAN_DIMENSION_NAMEdimension. See the module docstring above for why any axis that covaries with 2-theta – rather than varying independently of it – is modeled as a measure rather than a second dimension.Show JSON schema
{ "description": "A single named per-point quantity in a :py:class:`TwoThetaScanDatacube`\n(e.g. ``\"theta\"``, ``\"omega\"``, ``\"intensity\"``, ``\"weight\"``,\n``\"effective_time_per_step\"``), sharing the datacube's one\n:py:data:`TWO_THETA_SCAN_DIMENSION_NAME` dimension. See the module\ndocstring above for why any axis that covaries with 2-theta -- rather\nthan varying independently of it -- is modeled as a measure rather than\na second dimension.", "type": "object", "properties": { "name": { "type": [ "string", "null" ] }, "unit": { "type": [ "string", "null" ] }, "value": { "items": { "type": [ "number", "null" ] }, "type": "array" } }, "additionalProperties": false, "required": [ "name", "unit", "value" ] }
- Validators:
validate_value_shape»value
- Model XrdMeasurementStatus[source]#
Bases:
_RawAndStandardizedValueMeasurement lifecycle state for an XRD scan. Bruker’s raw
<MeasurementStatus>value"Measured"(fromRawData0.xml) normalizes toXrdMeasurementStatusMode.COMPLETED; Panalytical XRDML’s ownstatusattribute values pass straight through (lowercased) to the matching XrdMeasurementStatusMode member.Show JSON schema
{ "description": "Measurement lifecycle state for an XRD scan. Bruker's raw\n``<MeasurementStatus>`` value ``\"Measured\"`` (from ``RawData0.xml``)\nnormalizes to :py:attr:`XrdMeasurementStatusMode.COMPLETED`; Panalytical\nXRDML's own ``status`` attribute values pass straight through\n(lowercased) to the matching `XrdMeasurementStatusMode` member.", "type": "object", "properties": { "value": { "description": "Standardized measurement lifecycle state, translated from `raw_value`.", "example_values": [ "completed", "aborted", "not finished" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed measurement lifecycle state from the primary data.", "type": [ "string", "null" ] } }, "additionalProperties": false, "required": [ "value", "raw_value" ] }
- Validators:
- class XrdMeasurementStatusMode(value)[source]#
-
Standardized measurement lifecycle state, matching Malvern Panalytical XRDML’s own
statusTypeenumeration (confirmed againstXRDMeasurement21.xsd):"Completed"(“the data has been measured as indicated in the measurement program”),"Aborted"(“the operator aborted the measurement”), and"Not finished"(“the measurement was not completed”; also covers files left in an intermediate state by e.g. a power failure).
- Model XrdRun[source]#
Bases:
RunA single XRD measurement run, with a standardized start/end timestamp.
Show JSON schema
{ "description": "A single XRD measurement run, with a standardized start/end timestamp.", "type": "object", "properties": { "id": { "description": "Unique identifier assigned to a specific run (execution) of an experiment.", "type": [ "string", "null" ] }, "name": { "description": "Name assigned to a specific run (execution) of an experiment.", "type": [ "string", "null" ] }, "logs": { "description": "Log messages recorded during a specific run (execution) of an experiment.", "items": { "type": "string" }, "type": "array" }, "pk": { "@primary_key": true, "description": "Primary key for this run, referenced by datacubes belonging to it.", "type": "string" }, "time": { "$ref": "#/definitions/Time", "description": "Start and end timestamp of the measurement run." } }, "additionalProperties": false, "required": [ "pk" ], "definitions": { "RawTime": { "additionalProperties": false, "description": "The base model for capturing common time fields found in primary data.", "properties": { "start": { "description": "Process/experiment/task start time.", "type": [ "string", "null" ] }, "created": { "description": "Data created time.", "type": [ "string", "null" ] }, "stop": { "description": "Process/experiment/task stop/finish time.", "type": [ "string", "null" ] }, "duration": { "description": "Process/experiment/task duration.", "type": [ "string", "null" ] }, "last_updated": { "description": "Data last updated time of a file/method.", "type": [ "string", "null" ] }, "acquired": { "description": "Data acquired/exported/captured time.", "type": [ "string", "null" ] }, "modified": { "description": "Data last modified/edited time.", "type": [ "string", "null" ] }, "lookup": { "description": "Data lookup time.", "type": [ "string", "null" ] } }, "type": "object" }, "Time": { "additionalProperties": false, "description": "A model for datetime values converted to a standard ISO format and their\nrespective raw datetime values in the primary data.", "properties": { "start": { "description": "Process/experiment/task start time.", "type": [ "string", "null" ] }, "created": { "description": "Data created time.", "type": [ "string", "null" ] }, "stop": { "description": "Process/experiment/task stop/finish time.", "type": [ "string", "null" ] }, "duration": { "description": "Process/experiment/task duration.", "type": [ "string", "null" ] }, "last_updated": { "description": "Data last updated time of a file/method.", "type": [ "string", "null" ] }, "acquired": { "description": "Data acquired/exported/captured time.", "type": [ "string", "null" ] }, "modified": { "description": "Data last modified/edited time.", "type": [ "string", "null" ] }, "lookup": { "description": "Data lookup time.", "type": [ "string", "null" ] }, "raw": { "$ref": "#/definitions/RawTime", "description": "Raw time values from primary data." } }, "type": "object" } } }
- Validators:
- Model XrdSample[source]#
Bases:
SampleA sample measured by an XRD instrument.
Show JSON schema
{ "description": "A sample measured by an XRD instrument.", "type": "object", "properties": { "id": { "description": "Unique identifier assigned to a sample.", "type": [ "string", "null" ] }, "name": { "description": "Sample name.", "type": [ "string", "null" ] }, "barcode": { "description": "Barcode assigned to a sample.", "type": [ "string", "null" ] }, "batch": { "$ref": "#/definitions/Batch" }, "set": { "$ref": "#/definitions/Set", "description": "Sample set." }, "location": { "$ref": "#/definitions/Location", "description": "Sample location information." }, "compound": { "$ref": "#/definitions/Compound", "description": "Sample compound information." }, "properties": { "type": "array", "items": { "$ref": "#/definitions/Property" }, "description": "Sample properties." }, "labels": { "description": "Sample labels.", "items": { "$ref": "#/definitions/Label" }, "type": "array" }, "pk": { "@primary_key": true, "description": "Primary key for this sample, referenced by datacubes measured on it.", "type": "string" } }, "additionalProperties": false, "required": [ "pk" ], "definitions": { "Batch": { "additionalProperties": false, "description": "A Batch is the result of a single manufacturing run for a drug product that is made as specified groups or amounts, within a specific time frame from the same raw materials that is intended to have uniform character and quality, within specified limits.", "properties": { "id": { "description": "Unique identifier assigned to a batch.", "type": [ "string", "null" ] }, "name": { "description": "Batch name", "type": [ "string", "null" ] }, "barcode": { "description": "Barcode assigned to a batch", "type": [ "string", "null" ] } }, "type": "object" }, "Compound": { "additionalProperties": false, "description": "A Compound is a specific chemical or biochemical structure or substance that is being investigated. A Compound may be any drug substance, drug product intermediate, or drug product across small molecules, and cell and gene therapy (CGT).", "properties": { "id": { "description": "Unique identifier assigned to a compound.", "type": [ "string", "null" ] }, "name": { "description": "Compound name.", "type": [ "string", "null" ] } }, "type": "object" }, "Holder": { "additionalProperties": false, "description": "A sample container such as a microplate or a vial.", "properties": { "name": { "description": "Holder name.", "type": [ "string", "null" ] }, "type": { "description": "Holder type.", "type": [ "string", "null" ] }, "barcode": { "description": "Barcode assigned to a holder.", "type": [ "string", "null" ] } }, "type": "object" }, "Label": { "additionalProperties": false, "description": "A Label associated with a sample, along with metadata about the label including\nthe source of the label and times associated with the label such as when it was\ncreated or looked up.", "properties": { "source": { "$ref": "#/definitions/Source", "description": "Sample label data source information." }, "name": { "description": "Sample label name.", "type": "string" }, "value": { "description": "Sample label value.", "type": "string" }, "time": { "$ref": "#/definitions/SampleTime", "description": "Time associated with the sample label." } }, "required": [ "source", "name", "value", "time" ], "type": "object" }, "Location": { "additionalProperties": false, "description": "The Location of the sample within the holder, such as the location of a well in a microplate.", "properties": { "position": { "description": "Raw position string.", "type": [ "string", "null" ] }, "row": { "description": "Row index of sample location in a plate or holder.", "type": [ "number", "null" ] }, "column": { "description": "Column index of sample location in a plate or holder.", "type": [ "number", "null" ] }, "index": { "description": "Index of sample location flattened to a single dimension.", "type": [ "number", "null" ] }, "holder": { "$ref": "#/definitions/Holder", "description": "Sample holder information" } }, "type": "object" }, "Property": { "additionalProperties": false, "description": "A property has a name and a value of any type, with metadata about the\nproperty including the source of the property and times associated with it\nsuch as when the property was created or looked up.", "properties": { "source": { "$ref": "#/definitions/Source", "description": "Sample property data source information." }, "name": { "description": "Sample Property name.", "type": "string" }, "value": { "description": "The original string value of the property.", "type": "string" }, "value_data_type": { "$ref": "#/definitions/ValueDataType", "description": "This is the type of the original value." }, "string_value": { "description": "If string_value has a value, then numerical_value, numerical_value_unit, and boolean_value all have to be null.", "type": [ "string", "null" ] }, "numerical_value": { "description": "If numerical_value has a value, then string_value and boolean_value both have to be null.", "type": [ "number", "null" ] }, "numerical_value_unit": { "description": "Unit for the numerical value.", "type": [ "string", "null" ] }, "boolean_value": { "description": "If boolean_value has a value, then numerical_value, numerical_value_unit, and string_value all have to be null.", "type": [ "boolean", "null" ] }, "time": { "$ref": "#/definitions/SampleTime", "description": "Time associated with the sample property." } }, "required": [ "source", "name", "value", "value_data_type", "string_value", "numerical_value", "numerical_value_unit", "boolean_value", "time" ], "type": "object" }, "RawSampleTime": { "additionalProperties": false, "description": "The base model for time associated with a specific sample.", "properties": { "start": { "description": "Process/experiment/task start time.", "type": [ "string", "null" ] }, "created": { "description": "Data created time.", "type": [ "string", "null" ] }, "stop": { "description": "Process/experiment/task stop/finish time.", "type": [ "string", "null" ] }, "duration": { "description": "Process/experiment/task duration.", "type": [ "string", "null" ] }, "last_updated": { "description": "Data last updated time of a file/method.", "type": [ "string", "null" ] }, "acquired": { "description": "Data acquired/exported/captured time.", "type": [ "string", "null" ] }, "modified": { "description": "Data last modified/edited time.", "type": [ "string", "null" ] }, "lookup": { "description": "Raw sample data lookup time.", "type": [ "string", "null" ] } }, "required": [ "lookup" ], "type": "object" }, "SampleTime": { "additionalProperties": false, "description": "A model for experiment sample datetime values converted to a standard ISO format\nand their respective raw datetime values in the primary data.", "properties": { "start": { "description": "Process/experiment/task start time.", "type": [ "string", "null" ] }, "created": { "description": "Data created time.", "type": [ "string", "null" ] }, "stop": { "description": "Process/experiment/task stop/finish time.", "type": [ "string", "null" ] }, "duration": { "description": "Process/experiment/task duration.", "type": [ "string", "null" ] }, "last_updated": { "description": "Data last updated time of a file/method.", "type": [ "string", "null" ] }, "acquired": { "description": "Data acquired/exported/captured time.", "type": [ "string", "null" ] }, "modified": { "description": "Data last modified/edited time.", "type": [ "string", "null" ] }, "lookup": { "description": "Raw sample data lookup time.", "type": [ "string", "null" ] }, "raw": { "$ref": "#/definitions/RawSampleTime", "description": "Raw sample time values from primary data." } }, "required": [ "lookup" ], "type": "object" }, "Set": { "additionalProperties": false, "description": "A group of Samples.", "properties": { "id": { "description": "Unique identifier assigned to a set.", "type": [ "string", "null" ] }, "name": { "description": "Set name.", "type": [ "string", "null" ] } }, "type": "object" }, "Source": { "additionalProperties": false, "description": "The Source of information, such as a data file or a sample database.", "properties": { "name": { "description": "Source name.", "type": [ "string", "null" ] }, "type": { "description": "Source type.", "type": [ "string", "null" ] } }, "required": [ "name", "type" ], "type": "object" }, "ValueDataType": { "description": "Allowed data type values.", "enum": [ "string", "number", "boolean" ], "type": "string" } } }
- Validators:
- Model XrdScan[source]#
Bases:
IdsElementScan and optics parameters common to an XRD measurement, shared across vendors.
Show JSON schema
{ "description": "Scan and optics parameters common to an XRD measurement, shared across\nvendors.", "type": "object", "properties": { "pk": { "@primary_key": true, "description": "Primary key for this scan, referenced by datacubes produced by it.", "type": "string" }, "geometry": { "$ref": "#/definitions/XrdGeometry", "description": "Sample measurement geometry used for this scan." }, "measurement_status": { "$ref": "#/definitions/XrdMeasurementStatus", "description": "Lifecycle state of this scan's measurement." }, "two_theta_start": { "$ref": "#/definitions/RawValueRawUnit", "description": "Start of the 2-theta scan range." }, "two_theta_stop": { "$ref": "#/definitions/RawValueRawUnit", "description": "End of the 2-theta scan range." }, "step_size": { "$ref": "#/definitions/RawValueRawUnit", "description": "Angular increment between consecutive 2-theta scan points." }, "time_per_step": { "$ref": "#/definitions/RawValueRawUnit", "description": "Integration (counting) time at each scan step." }, "speed": { "$ref": "#/definitions/RawValueRawUnit", "description": "Scan speed, typically in degrees per minute. Only reported by some vendors; for others this is derivable from step_size and time_per_step. No QUDT unit for degrees-per-minute has been confirmed." }, "duration": { "$ref": "#/definitions/RawValueRawUnit", "description": "Total duration of the scan." }, "measurement_program": { "description": "Name or path of the instrument method/program file used to run this scan (e.g. Bruker's BsmlFileName, Rigaku's PackageName). Not reported as a discrete field by every vendor -- e.g. Empyrean only carries an equivalent value embedded in a free-text comment field -- so this should be left unset where no discrete field exists in the raw data.", "type": [ "string", "null" ] }, "detector": { "$ref": "#/definitions/Detector", "description": "Detector used for this scan." }, "x_ray_source": { "$ref": "#/definitions/XraySource", "description": "X-ray tube settings used for this scan." } }, "additionalProperties": false, "required": [ "pk" ], "definitions": { "Anode": { "additionalProperties": false, "description": "X-ray tube anode (target) material and its characteristic emission\nwavelengths. The anode material fixes which wavelengths the tube radiates\n(e.g. a copper anode always radiates Cu K-alpha1/K-alpha2/K-beta), so\nthese are grouped on one class rather than split across sibling fields on\n`XraySource`. Every vendor reports `k_alpha1`/`k_alpha2`/`k_beta` as\nexplicit values (Bruker's\n``WaveLengthAlpha1``/``WaveLengthAlpha2``/``WaveLengthBeta``, Rigaku's\n``WavelengthKalpha1``/``WavelengthKalpha2``/``WavelengthKbeta``, and\nEmpyrean's ``usedWavelength/kAlpha1``/``kAlpha2``/``kBeta``). Each uses\n`RawValueRawUnit` rather than a plain float so the parser always has\nsomewhere to put the raw value/unit strings it read.\n\n`k_alpha2_over_k_alpha1_ratio` is reported less consistently: Bruker and\nEmpyrean report it (``WaveLengthRatio``, ``ratioKAlpha2KAlpha1``), but\nRigaku doesn't report an equivalent value.", "properties": { "material": { "description": "Anode (target) material of the X-ray tube, e.g. 'Cu' for copper.", "type": [ "string", "null" ] }, "k_alpha1": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-alpha1 emission line -- the stronger of the two K-alpha lines emitted by this anode material." }, "k_alpha2": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-alpha2 emission line -- the weaker of the two K-alpha lines emitted by this anode material." }, "k_alpha2_over_k_alpha1_ratio": { "$ref": "#/definitions/RawValueRawUnit", "description": "Relative intensity of the K-alpha2 line to the K-alpha1 line." }, "k_beta": { "$ref": "#/definitions/RawValueRawUnit", "description": "Wavelength of the K-beta emission line, less intense than K-alpha and used less often as the primary analysis line." } }, "type": "object" }, "Detector": { "additionalProperties": false, "description": "X-ray detector used to measure diffracted intensity.", "properties": { "name": { "description": "Name or model of the detector.", "type": [ "string", "null" ] } }, "type": "object" }, "RawValueRawUnit": { "additionalProperties": false, "description": "A `RawValueUnit` that also preserves the unit exactly as reported\nbefore normalization (e.g. Bruker/Empyrean's own `Unit`/`unit`\nattributes, Rigaku's sibling `<XUnit>` elements), independent of\nwhether the parser's normalization to `unit` was correct -- the same\nrationale that already justifies `raw_value` on `RawValueUnit` applies\nequally to units: a genuinely different raw string (e.g. Bruker's `\"\u00c5\"`\nvs. Empyrean's `\"Angstrom\"` for the same physical unit) can be\nmis-normalized or unexpected just as easily as a value can.\n\n`unit` is deliberately left as a plain nullable string, not a `Literal` --\nthe platform convention is that the task script, not the IDS schema,\ndecides what unit string gets written, so a future instrument or\nconfiguration reporting a different unit for the same physical quantity\ndoesn't require an IDS schema change. Do not subclass this to fix `unit`\nto a `Literal` -- that would reintroduce exactly the constraint this\ndesign avoids.", "properties": { "value": { "description": "A numerical value.", "type": [ "number", "null" ] }, "unit": { "description": "Unit for the numerical value.", "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed value from the primary data.", "type": [ "string", "null" ] }, "raw_unit": { "description": "The raw, untransformed unit string from the primary data.", "type": [ "string", "null" ] } }, "required": [ "value", "unit", "raw_value" ], "type": "object" }, "UsedWavelength": { "additionalProperties": false, "description": "Which emission line a scan's 2-theta axis is reduced against, and the\ncorresponding numeric wavelength. Malvern Panalytical Empyrean reports\nthis explicitly and specifically (``usedWavelength``'s ``intended``\nattribute, e.g. ``\"K-Alpha 1\"`` or ``\"K-Alpha\"`` for the weighted\naverage); Rigaku also reports it explicitly but more coarsely\n(``WaveType``, e.g. ``\"Ka\"``, which doesn't distinguish K-alpha1 from the\nweighted average). Bruker's raw files carry no equivalent field at\nall -- only the anode's physical emission-line constants (`Anode`), with\nnothing indicating which one a given scan's reduction actually used; a\nBruker task script should leave this unset rather than guess.\n\n`wavelength` is carried alongside `value`/`raw_value` rather than looked\nup on `Anode`, since the K-alpha-weighted case is not any single line\nstored there.", "properties": { "value": { "description": "Standardized emission line, translated from `raw_value`.", "example_values": [ "k_alpha1", "k_alpha_weighted", "k_alpha2", "k_beta" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed used-wavelength indicator from the primary data.", "type": [ "string", "null" ] }, "wavelength": { "$ref": "#/definitions/RawValueRawUnit", "description": "Numeric wavelength corresponding to `value`, used for 2-theta-to-d-spacing conversion." } }, "required": [ "value", "raw_value" ], "type": "object" }, "XraySource": { "additionalProperties": false, "description": "X-ray tube settings common across XRD vendors.", "properties": { "anode": { "$ref": "#/definitions/Anode", "description": "Anode (target) material and its characteristic emission wavelengths." }, "voltage": { "$ref": "#/definitions/RawValueRawUnit", "description": "Generator voltage applied to the X-ray tube." }, "current": { "$ref": "#/definitions/RawValueRawUnit", "description": "Generator current applied to the X-ray tube." }, "used_wavelength": { "$ref": "#/definitions/UsedWavelength", "description": "Which anode emission line this scan's 2-theta axis is reduced against. Not reported by every vendor -- see `UsedWavelength`." } }, "type": "object" }, "XrdGeometry": { "additionalProperties": false, "description": "Scan mode/geometry for an XRD measurement. See :py:class:`XrdGeometryMode`\nfor the per-vendor raw-file lookup and translation rules used to\npopulate `value` from `raw_value`.", "properties": { "value": { "description": "Standardized scan mode, translated from `raw_value`.", "example_values": [ "Coupled Reflection (Bragg-Brentano)", "Detector Scan (Uncoupled)", "Grazing Incidence (GIXRD)", "X-ray Reflectivity (XRR)", "Transmission (Capillary / Debye-Scherrer)", "Transmission (Flat-Sheet Coupled)", "Rocking Curve (\u03c9-Scan)", "Phi Scan (\u03d5-Scan)", "Psi Scan (\u03c8-Scan)", "Reciprocal Space Mapping (RSM)", "Grazing-Incidence Small-Angle X-ray Scattering (GISAXS)" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed scan mode/geometry value from the primary data.", "type": [ "string", "null" ] } }, "required": [ "value", "raw_value" ], "type": "object" }, "XrdMeasurementStatus": { "additionalProperties": false, "description": "Measurement lifecycle state for an XRD scan. Bruker's raw\n``<MeasurementStatus>`` value ``\"Measured\"`` (from ``RawData0.xml``)\nnormalizes to :py:attr:`XrdMeasurementStatusMode.COMPLETED`; Panalytical\nXRDML's own ``status`` attribute values pass straight through\n(lowercased) to the matching `XrdMeasurementStatusMode` member.", "properties": { "value": { "description": "Standardized measurement lifecycle state, translated from `raw_value`.", "example_values": [ "completed", "aborted", "not finished" ], "type": [ "string", "null" ] }, "raw_value": { "description": "The raw, untransformed measurement lifecycle state from the primary data.", "type": [ "string", "null" ] } }, "required": [ "value", "raw_value" ], "type": "object" } } }
- Validators:
- field duration: RawValueRawUnit#
Total duration of the scan.
- field geometry: XrdGeometry#
Sample measurement geometry used for this scan.
- field measurement_program: str | None#
Name or path of the instrument method/program file used to run this scan (e.g. Bruker’s BsmlFileName, Rigaku’s PackageName). Not reported as a discrete field by every vendor – e.g. Empyrean only carries an equivalent value embedded in a free-text comment field – so this should be left unset where no discrete field exists in the raw data.
- field measurement_status: XrdMeasurementStatus#
Lifecycle state of this scan’s measurement.
- field pk: str#
Primary key for this scan, referenced by datacubes produced by it.
- Constraints:
func = <function validate_uuid at 0x7f1493ac61f0>
json_schema_input_type = PydanticUndefined
- field speed: RawValueRawUnit#
Scan speed, typically in degrees per minute. Only reported by some vendors; for others this is derivable from step_size and time_per_step. No QUDT unit for degrees-per-minute has been confirmed.
- field step_size: RawValueRawUnit#
Angular increment between consecutive 2-theta scan points.
- field time_per_step: RawValueRawUnit#
Integration (counting) time at each scan step.
- field two_theta_start: RawValueRawUnit#
Start of the 2-theta scan range.
- field two_theta_stop: RawValueRawUnit#
End of the 2-theta scan range.
- field x_ray_source: XraySource#
X-ray tube settings used for this scan.
- Model XrdSystem[source]#
Bases:
System,Name,SerialNumberInstrument system information common to all XRD vendors.
Show JSON schema
{ "description": "Instrument system information common to all XRD vendors.", "type": "object", "properties": { "serial_number": { "description": "System serial number. Indicates a unique instrument identifier within the same model line from a specific vendor. This is provided by the system vendor, unlike an ID or name which are usually created by the system owner or user.", "type": [ "string", "null" ] }, "name": { "description": "Name for the system. This is usually a human-readable name defined by the system owner or user. It may be changed over time as the system is used for different purposes, unlike the ID which typically doesn't change.", "type": [ "string", "null" ] }, "vendor": { "description": "The instrument vendor or manufacturer, like 'PerkinElmer' or 'Agilent'.", "type": [ "string", "null" ] }, "model": { "description": "A specific model instrument type from a vendor.", "type": [ "string", "null" ] }, "type": { "description": "Indicates the type of instrument that's generating data.", "type": [ "string", "null" ] }, "pk": { "@primary_key": true, "description": "Primary key for this system, referenced by datacubes belonging to it.", "type": "string" } }, "additionalProperties": false, "required": [ "vendor", "model", "type", "pk" ] }
- Validators: