Skip to content

Commit

Permalink
format base classes and applications in accordance to existing NIAC v…
Browse files Browse the repository at this point in the history
…ersion

# Conflicts:
#	applications/NXarpes.nxdl.xml
#	applications/nyaml/NXarpes.yaml
#	base_classes/NXaperture.nxdl.xml
#	base_classes/NXbeam.nxdl.xml
#	base_classes/NXdata.nxdl.xml
#	base_classes/NXdetector.nxdl.xml
#	base_classes/NXentry.nxdl.xml
#	base_classes/NXenvironment.nxdl.xml
#	base_classes/NXinstrument.nxdl.xml
#	base_classes/NXroot.nxdl.xml
#	base_classes/NXsample.nxdl.xml
#	base_classes/NXsample_component.nxdl.xml
#	base_classes/NXsensor.nxdl.xml
#	base_classes/NXsource.nxdl.xml
#	base_classes/NXsubentry.nxdl.xml
#	base_classes/NXtransformations.nxdl.xml
#	base_classes/NXuser.nxdl.xml
#	base_classes/nyaml/NXaperture.yaml
#	base_classes/nyaml/NXbeam.yaml
#	base_classes/nyaml/NXdata.yaml
#	base_classes/nyaml/NXdetector.yaml
#	base_classes/nyaml/NXentry.yaml
#	base_classes/nyaml/NXenvironment.yaml
#	base_classes/nyaml/NXinstrument.yaml
#	base_classes/nyaml/NXmonochromator.yaml
#	base_classes/nyaml/NXprocess.yaml
#	base_classes/nyaml/NXroot.yaml
#	base_classes/nyaml/NXsample.yaml
#	base_classes/nyaml/NXsample_component.yaml
#	base_classes/nyaml/NXsensor.yaml
#	base_classes/nyaml/NXsource.yaml
#	base_classes/nyaml/NXsubentry.yaml
#	base_classes/nyaml/NXtransformations.yaml
#	base_classes/nyaml/NXuser.yaml
  • Loading branch information
lukaspie committed Sep 23, 2024
1 parent ef91d55 commit 0ec6a68
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 92 deletions.
21 changes: 2 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ test ::

clean ::
$(RM) -rf $(BUILD_DIR)
$(RM) -rf $(BASE_CLASS_DIR)/$(NYAML_SUBDIR)
$(RM) -rf $(APPDEF_DIR)/$(NYAML_SUBDIR)
$(RM) -rf $(CONTRIB_DIR)/$(NYAML_SUBDIR)

prepare ::
$(PYTHON) -m dev_tools manual --prepare --build-root $(BUILD_DIR)
Expand Down Expand Up @@ -97,24 +94,10 @@ all ::
@echo "HTML built: `ls -lAFgh $(BUILD_DIR)/manual/build/html/index.html`"
@echo "PDF built: `ls -lAFgh $(BUILD_DIR)/manual/build/latex/nexus.pdf`"

$(BASE_CLASS_DIR)/%.nxdl.xml : $(BASE_CLASS_DIR)/$(NYAML_SUBDIR)/%.yaml
nyaml2nxdl $< --output-file $@

$(CONTRIB_DIR)/%.nxdl.xml : $(CONTRIB_DIR)/$(NYAML_SUBDIR)/%.yaml
nyaml2nxdl $< --output-file $@

$(APPDEF_DIR)/%.nxdl.xml : $(APPDEF_DIR)/$(NYAML_SUBDIR)/%.yaml
nyaml2nxdl $< --output-file $@

nxdl: $(YBC_NXDL_TARGETS) $(YCONTRIB_NXDL_TARGETS) $(YAPPDEF_NXDL_TARGETS)

nyaml:
$(MAKE) -f nyaml.mk


# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2008-2024 NeXus International Advisory Committee (NIAC)
# Copyright (C) 2008-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
Expand All @@ -130,4 +113,4 @@ nyaml:
# 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
# For further information, see http://www.nexusformat.org
133 changes: 60 additions & 73 deletions base_classes/NXmonochromator.nxdl.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl"?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl" ?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
Expand All @@ -21,49 +21,44 @@
#
# 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="NXmonochromator" extends="NXobject" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" category="base"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
name="NXmonochromator"
type="group" extends="NXobject">
<doc>
A wavelength defining device.

This is a base class for everything which
selects a wavelength or energy, be it a
monochromator crystal, a velocity selector,
an undulator or whatever.

The expected units are:

* wavelength: angstrom
* energy: eV
A wavelength defining device.

This is a base class for everything which
selects a wavelength or energy, be it a
monochromator crystal, a velocity selector,
an undulator or whatever.

The expected units are:

* wavelength: angstrom
* energy: eV

</doc>
<field name="wavelength" type="NX_FLOAT" units="NX_WAVELENGTH">
<doc>
wavelength selected
</doc>
</field>
<field name="wavelength_error" type="NX_FLOAT" units="NX_WAVELENGTH" deprecated="see https://github.com/nexusformat/definitions/issues/820">
<doc>
wavelength standard deviation
</doc>
<doc>wavelength selected</doc>
</field>
<field name="wavelength_error" type="NX_FLOAT" units="NX_WAVELENGTH"
deprecated="see https://github.com/nexusformat/definitions/issues/820">
<doc>wavelength standard deviation</doc>
</field>
<field name="wavelength_errors" type="NX_FLOAT" units="NX_WAVELENGTH">
<doc>
wavelength standard deviation
</doc>
<doc>wavelength standard deviation</doc>
</field>
<field name="energy" type="NX_FLOAT" units="NX_ENERGY">
<doc>
energy selected
</doc>
</field>
<field name="energy_error" type="NX_FLOAT" units="NX_ENERGY" deprecated="see https://github.com/nexusformat/definitions/issues/820">
<doc>
energy standard deviation
</doc>
</field>
<doc>energy selected</doc>
</field>
<field name="energy_error" type="NX_FLOAT" units="NX_ENERGY"
deprecated="see https://github.com/nexusformat/definitions/issues/820">
<doc>energy standard deviation</doc>
</field>
<field name="energy_errors" type="NX_FLOAT" units="NX_ENERGY">
<doc>
energy standard deviation
</doc>
<doc>energy standard deviation</doc>
</field>
<field name="energy_dispersion" type="NX_FLOAT" units="NX_ANY">
<doc>
Expand All @@ -85,56 +80,48 @@
Size, position and shape of the exit slit of the monochromator.
</doc>
</group>
<group type="NXdata" name="distribution"/>
<group type="NXdata" name="distribution"/>
<group type="NXgeometry" name="geometry" deprecated="Use the field `depends_on` and :ref:`NXtransformations` to position the monochromator and NXoff_geometry to describe its shape instead"/>
<group type="NXoff_geometry" minOccurs="0">
<doc>
This group describes the shape of the beam line component
</doc>
</group>
<group type="NXcrystal">
<doc>
Use as many crystals as necessary to describe
</doc>
</group>
<group type="NXvelocity_selector"/>
<group type="NXgrating">
<doc>
For diffraction grating based monochromators
<doc>
This group describes the shape of the beam line component
</doc>
</group>
<group type="NXcrystal"><doc>Use as many crystals as necessary to describe</doc></group>
<group type="NXvelocity_selector"/>
<group type="NXgrating"><doc>For diffraction grating based monochromators</doc></group>
<attribute name="default">
<doc>
.. index:: plotting
Declares which child group contains a path leading
to a :ref:`NXdata` group.
It is recommended (as of NIAC2014) to use this attribute
to help define the path to the default dataset to be plotted.
See https://www.nexusformat.org/2014_How_to_find_default_data.html
for a summary of the discussion.
.. index:: plotting

Declares which child group contains a path leading
to a :ref:`NXdata` group.

It is recommended (as of NIAC2014) to use this attribute
to help define the path to the default dataset to be plotted.
See https://www.nexusformat.org/2014_How_to_find_default_data.html
for a summary of the discussion.
</doc>
</attribute>
<field name="depends_on" type="NX_CHAR">
<doc>
NeXus positions components by applying a set of translations and rotations
to apply to the component starting from 0, 0, 0. The order of these operations
is critical and forms what NeXus calls a dependency chain. The depends_on
field defines the path to the top most operation of the dependency chain or the
string "." if located in the origin. Usually these operations are stored in a
NXtransformations group. But NeXus allows them to be stored anywhere.
.. todo::
Add a definition for the reference point of a monochromator.
NeXus positions components by applying a set of translations and rotations
to apply to the component starting from 0, 0, 0. The order of these operations
is critical and forms what NeXus calls a dependency chain. The depends_on
field defines the path to the top most operation of the dependency chain or the
string "." if located in the origin. Usually these operations are stored in a
NXtransformations group. But NeXus allows them to be stored anywhere.

.. todo::
Add a definition for the reference point of a monochromator.
</doc>
</field>
<group type="NXtransformations">
<doc>
This is the group recommended for holding the chain of translation
and rotation operations necessary to position the component within
the instrument. The dependency chain may however traverse similar groups in
other component groups.
This is the group recommended for holding the chain of translation
and rotation operations necessary to position the component within
the instrument. The dependency chain may however traverse similar groups in
other component groups.
</doc>
</group>
</definition>

0 comments on commit 0ec6a68

Please sign in to comment.