Skip to content

Commit

Permalink
bring in new base classes for sample description
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Sep 23, 2024
1 parent 1aebf8a commit 07d88ba
Show file tree
Hide file tree
Showing 6 changed files with 441 additions and 2 deletions.
74 changes: 74 additions & 0 deletions base_classes/NXhistory.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl"?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2014-2024 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" category="base" type="group" name="NXhistory" extends="NXobject" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<doc>
A set of activities that occurred to a physical entity prior/during experiment.

Ideally, a full report of the previous operations (or links to a chain of operations).
Alternatively, notes allow for additional descriptors in any format.
</doc>
<group type="NXactivity">
<doc>
Any activity that was performed on the physical entity prior or during the experiment. In
the future, if there is base class inheritance, this can describe any activity,
including processes and measurements.
</doc>
</group>
<!--For now, one workaround would be to have NXactivity as a application definition with a subentry.
subentry(NXsuxbentry):
doc: |
Any activity that was performed on the physical entity prior or during the experiment.
definition: ["NXactivity"]-->
<group type="NXphysical_process">
<doc>
Any physical process that was performed on the physical entity prior or during the
experiment.
</doc>
</group>
<group type="NXchemical_process">
<doc>
Any chemical process that was performed on the physical entity prior or during the
experiment.
</doc>
</group>
<group type="NXidentifier">
<doc>
An ID or reference to the location or a unique (globally
persistent) identifier of e.g. another file which gives
as many as possible details of the history event.
</doc>
</group>
<!--There should be more activities here, like measurement.-->
<group name="notes" type="NXnote">
<doc>
A descriptor to keep track of the treatment of the physical entity before or during the
experiment (NXnote allows to add pictures, audio, movies). Alternatively, a
reference to the location or a unique identifier or other metadata file. In the
case these are not available, free-text description.
This should only be used in case that there is no rigorous description
using the base classes above. This field can also be used to pull in any activities
that are not well described by an existing base class definition.
</doc>
</group>
</definition>
49 changes: 49 additions & 0 deletions base_classes/NXidentifier.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl"?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2014-2024 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" category="base" type="group" name="NXidentifier" extends="NXobject" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<doc>
An identifier for a (persistent) resource, e.g., a DOI or orcid.
</doc>
<field name="service" type="NX_CHAR">
<doc>
The service by which the resource can be resolved.

Examples: doi, urn, hdl, purl, orcid, iso, url
</doc>
</field>
<field name="identifier" type="NX_CHAR">
<doc>
The unique code, IRI or hash to resolve this reference.
Typically, this is stated by the service which is considered a complete
identifier, e.g., for a DOI it's something of the form `10.1107/S1600576714027575`
or `https://doi.org/10.1107/S1600576714027575`, which are both resolvable.
</doc>
</field>
<field name="is_persistent" type="NX_BOOLEAN">
<doc>
True if the identifier is persistent (i.e., unique and available indefinitely),
False otherwise.
</doc>
</field>
</definition>
51 changes: 49 additions & 2 deletions base_classes/NXsample_component.nxdl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@
</symbols>

<doc>
One group like this per component can be recorded For a sample consisting of multiple components.
One group like this per component can be recorded for a sample consisting of multiple components.
</doc>
<field name="name">
<doc>Descriptive name of sample component</doc>
</field>
<field name="sample_id">
<doc>
Identification number or signatures of the sample component used.
</doc>
</field>
<field name="chemical_formula">
<doc>
The chemical formula specified using CIF conventions.
Expand Down Expand Up @@ -139,6 +144,48 @@
<group name="transmission" type="NXdata">
<doc>As a function of Wavelength</doc>
</group>
<group type="NXsingle_crystal">
<doc>
If the component is a single crystal, add description of single crystal and unit
cell.
</doc>
</group>
<group type="NXsample_component_set">
<doc>
Set of sub-components and their configuration.
There can only be one NXsample_component_set in one component.
</doc>
</group>
<!--exists: [max, 1]-->
<group type="NXsubstance">
<doc>
If the component is made from a pure substance and cannot be further divided
using NXsample_component.
</doc>
</group>
<!--exists: [max, 1]-->
<group type="NXfabrication">
<doc>
Details about the sample component vendor (company or research group)
</doc>
</group>
<group name="identifier" type="NXidentifier">
<doc>
An (ideally) globally unique identifier for the sample component.
</doc>
</group>
<group name="history" type="NXhistory">
<doc>
A set of physical processes that occurred to the sample component prior/during
experiment.
</doc>
</group>
<field name="depends_on">
<doc>
Any NXsample_component depends on the instance of NXsample_component_set, at the same level of
description granularity where the component is located.
</doc>
</field>
<attribute name="default">
<doc>
.. index:: plotting
Expand All @@ -152,4 +199,4 @@
for a summary of the discussion.
</doc>
</attribute>
</definition>
</definition>
78 changes: 78 additions & 0 deletions base_classes/NXsample_component_set.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl"?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2014-2022 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" category="base" type="group" name="NXsample_component_set" extends="NXobject" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<symbols>
<symbol name="n_comp">
<doc>
number of components
</doc>
</symbol>
</symbols>
<doc>
Set of sample components and their configuration.

The idea here is to have a united place for all materials descriptors that are not
part of the individual sample components, but rather their configuration.
</doc>
<attribute name="components">
<doc>
Array of strings referring to the names of the NXsample_components.
The order of these components serves as an index (starting at 1).
</doc>
</attribute>
<field name="concentration" type="NX_FLOAT" units="NX_ANY">
<doc>
Concentration of each component
</doc>
<dimensions rank="1">
<dim index="1" value="n_comp"/>
</dimensions>
</field>
<field name="volume_fraction" type="NX_FLOAT" units="NX_ANY">
<doc>
Volume fraction of each component
</doc>
<dimensions rank="1">
<dim index="1" value="n_comp"/>
</dimensions>
</field>
<field name="scattering_length_density" type="NX_FLOAT" units="NX_ANY">
<doc>
Scattering length density of each component
</doc>
<dimensions rank="1">
<dim index="1" value="n_comp"/>
</dimensions>
</field>
<group type="NXsample_component">
<doc>
Each component set can contain multiple components.
</doc>
</group>
<group type="NXsample_component_set">
<doc>
For description of a sub-component set. Can contain multiple components itself.
</doc>
</group>
</definition>
72 changes: 72 additions & 0 deletions base_classes/NXsingle_crystal.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl"?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2014-2022 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" category="base" type="group" name="NXsingle_crystal" extends="NXobject" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<doc>
Description of a single crystal material or a single crystalline phase in a material.

There is the option of using Busing-Levy convention (as orginally designed in NXsample)
or using a more detailed description with NXrotation_set.
</doc>
<field name="sample_orientation" type="NX_FLOAT" units="NX_ANGLE">
<doc>
This will follow the Busing-Levy convention:
W. R. Busing and H. A. Levy (1967). Acta Cryst. 22, 457-464
</doc>
<dimensions rank="1">
<dim index="1" value="3"/>
</dimensions>
</field>
<field name="orientation_matrix" type="NX_FLOAT">
<doc>
Orientation matrix of single crystal sample using Busing-Levy convention:
W. R. Busing and H. A. Levy (1967). Acta Cryst. 22, 457-464
</doc>
<dimensions rank="2">
<dim index="1" value="3"/>
<dim index="2" value="3"/>
</dimensions>
</field>
<field name="ub_matrix" type="NX_FLOAT">
<doc>
UB matrix of single crystal sample using Busing-Levy convention:
W. R. Busing and H. A. Levy (1967). Acta Cryst. 22, 457-464. This is
the multiplication of the orientation_matrix, given above,
with the :math:`B` matrix which can be derived from the lattice constants.
</doc>
<dimensions rank="2">
<dim index="1" value="3"/>
<dim index="2" value="3"/>
</dimensions>
</field>
<group name="rotation_set" type="NXrotation_set">
<doc>
Detailed description of single crystal orientation and misorientation.
</doc>
</group>
<group type="NXunit_cell">
<doc>
Unit cell of the single crystal.
</doc>
</group>
</definition>
Loading

0 comments on commit 07d88ba

Please sign in to comment.