<?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) 2008-2020 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" category="base"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
    name="NXmirror" 
	type="group" extends="NXobject">
    <doc>A beamline mirror or supermirror.</doc>

    <group type="NXgeometry"><doc><!-- TODO explain what this group means --></doc>
    </group>
    <field name="type">
      <enumeration>
        <item value="single"><doc>mirror with a single material as a reflecting surface</doc></item>
        <item value="multi"><doc>mirror with stacked, multiple layers as a reflecting surface</doc></item>
      </enumeration>
    </field>
    <field name="description">
        <doc>description of this mirror</doc>
    </field>
    <field name="incident_angle" type="NX_FLOAT" units="NX_ANGLE">
        <doc></doc>
    </field>
    <group type="NXdata" name="reflectivity">
        <!-- 
            TODO Trac ticket #45 applies here.  
            https://github.com/nexusformat/definitions/issues/45
            
            TODO Solution of ticket #41 will apply here, as well.
            https://github.com/nexusformat/definitions/issues/41
        -->
        <doc>Reflectivity as function of wavelength</doc>
    </group>
    <!-- TODO need more documentation throughout -->
    <field name="bend_angle_x" type="NX_FLOAT" units="NX_ANGLE">
        <doc></doc>
    </field>
    <field name="bend_angle_y" type="NX_FLOAT" units="NX_ANGLE">
        <doc></doc>
    </field>
    <field name="interior_atmosphere">
        <enumeration>
            <item value="vacuum"/>
            <item value="helium"/>
            <item value="argon"/>
        </enumeration>
    </field>
    <field name="external_material">
        <doc>external material outside substrate</doc>
    </field>
    <field name="m_value" type="NX_FLOAT" units="NX_UNITLESS">
        <doc>
            The m value for a supermirror, which defines the supermirror 
            regime in multiples of the critical angle of Nickel.
        </doc>
    </field>
    <field name="substrate_material">
        <doc></doc>
    </field>
    <field name="substrate_density" type="NX_FLOAT" units="NX_MASS_DENSITY">
        <doc></doc>
    </field>
    <field name="substrate_thickness" type="NX_FLOAT" units="NX_LENGTH">
        <doc></doc>
    </field>
    <field name="coating_material">
        <doc></doc>
    </field>
    <field name="substrate_roughness" type="NX_FLOAT" units="NX_LENGTH">
        <doc></doc>
    </field>
    <field name="coating_roughness" type="NX_FLOAT" units="NX_LENGTH">
        <doc></doc>
    </field>
    <field name="even_layer_material">
        <doc></doc>
    </field>
    <field name="even_layer_density" type="NX_FLOAT" units="NX_MASS_DENSITY">
        <doc></doc>
    </field>
    <field name="odd_layer_material">
        <doc></doc>
    </field>
    <field name="odd_layer_density" type="NX_FLOAT" units="NX_MASS_DENSITY">
        <doc></doc>
    </field>
    <field name="layer_thickness" type="NX_FLOAT" units="NX_LENGTH">
      <doc> An array describing the thickness of each layer</doc>
    </field>
    <group type="NXshape" name="shape">
        <doc>A NXshape group describing the shape of the mirror</doc>
    </group>
    <group name="figure_data" type="NXdata">
        <doc>Numerical description of the surface figure of the mirror.</doc>
    </group>
    <!-- TODO need more parameters here, such as ...
        list from Rainer Gehrke, DESY (some items may already be present)

Parameters for mirrors
    Field indicating whether simple or multilayer
    Substrate element or compound
    Substrate density
    In case of multilayer: 	Even layer material (element or compound)
    Even layer density
    Odd layer material (element or compound)
    Odd layer density
    Number of layer pairs
    Layer thickness (array)
        

Figure for crystals and mirrors (to describe curved surfaces)
   Field indicating whether concave or convex
   Field indicating whether cylindrical or not
   If cylindrical: cylinder orientation angle

Now come the different surface figures with the necessary parameters:
1. Flat
2. Spherical (spherical radius)
3. Elliptical and hyperbolical (semi-major axis, semi-minor axis, angle of major axis and pole)
4. Toroidal (major radius, minor radius)
5. Parabolical (parabolic parameter a)
6. Conical (cone half aperture)
7. Polynomial (degree of polynom, array with polynom coefficients)

    -->

</definition>

