<?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="NXinsertion_device" 
	type="group" extends="NXobject">
    <doc>An insertion device, as used in a synchrotron light source.</doc>
    <field name="type">
        <enumeration>
            <item value="undulator"/>
            <item value="wiggler"></item>
        </enumeration>
    </field>
    <field name="gap" type="NX_FLOAT" units="NX_LENGTH">
        <doc>separation between opposing pairs of magnetic poles</doc>
    </field>
    <field name="taper" type="NX_FLOAT" units="NX_ANGLE">
        <doc>angular of gap difference between upstream and downstream ends of the insertion device</doc>
    </field>
    <field name="phase" type="NX_FLOAT" units="NX_ANGLE"/>
    <field name="poles" type="NX_INT" units="NX_UNITLESS">
         <doc>number of poles</doc>
    </field>
    <field name="magnetic_wavelength" type="NX_FLOAT" units="NX_WAVELENGTH"/>
    <field name="k" type="NX_FLOAT" units="NX_DIMENSIONLESS">
        <doc>beam displacement parameter</doc>
    </field>
    <field name="length" type="NX_FLOAT" units="NX_LENGTH">
        <doc>length of insertion device</doc>
    </field>
    <field name="power" type="NX_FLOAT" units="NX_POWER">
        <doc>total power delivered by insertion device</doc>
    </field>
    <field name="energy" type="NX_FLOAT" units="NX_ENERGY">
        <doc>energy of peak intensity in output spectrum</doc>
    </field>
    <field name="bandwidth" type="NX_FLOAT" units="NX_ENERGY">
        <doc>bandwidth of peak energy</doc><!-- What are the best units here? -->
    </field>
    <field name="harmonic" type="NX_INT" units="NX_UNITLESS">
        <doc>harmonic number of peak</doc>
    </field>
    <group type="NXdata" name="spectrum">
        <doc>spectrum of insertion device</doc>
    </group>
    <group type="NXgeometry">
        <doc>"Engineering" position of insertion device</doc>
    </group>
</definition>

