<?xml version="1.0" encoding="UTF-8"?>
<!--
# 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 name="NXwoni" restricts="NXentry" type="group"
    category="application"
    xmlns="http://definition.nexusformat.org/nxdl/3.1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd"
    version="1.0b">
    <doc> Instrument definition for the fictional WONI powder
        diffractometer at HYNES.
    </doc>
<field name="title"/>
    <group type="NXinstrument">
        <group type="NXsource">
            <field name="type"/>
            <field name="name"/>
            <field name="probe">
                <enumeration>
                    <item value="neutron"/><!-- HYNES is a fictional neutron source -->
                    <!--<item value="x-ray"/>-->
                    <!--<item value="electron"/>-->
                </enumeration>
            </field>
        </group>
        <group type="NXcrystal">
            <field name="wavelength" type="NX_FLOAT" units="NX_WAVELENGTH">
                <doc>Optimum diffracted wavelength</doc>
                <dimensions rank="1">
                    <dim index="1" value="i"/>
                </dimensions>
            </field>
        </group>
        <group type="NXdetector">
            <field name="polar_angle" type="NX_FLOAT" axis="1">
              <doc>where ndet = number of detectors</doc>
              <dimensions rank="1">
                <dim index="1" value="ndet" />
              </dimensions>
            </field>
            <field name="data" type="NX_INT">
              <doc>
                detector signal (usually counts) are already
                corrected for detector efficiency
              </doc>
              <dimensions rank="1">
                <dim index="1" value="ndet" />
              </dimensions>
            </field>
        </group>
    </group>
    <group type="NXsample">
        <field name="name">
            <doc>Descriptive name of sample</doc>
        </field>
    </group>
    <group type="NXmonitor">
        <field name="mode">
            <doc>Count to a preset value based on either clock time (timer) or received monitor
                counts (monitor).</doc>
            <enumeration>
                <item value="monitor"/>
                <item value="timer"/>
            </enumeration>
        </field>
        <field name="preset" type="NX_FLOAT">
            <doc>preset value for time or monitor</doc>
        </field>
        <field name="integral" type="NX_FLOAT" units="NX_ANY">
            <doc>Total integral monitor counts</doc>
        </field>
    </group>
    <group type="NXdata" signal="data" axes="polar_angle">
        <link name="polar_angle" target="/NXentry/NXinstrument/NXdetector/polar_angle">
            <doc>Link to polar angle in /NXentry/NXinstrument/NXdetector</doc>
        </link>
        <link name="data" target="/NXentry/NXinstrument/NXdetector/data">
            <doc>Link to data in /NXentry/NXinstrument/NXdetector</doc>
        </link>
    </group>
</definition>
