<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl" ?>
<!--
  # NXdiffraction: candidate NeXus definition for reflection data
-->
<definition type="group" name="NXdiffraction" category="contributed" extends="NXobject"
    xmlns="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://definition.nexusformat.org/nxdl/@NXDL_RELEASE@ ../nxdl.xsd"
    version="1.0"
    >
  <doc> This is a definition for reflection data from diffraction experiments </doc>
  <group type="NXentry" minOccurs="1">
    
    <field name="definition">
      <doc> NeXus NXDL schema to which this file conforms </doc>
      <enumeration>
        <item value="NXdiffraction" />
      </enumeration>
    </field>

    <field name="experiments" type="NXmx" minOccurs="1">
      <doc> The experiments from which the reflection data derives </doc>
    </field>

    <field name="h" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The h component of the miller index </doc>
    </field>

    <field name="k" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The k component of the miller index </doc>
    </field>

    <field name="l" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The l component of the miller index </doc>
    </field>

    <field name="id" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The id of the experiment which resulted in the reflection. If the value
        is greater than 0, the experiments must link to a multi-experiment NXmx
        group 
      </doc>
    </field>

    <field name="reflection_id" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc>
        The id of the reflection. Multiple partials from the same reflection
        should all have the same id
      </doc>
    </field>
    <field name="entering" type="NX_BOOL" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> Is the reflection entering or exiting the Ewald sphere </doc>
    </field>
    
    <field name="det_module" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The detector module on which the reflection was recorded </doc>
    </field>

    <field name="flags" type="NX_INT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> Status flags describing the reflection </doc>
    </field>

    <field name="d" type="NX_FLOAT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The resolution of the reflection </doc>
    </field>
    
    <field name="partiality" type="NX_FLOAT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The partiality of the reflection </doc>
    </field>

    <field name="prd_frame" type="NX_FLOAT" units="frames" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The frame on which the bragg peak of the reflection is predicted
      </doc>
    </field>

    <field name="prd_mm_x" type="NX_FLOAT" units="mm" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The x millimetre position at which the bragg peak of the reflection
        is predicted 
      </doc>
    </field>

    <field name="prd_mm_y" type="NX_FLOAT" units="mm" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The y millimetre position at which the bragg peak of the reflection
        is predicted 
      </doc>
    </field>

    <field name="prd_phi" type="NX_FLOAT" units="degrees" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The phi angle at which the bragg peak of the reflection is predicted
      </doc>
    </field>

    <field name="prd_px_x" type="NX_FLOAT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The x pixel position at which the bragg peak of the reflection is
        predicted 
      </doc>
    </field>

    <field name="prd_px_y" type="NX_FLOAT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The y pixel position at which the bragg peak of the reflection is
        predicted 
      </doc>
    </field>
    
    <field name="obs_frame_val" type="NX_FLOAT" units="frames" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the frame at which the central impact of the
        reflection was recorded 
      </doc>
    </field>

    <field name="obs_frame_var" type="NX_FLOAT" units="frames2" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the frame at which the central
        impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_px_x_val" type="NX_FLOAT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the pixel x position at which the central impact of
        the reflection was recorded 
      </doc>
    </field>

    <field name="obs_px_x_var" type="NX_FLOAT" units="px2" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the pixel x position at which the
        central impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_px_y_val" type="NX_FLOAT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the pixel y position at which the central impact of
        the reflection was recorded 
      </doc>
    </field>

    <field name="obs_px_y_var" type="NX_FLOAT" units="px2"  minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the pixel y position at which the
        central impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_phi_val" type="NX_FLOAT" units="degrees" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the phi angle at which the central impact of the
        reflection was recorded 
      </doc>
    </field>

    <field name="obs_phi_var" type="NX_FLOAT" units="degrees2" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the phi angle at which the central
        impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_mm_x_val" type="NX_FLOAT" units="mm" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the millimetre x position at which the central
        impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_mm_x_var" type="NX_FLOAT" units="mm2" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the millimetre x position at which
        the central impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_mm_y_val" type="NX_FLOAT" units="mm" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the millimetre y position at which the central
        impact of the reflection was recorded 
      </doc>
    </field>

    <field name="obs_mm_y_var" type="NX_FLOAT" units="mm2" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the millimetre y position at which
        the central impact of the reflection was recorded 
      </doc>
    </field>

    <field name="bbx0" type="NX_INT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The lower pixel x position of the bounding box around the recorded
        reflection 
      </doc>
    </field>

    <field name="bbx1" type="NX_INT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The upper pixel x position of the bounding box around the recorded
        reflection 
      </doc>
    </field>

    <field name="bby0" type="NX_INT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The lower pixel y position of the bounding box around the recorded
        reflection 
      </doc>
    </field>

    <field name="bby1" type="NX_INT" units="px" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The upper pixel y position of the bounding box around the recorded
        reflection 
      </doc>
    </field>

    <field name="bbz0" type="NX_INT" units="frames" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The lower frame number of the bounding box around the recorded
        reflection 
      </doc>
    </field>

    <field name="bbz1" type="NX_INT" units="frames" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The upper frame number of the bounding box around the recorded
        reflection 
      </doc>
    </field>

    <field name="bkg_mean" type="NX_FLOAT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The mean background under the reflection peak 
      </doc>
    </field>

    <field name="int_prf_val" type="NX_FLOAT" minOccurs="0">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The estimate of the reflection intensity by profile fitting 
      </doc>
    </field>

    <field name="int_prf_var" type="NX_FLOAT" minOccurs="0">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the reflection intensity by profile
        fitting 
      </doc>
    </field>

    <field name="int_sum_val" type="NX_FLOAT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> The estimate of the reflection intensity by summation </doc>
    </field>

    <field name="int_sum_var" type="NX_FLOAT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The variance on the estimate of the reflection intensity by
        summation 
      </doc>
    </field>

    <field name="lp" type="NX_FLOAT" minOccurs="1">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The LP correction factor to be applied to the reflection intensities
      </doc>
    </field>

    <field name="prf_cc" type="NX_FLOAT" minOccurs="0">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        The correlation of the reflection profile with the reference profile
        used in profile fitting 
      </doc>
    </field>

    <field name="overlaps" type="HST_ARRAY(NX_INT)" minOccurs="0">
      <attribute name="description">
        <doc> Describes the dataset </doc>
      </attribute>
      <doc> 
        An adjacency list specifying the spatial overlaps of reflections. The
        adjacency list is specified using an array data type where the elements
        of the array are the indices of the adjacent overlapped reflection 
      </doc>
    </field>

  </group>
</definition>
