<?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-2012 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/@NXDL_RELEASE@" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="NXxrot" extends="NXxbase" type="group" category="application" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@ ../nxdl.xsd" version="1.0b">
    <doc>
    This is the application definition for raw data from a rotation camera.
    It extends NXxbase, so the full definition is the content of NXxbase
    plus the data defined here.
  </doc>
    <group type="NXentry" name="entry">
        <field name="definition">
            <doc>Official NeXus NXDL schema to which this file conforms.</doc>
            <enumeration>
                <item value="NXxrot"/>
            </enumeration>
        </field>
        <group type="NXinstrument" name="instrument">
            <group type="NXdetector" name="detector">
                <field name="polar_angle" type="NX_FLOAT" units="NX_ANGLE">
                    <doc>The polar_angle (two theta) where the detector is placed.</doc>
                </field>
                <field name="beam_center_x" type="NX_FLOAT" units="NX_LENGTH">
                    <doc>
              This is the x position where the direct beam would hit the detector. This is a
              length, not a pixel position, and can be outside of the actual detector.
            </doc>
                </field>
                <field name="beam_center_y" type="NX_FLOAT" units="NX_LENGTH">
                    <doc>
                This is the y position where the direct beam would hit the detector. This is a
                length, not a pixel position, and can be outside of the actual detector.
        </doc>
                </field>
                <field name="data" type="NX_INT" signal="1">
                    <doc>
              The area detector data, the first dimension is always the
              number of scan points, the second and third are the number
              of pixels in x and y. The origin is always assumed to be
              in the center of the detector. maxOccurs is limited to the
              the number of detectors on your instrument.
            </doc>
                    <dimensions rank="3">
                        <dim index="1" value="np"/>
                        <dim index="2" value="number of x pixels"/>
                        <dim index="3" value="number of y pixels"/>
                    </dimensions>
                    <attribute name="signal" type="NX_POSINT">
                        <enumeration>
                            <item value="1"/>
                        </enumeration>
                    </attribute>
                </field>
                <field name="x_pixel_size" type="NX_FLOAT" units="NX_LENGTH"/>
                <field name="y_pixel_size" type="NX_FLOAT" units="NX_LENGTH"/>
                <field name="distance" type="NX_FLOAT" units="NX_LENGTH"/>
                <field name="frame_start_number" type="NX_INT">
                    <doc>
              This is the start number of the first frame of a scan. In PX one often scans a couple 
              of frames on a give sample, then does something else, then returns to the same sample 
              and scans some more frames. Each time with a new data file.
              This number helps concatenating such measurements. 
            </doc>
                </field>
            </group>
            <group type="NXattenuator" name="attenuator">
                <field name="attenuator_transmission" type="NX_FLOAT" units="NX_ANY"/>
            </group>
            <group type="NXsource" name="source">
                <field name="type"/>
                <field name="name"/>
                <field name="probe">
                    <enumeration>
                        <item value="neutron"/>
                        <item value="x-ray"/>
                        <item value="electron"/>
                    </enumeration>
                </field>
            </group>
            <group type="NXmonochromator" name="monochromator">
                <field name="wavelength" type="NX_FLOAT" units="NX_WAVELENGTH"/>
            </group>
        </group>
        <group type="NXsample" name="sample">
            <field name="rotation_angle" type="NX_FLOAT" units="NX_ANGLE" axis="1">
                <doc>This is an array holding the sample rotation start angle at each  scan point</doc>
                <dimensions rank="1">
                    <dim index="1" value="np"/>
                </dimensions>
            </field>
            <field name="rotation_angle_step" type="NX_FLOAT" units="NX_ANGLE" axis="1">
                <doc>This is an array holding the step made for sample rotation angle at each  scan point</doc>
                <dimensions rank="1">
                    <dim index="1" value="np"/>
                </dimensions>
            </field>
            <field name="name" type="NX_CHAR">
                <doc>Descriptive name of sample</doc>
            </field>
            <field name="orientation_matrix" type="NX_FLOAT">
                <doc>
            The orientation matrix according to Busing and 
            Levy conventions. This is not strictly necessary as 
            the UB can always be derived from the data.  But 
            let us bow to common usage which includes the 
            UB nearly always.
           </doc>
                <dimensions rank="2">
                    <dim index="1" value="3"/>
                    <dim index="2" value="3"/>
                </dimensions>
            </field>
            <field name="unit_cell" type="NX_FLOAT">
                <doc>
            The unit cell, a, b, c, alpha, beta, gamma. 
            Again, not strictly necessary, but normally written.
          </doc>
                <dimensions rank="1">
                    <dim index="1" value="6"/>
                </dimensions>
            </field>
            <field name="temperature" type="NX_FLOAT">
                <doc>
            The sample temperature or whatever sensor represents this value best
            </doc>
                <dimensions rank="1">
                    <dim index="1" value="NP"/>
                </dimensions>
            </field>
            <field name="x_translation" type="NX_FLOAT" units="NX_LENGTH">
                <doc>Translation of the sample along the X-direction of the laboratory coordinate system</doc>
            </field>
            <field name="y_translation" type="NX_FLOAT" units="NX_LENGTH">
                <doc>Translation of the sample along the Y-direction of the laboratory coordinate system</doc>
            </field>
            <field name="distance" type="NX_FLOAT" units="NX_LENGTH">
                <doc>Translation of the sample along the Z-direction of the laboratory coordinate system</doc>
            </field>
        </group>
        <group type="NXdata" name="name">
            <link name="rotation_angle" target="/NXentry/NXsample/rotation_angle"/>
            <link name="data" target="/NXentry/NXinstrument/NXdetector/data"/>
        </group>
        <field name="title"/>
        <field name="start_time" type="NX_DATE_TIME"/>
        <group type="NXmonitor" name="control">
            <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>
</definition>

