[IUCr Home Page] [CIF Home Page] [CBF/imgCIF] [CBFlib]

imgCIF/CBF

Extensions Dictionary

##############################################################################
#                                                                            #
#                       Image CIF Dictionary (imgCIF)                        #
#             and Crystallographic Binary File Dictionary (CBF)              #
#            Extending the Macromolecular CIF Dictionary (mmCIF)             #
#                                                                            #
#                               Version 1.0                                  #
#                              of 2000-12-21                                 #
#                                                                            #
#                             Adapted from the                               #
#                       imgCIF Workshop, BNL Oct 1997                        #
#                                    and                                     #
#               Crystallographic Binary File Format Draft Proposal           #
#                            by Andy Hammersley                              #
#                                                                            #
##############################################################################
#                                                                            #
#                           First DDL 2.1 Version                            #
#                                    by                                      # 
#                               John Westbrook                               #
#                           Nucleic Acid Database                            #
#                             Rutgers University                             #
#                                                                            #
##############################################################################
# These revisions by:  Herbert J. Bernstein, yaya@bernstein-plus-sons.com    #
# Incorporating comments by I. David Brown, John Westbrook and Brian McMahon #
##############################################################################

                                                                            
data_cif_img.dic


    _dictionary.title           cif_img.dic
    _dictionary.version         1.0
    _dictionary.datablock_id    cif_img.dic

##############################################################################
#    CONTENTS
#
#        CATEGORY_GROUP_LIST
#
#        category  ARRAY_DATA
#
#                  _array_data.array_id
#                  _array_data.binary_id
#                  _array_data.data
#
#        category  ARRAY_ELEMENT_SIZE
#        
#                  _array_element_size.array_id
#                  _array_element_size.index
#                  _array_element_size.size
#        
#        category  ARRAY_INTENSITIES
#        
#                  _array_intensities.array_id
#                  _array_intensities.binary_id
#                  _array_intensities.gain
#                  _array_intensities.gain_esd
#                  _array_intensities.linearity
#                  _array_intensities.offset
#                  _array_intensities.scaling
#                  _array_intensities.overload
#                  _array_intensities.undefined_value
#        
#        category  ARRAY_STRUCTURE
#        
#                  _array_structure.byte_order
#                  _array_structure.compression_type
#                  _array_structure.encoding_type
#                  _array_structure.id
#        
#        category  ARRAY_STRUCTURE_LIST
#        
#                  _array_structure_list.array_id
#                  _array_structure_list.dimension
#                  _array_structure_list.direction
#                  _array_structure_list.index
#                  _array_structure_list.precedence
#
#        category  AXIS
#        
#                  _axis.depends_on
#                  _axis.equipment
#                  _axis.id
#                  _axis.offset[1]
#                  _axis.offset[2]
#                  _axis.offset[3]
#                  _axis.type
#                  _axis.vector[1]
#                  _axis.vector[2]
#                  _axis.vector[3]
#
#        category  DIFFRN_DETECTOR
#        
#                  _diffrn_detector.details
#                  _diffrn_detector.detector
#                  _diffrn_detector.diffrn_id
#                  _diffrn_detector.dtime
#                  _diffrn_detector.id
#                  _diffrn_detector.number_of_axes
#                  _diffrn_detector.type
#
#        category  DIFFRN_DETECTOR_AXIS
#        
#                  _diffrn_detector_axis.id    
#                  _diffrn_detector_axis.axis_id
#        
#        category  DIFFRN_DETECTOR_ELEMENT
#
#                  _diffrn_detector_element.center[1]
#                  _diffrn_detector_element.center[2]
#                  _diffrn_detector_element.id
#                  _diffrn_detector_element.detector_id
#
#        category  DIFFRN_FRAME_DATA
#        
#                  _diffrn_frame_data.array_id
#                  _diffrn_frame_data.binary_id
#                  _diffrn_frame_data.detector_element_id
#                  _diffrn_frame_data.id
#        
#        category  DIFFRN_MEASUREMENT
#        
#                  _diffrn_measurement.diffrn_id
#                  _diffrn_measurement.details
#                  _diffrn_measurement.device
#                  _diffrn_measurement.device_details
#                  _diffrn_measurement.device_type
#                  _diffrn_measurement.id
#                  _diffrn_measurement.method
#                  _diffrn_measurement.number_of_axes
#                  _diffrn_measurement.specimen_support
#
#        category  DIFFRN_MEASUREMENT_AXIS
#        
#                  _diffrn_measurement_axis.id
#                  _diffrn_measurement_axis.axis_id
#        
#        category  DIFFRN_REFLN
#        
#                  _diffrn_refln.frame_id
#
#        category  DIFFRN_SCAN
#        
#                  _diffrn_scan.id
#                  _diffrn_scan.integration_time
#                  _diffrn_scan.frame_id_start
#                  _diffrn_scan.frame_id_end
#                  _diffrn_scan.frames
#
#        category  DIFFRN_SCAN_AXIS
#        
#                  _diffrn_scan_axis.scan_id
#                  _diffrn_scan_axis.axis_id
#                  _diffrn_scan_axis.angle_start
#                  _diffrn_scan_axis.angle_range
#                  _diffrn_scan_axis.angle_increment
#                  _diffrn_scan_axis.displacement_start
#                  _diffrn_scan_axis.displacement_range
#                  _diffrn_scan_axis.displacement_increment
#
#        category  DIFFRN_SCAN_FRAME
#        
#                  _diffrn_scan_frame.frame_id
#                  _diffrn_scan_frame.frame_number
#                  _diffrn_scan_frame.integration_time
#                  _diffrn_scan_frame.scan_id
#
#        category  DIFFRN_SCAN_FRAME_AXIS
#        
#                  _diffrn_scan_frame_axis.axis_id
#                  _diffrn_scan_frame_axis.angle
#                  _diffrn_scan_frame_axis.displacement
#                  _diffrn_scan_frame_axis.frame_id
#
#        ITEM_TYPE_LIST
#        ITEM_UNITS_LIST
#        DICTIONARY_HISTORY
#
##############################################################################


#########################
## CATEGORY_GROUP_LIST ##
#########################

     loop_
    _category_group_list.id
    _category_group_list.parent_id
    _category_group_list.description
             'inclusive_group'   .
;             Categories that belong to the dictionary extension.
;
             'array_data_group'
             'inclusive_group'
;             Categories that describe array data.
;
             'axis_group'
             'inclusive_group'
;             Categories that describe axes.
;
             'diffrn_group'
             'inclusive_group'
;            Categories that describe details of the diffraction experiment.
;
 
 
 
 
##############
# ARRAY_DATA #
##############
 
  
save_ARRAY_DATA
    _category.description
;
     Data items in the ARRAY_DATA category are the containers for
     the array data items described in category ARRAY_STRUCTURE.
;
    _category.id                   array_data
    _category.mandatory_code       no
     loop_
    _category_key.name             '_array_data.array_id'
                                   '_array_data.binary_id'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 1 -

        This example shows two binary data blocks.  The first one
        was compressed by the CBF_CANONICAL compression algorithm and
        presented as hexadecimal data.  The first character "H" on the
        data lines means hexadecimal.  It could have been "O" for octal
        or "D" for decimal.  The second character on the line shows
        the number of bytes in each word (in this case "4"), which then
        requires 8 hexadecimal digits per word.  The third character
        gives the order of octets within a word, in this case "<"
        for the ordering 4321 (i.e. "big-endian").  Alternatively the
        character ">" could have been used for the ordering 1234
        (i.e. "little-endian").  The block has a "message digest"
        to check the integrity of the data.

        The second block is similar, but uses CBF_PACKED compression
        and BASE64 encoding.  Note that the size and the digest are
        different.
;
;

        loop_
        _array_data.array_id
        _array_data.binary_id
        _array_data.data
        image_1 1
        ;
        --CIF-BINARY-FORMAT-SECTION--
        Content-Type: application/octet-stream;
             conversions="x-CBF_CANONICAL"
        Content-Transfer-Encoding: X-BASE16
        X-Binary-Size: 3927126
        X-Binary-ID: 1
        Content-MD5: u2sTJEovAHkmkDjPi+gWsg==

        # Hexadecimal encoding, byte 0, byte order ...21
        #
        H4< 0050B810 00000000 00000000 00000000 000F423F 00000000 00000000 ...
        ....
        --CIF-BINARY-FORMAT-SECTION----
        ;
        image_2 2
        ;
        --CIF-BINARY-FORMAT-SECTION--
        Content-Type: application/octet-stream;
             conversions="x-CBF-PACKED"
        Content-Transfer-Encoding: BASE64
        X-Binary-Size: 3745758
        X-Binary-ID: 1
        Content-MD5: 1zsJjWPfol2GYl2V+QSXrw==

        ELhQAAAAAAAA...
        ...
        --CIF-BINARY-FORMAT-SECTION----
        ;
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
save_
 
 
save__array_data.array_id
    _item_description.description
;             This item is a pointer to _array_structure.id in the
              ARRAY_STRUCTURE category. 
;
    _item.name                  '_array_data.array_id'
    _item.category_id             array_data
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
save__array_data.binary_id
    _item_description.description
;             This item is an integer identifier which, along with
              _array_data.array_id should uniquely identify the 
              particular block of array data.
              
              If _array_data.binary_id is not explicitly given,
              it defaults to 1.
              
              The value of _array_data.binary_id distinguishes
              among multiple sets of data with the same array
              structure.
              
              If the MIME header of the data array specifies a 
              value for X-Binary-Id, these values should be equal.
;
     loop_
    _item.name                  
    _item.category_id             
    _item.mandatory_code          
             '_array_data.binary_id'            array_data      
                                                                implicit
             '_diffrn_frame_data.binary_id'     diffrn_frame_data
                                                                implicit
             '_array_intensities.binary_id'     array_intensities
                                                                implicit
     loop_
    _item_linked.child_name
    _item_linked.parent_name
             '_diffrn_frame_data.binary_id'     '_array_data.binary_id'
             '_array_intensities.binary_id'     '_array_data.binary_id'

    _item_default.value           1
    _item_type.code               int
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            1  1
                            .  1
     save_
 
 
save__array_data.data
    _item_description.description
;             The value of _array_data.data contains the array data 
              encapsulated in a STAR string.
              
              The representation used is a variant on the
              Multipurpose Internet Mail Extensions (MIME) specified
              in RFC 2045-2049 by N. Freed et al.  The boundary
              delimiter used in writing an imgCIF or CBF is
              "--CIF-BINARY-FORMAT-SECTION--" (including the
              required initial "--").

              The Content-Type may be any of the discrete types permitted
              in RFC 2045; "application/octet-stream" is recommended.  
              If an octet stream was compressed, the compression should 
              be specified by the parameter 'conversions="x-CBF_PACKED"' 
              or the parameter 'conversions="x-CBF_CANONICAL"'.
              
              The Content-Transfer-Encoding may be "BASE-64",
              "Quoted-Printable", "X-BASE-8", "X-BASE-10", or
              "X-BASE-16" for an imgCIF or "BINARY" for a CBF.  The
              octal, decimal and hexadecimal transfer encodings are
              for convenience in debugging, and are not recommended
              for archiving and data interchange.
              
              In an imgCIF file, the encoded binary data begins after
              the empty line terminating the header.  In a CBF, the
              raw binary data begins after an empty line terminating
              the header and after the sequence:
                    
              Octet   Hex   Decimal  Purpose
                0     0C       12    (ctrl-L) Page break
                1     1A       26    (ctrl-Z) Stop listings in MS-DOS
                2     04       04    (Ctrl-D) Stop listings in UNIX
                3     D5      213    Binary section begins

              None of these octets are included in the calculation of
              the message size, nor in the calculation of the
              message digest.
                             
              The X-Binary-Size header specifies the size of the
              equivalent binary data in octets.  If compression was
              used, this size is the size after compression, including
              any book-keeping fields.  And adjustment is made for
              the deprecated binary formats in which 8 bytes of binary
              header are used for the compression type.  In that case,
              the 8 bytes used for the compression type is subtracted
              from the size, so that the same size will be reported
              if the compression type is supplied in the MIME header.
              Use of the MIME header is the recommended way to
              supply the compression type.  In general, no portion of
              the  binary header is included in the calculation of the size.

              The X-Binary-Element-Type header specifies the type of
              binary data in the octets, using the same descriptive
              phrases as in _array_structure.encoding_type.  The default
              value is "unsigned 32-bit integer".
              
              An MD5 message digest may, optionally, be used. The "RSA Data
              Security, Inc. MD5 Message-Digest Algorithm" should be used.
              No portion of the header is included in the calculation of the
              message digest.

              If the Transfer Encoding is "X-BASE-8", "X-BASE-10", or
              "X-BASE-16", the data is presented as octal, decimal or
              hexadecimal data organized into lines or words.  Each word
              is created by composing octets of data in fixed groups of
              2, 3, 4, 6 or 8 octets, either in the order ...4321 ("big-
              endian") or 1234... (little-endian).  If there are fewer
              than the specified number of octets to fill the last word,
              then the missing octets are presented as "==" for each
              missing octet.  Exactly two equal signs are used for each
              missing octet even for octal and decimal encoding.
              The format of lines is:

              rnd xxxxxx xxxxxx xxxxxx

              where r is "H", "O", or "D" for hexadecimal, octal or
              decimal, n is the number of octets per word. and d is "<"
              for ">" for the "...4321" and "1234..." octet orderings
              respectively.  The "==" padding for the last word should
              be on the appropriate side to correspond to the missing
              octets, e.g.

              H4< FFFFFFFF FFFFFFFF 07FFFFFF ====0000

              or

              H3> FF0700 00====

              For these hex, octal and decimal formats, only, comments
              beginning with "#" are permitted to improve readability.

              BASE64 encoding follows MIME conventions.  Octets are
              in groups of three, c1, c2, c3.  The resulting 24 bits 
              are broken into four 6-bit quantities, starting with 
              the high-order six bits (c1 >> 2) of the first octet, then
              the low-order two bits of the first octet followed by the
              high-order 4 bits of the second octet ((c1 & 3)<<4 | (c2>>4)),
              then the bottom 4 bits of the second octet followed by the
              high order two bits of the last octet ((c2 & 15)<<2 | (c3>>6)),
              then the bottom six bits of the last octet (c3 & 63).  Each
              of these four quantities is translated into an ASCII character
              using the mapping:

                        1         2         3         4         5         6
              0123456789012345678901234567890123456789012345678901234567890123
              |         |         |         |         |         |         |
              ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

              With short groups of octets padded on the right with one "="
              if c3 is missing, and with "==" if both c2 and c3 are missing.

              QUOTED-PRINTABLE encoding also follows MIME conventions, copying
              octets without translation if their ASCII values are 32..38,
              42, 48..57, 59..60, 62, 64..126 and the octet is not a ";"
              in column 1.  All other characters are translated to =nn, where
              nn is the hexadecimal encoding of the octet.  All lines are
              "wrapped" with a terminating "=" (i.e. the MIME conventions
              for an implicit line terminator are never used).
;
    _item.name                  '_array_data.data'
    _item.category_id             array_data
    _item.mandatory_code          yes
    _item_type.code               binary
save_
 
 
######################
# ARRAY_ELEMENT_SIZE #
######################
 
 
save_ARRAY_ELEMENT_SIZE
    _category.description
;
     Data items in the ARRAY_ELEMENT_SIZE category record the physical 
     size of array elements along each array dimension.
;
    _category.id                   array_element_size
    _category.mandatory_code       no
     loop_
    _category_key.name             '_array_element_size.array_id'
                                   '_array_element_size.index'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 1 - A regular 2D array with a uniform element dimension
                    of 1220 nanometres.
;
;
        loop_
       _array_element_size.array_id  
       _array_element_size.index
       _array_element_size.size
        image_1   1    1.22e-6
        image_1   2    1.22e-6
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__array_element_size.array_id
    _item_description.description
;             
              This item is a pointer to _array_structure.id in the
              ATOM_STRUCTURE category. 
;
    _item.name                  '_array_element_size.array_id'
    _item.category_id             array_element_size
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
save__array_element_size.index
    _item_description.description
;             
              This item is a pointer to _array_structure_list.index in the
              ATOM_STRUCTURE_LIST category. 
;
    _item.name                  '_array_element_size.index'
    _item.category_id             array_element_size
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
save__array_element_size.size
    _item_description.description
;
               The size in metres of an image element in this 
               dimension. This supposes that the elements are arranged
               on a regular grid.
;
    _item.name                 '_array_element_size.size'
    _item.category_id          array_element_size
    _item.mandatory_code       yes 
    _item_type.code            float
    _item_units.code           'metres'
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            .   0.0
     save_
 
 
#####################
# ARRAY_INTENSITIES #
#####################
 
 
save_ARRAY_INTENSITIES
    _category.description
;
              Data items in the ARRAY_INTENSITIES category record the
              information  required to recover the intensity data from 
              the set of data values stored in the ARRAY_DATA category.
;
    _category.id                   array_intensities
    _category.mandatory_code       no
    loop_
    _category_key.name             '_array_intensities.array_id'
                                   '_array_intensities.binary_id'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 1
;
;
        loop_
        _array_intensities.array_id
        _array_intensities.linearity 
        _array_intensities.gain      
        _array_intensities.overload  
        _array_intensities.undefined_value 
        image_1   linear  1.2    655535   0
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__array_intensities.array_id
    _item_description.description
;             
              This item is a pointer to _array_structure.id in the
              ATOM_STRUCTURE category. 
;
    _item.name                  '_array_intensities.array_id'
    _item.category_id             array_intensities
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
save__array_intensities.binary_id
    _item_description.description
;             This item is a pointer to _array_data.binary_id in the
              ARRAY_STRUCTURE category. 
;
    _item.name                  '_array_intensities.binary_id'
    _item.category_id             array_intensities
    _item.mandatory_code          implicit
    _item_type.code               int
     save_
 
 
save__array_intensities.gain
    _item_description.description
;              
               Detector "gain". The factor by which linearized 
               intensity values should be divided to produce
               counts.
;
    _item.name                '_array_intensities.gain'
    _item.category_id          array_intensities
    _item.mandatory_code       yes
    _item_type.code            float
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            .   0.0
     loop_
    _item_related.related_name
    _item_related.function_code  '_array_intensities.gain_esd'
                                 'associated_value'
    save_
 
  
save__array_intensities.gain_esd
    _item_description.description
;              
              The estimated standard deviation in detector "gain".
;
    _item.name                '_array_intensities.gain_esd'
    _item.category_id          array_intensities
    _item.mandatory_code       yes
    _item_type.code            float

     loop_
    _item_related.related_name
    _item_related.function_code  '_array_intensities.gain'
                                 'associated_esd'
    save_
 
 
save__array_intensities.linearity
    _item_description.description
;
               The intensity linearity scaling used from raw intensity
               to the stored element value:

               'linear' is obvious

               'offset'  means that the value defined by 
               '_array_intensities.offset' should be added to each
                element value.  

               'scaling' means that the value defined by 
               '_array_intensities.scaling' should be multiplied with each 
               element value.  

               'scaling_offset' is the combination of the two previous cases, 
               with the scale factor applied before the offset value.

               'sqrt_scaled' means that the square root of raw 
               intensities multiplied by '_array_intensities.scaling' is
               calculated and stored, perhaps rounded to the nearest 
               integer. Thus, linearization involves dividing the stored
               values by '_array_intensities.scaling' and squaring the 
               result. 

               'logarithmic_scaled' means that the logarithm based 10 of
               raw intensities multiplied by '_array_intensities.scaling' 
               is calculated and stored, perhaps rounded to the nearest 
               integer. Thus, linearization involves dividing the stored
               values by '_array_intensities.scaling' and calculating 10
               to the power of this number.
;

    _item.name                 '_array_intensities.linearity'
    _item.category_id          array_intensities
    _item.mandatory_code       yes
    _item_type.code            code
     loop_
    _item_enumeration.value   
    _item_enumeration.detail   
                              'linear' .
                              'offset'           
;
               The value defined by  '_array_intensities.offset' should 
               be added to each element value.  
;
                              'scaling'
;
               The value defined by '_array_intensities.scaling' should be 
               multiplied with each element value.  
;
                              'scaling_offset'   
;
               The combination of the scaling and offset 
               with the scale factor applied before the offset value.
;
                              'sqrt_scaled'      
;
               The square root of raw intensities multiplied by 
               '_array_intensities.scaling' is calculated and stored, 
               perhaps rounded to the nearest integer. Thus, 
               linearization involves dividing the stored
               values by '_array_intensities.scaling' and squaring the 
               result. 
;
                              'logarithmic_scaled'
;
               The logarithm based 10 of raw intensities multiplied by 
               '_array_intensities.scaling'  is calculated and stored, 
               perhaps rounded to the nearest integer. Thus, 
               linearization involves dividing the stored values by 
               '_array_intensities.scaling' and calculating 10 to the 
               power of this number.
;

    save_
  
  
save__array_intensities.offset
    _item_description.description
;
               Offset value to add to array element values in the manner
               described by item _array_intensities.linearity.
;
    _item.name                 '_array_intensities.offset'
    _item.category_id          array_intensities
    _item.mandatory_code       no
    _item_type.code            float
    save_
 
 
save__array_intensities.scaling
    _item_description.description
;
               Multiplicative scaling value to be applied to array data
               in the manner described by item _array_intensities.linearity.
;
    _item.name                 '_array_intensities.scaling'
    _item.category_id          array_intensities
    _item.mandatory_code       no
    _item_type.code            float
    save_
 
 
save__array_intensities.overload
    _item_description.description
;
               The saturation intensity level for this data array.
;
    _item.name                 '_array_intensities.overload'
    _item.category_id          array_intensities
    _item.mandatory_code       no
    _item_type.code            float
    save_
 
  
save__array_intensities.undefined_value
    _item_description.description
;
               A value to be substituted for undefined values in 
               the data array.
;
    _item.name                 '_array_intensities.undefined_value'
    _item.category_id          array_intensities
    _item.mandatory_code       no
    _item_type.code            float
    save_
 
 
###################
# ARRAY_STRUCTURE #
###################
 
 
save_ARRAY_STRUCTURE
    _category.description
;
     Data items in the ARRAY_STRUCTURE category record the organization and 
     encoding of array data which may be stored in the ARRAY_DATA category.
;
    _category.id                   array_structure
    _category.mandatory_code       no
    _category_key.name             '_array_structure.id'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
    Example 1 -
;
;
     loop_
    _array_structure.id 
    _array_structure.encoding_type        
    _array_structure.compression_type     
    _array_structure.byte_order           
     image_1       "unsigned 16-bit integer"  none  little_endian
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__array_structure.byte_order
    _item_description.description
;
               The order of bytes for integer values which require more
               than 1-byte. 

               (IBM-PC's and compatibles, and Dec-Vaxes use low-byte-first
               ordered integers, whereas Hewlett Packard 700 
               series, Sun-4 and Silicon Graphics use high-byte-first
               ordered integers.  Dec-Alphas can produce/use either
               depending on a compiler switch.)
;

    _item.name                     '_array_structure.byte_order'
    _item.category_id               array_structure
    _item.mandatory_code            yes 
    _item_type.code                 code
     loop_
    _item_enumeration.value        
    _item_enumeration.detail        
                                   'big_endian'
;
        The first byte in the byte stream of the bytes which make up an 
        integer value is the most significant byte of an integer. 
;
                                   'little_endian'
;
        The last byte in the byte stream of the bytes which make up an 
        integer value is the most significant byte of an integer.
;
     save_
 
 
save__array_structure.compression_type 
    _item_description.description
;
              Type of data compression method used to compress the array
              data. 
;
    _item.name                   '_array_structure.compression_type'
    _item.category_id             array_structure
    _item.mandatory_code          no 
    _item_type.code               code
    _item_default.value           'none'
     loop_
    _item_enumeration.value       
    _item_enumeration.detail
                                  'none'
;
        Data are stored in normal format as defined by 
        _array_structure.encoding_type and _array_structure.byte_order .
;
                                  'byte_offsets'
;
        Using the compression scheme defined in CBF definition
        Section 5.0.
;
                                  'packed'
;
        Using the 'packed' compression scheme, a CCP4-style packing
        (CBFlib section 3.3.2)
;
                                  'canonical'
;
        Using the 'canonical' compression scheme (CBFlib section
        3.3.1)
;
    save_
 
 
save__array_structure.encoding_type
    _item_description.description
;
               Data encoding of a single element of array data. 
               
               In several cases, the IEEE format is referenced.
               See "IEEE Standard for Binary Floating-Point Arithmetic",
               ANSI/IEEE Std 754-1985, the Institute of Electrical and
               Electronics Engineers, Inc., NY 1985.  
;

    _item.name                '_array_structure.encoding_type'
    _item.category_id          array_structure
    _item.mandatory_code       yes 
    _item_type.code            uline
     loop_
    _item_enumeration.value   
                              'unsigned 8-bit integer'
                              'signed 8-bit integer'
                              'unsigned 16-bit integer'
                              'signed 16-bit_integer'
                              'unsigned 32-bit integer'
                              'signed 32-bit integer'
                              'signed 32-bit real IEEE'
                              'signed 64-bit real IEEE'
                              'signed 32-bit complex IEEE'
     save_
 
 
save__array_structure.id
    _item_description.description
;             The value of _array_structure.id must uniquely identify 
              each item of array data. 
;
    loop_
    _item.name                  
    _item.category_id             
    _item.mandatory_code          
             '_array_structure.id'              array_structure      yes
             '_array_data.array_id'             array_data           yes
             '_array_structure_list.array_id'   array_structure_list yes
             '_array_intensities.array_id'      array_intensities    yes
             '_diffrn_frame_data.array_id'      diffrn_frame_data    yes
 

    _item_type.code               code
     loop_
    _item_linked.child_name
    _item_linked.parent_name
             '_array_data.array_id'             '_array_structure.id'
             '_array_structure_list.array_id'   '_array_structure.id'
             '_array_intensities.array_id'      '_array_structure.id'
             '_diffrn_frame_data.array_id'      '_array_structure.id'

     save_
 
 
########################
# ARRAY_STRUCTURE_LIST #
########################
 
 
save_ARRAY_STRUCTURE_LIST
    _category.description
;
     Data items in the ARRAY_STRUCTURE_LIST category record the size 
     and organization of each array dimension.
;
    _category.id                   array_structure_list
    _category.mandatory_code       no
     loop_
    _category_key.name             '_array_structure_list.array_id'
                                   '_array_structure_list.index'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 1 - An image array of 1300 x 1200 elements.  The raster 
                    order of the image is left-to-right (increasing) in 
                    first dimension and bottom-to-top (decreasing) in 
                    the second dimension.
;
;
        loop_
       _array_structure_list.array_id  
       _array_structure_list.index
       _array_structure_list.dimension 
       _array_structure_list.precedence 
       _array_structure_list.direction
        image_1   1    1300    1     increasing
        image_1   2    1200    2     decreasing
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__array_structure_list.array_id
    _item_description.description
;             
              This item is a pointer to _array_structure.id in the
              ATOM_STRUCTURE category. 
;
    _item.name                  '_array_structure_list.array_id'
    _item.category_id             array_structure_list
    _item.mandatory_code          yes
    _item_type.code               code
save_
 
 
save__array_structure_list.dimension
    _item_description.description
;              
               The number of elements stored in the array structure in this 
               dimension.
;
    _item.name                '_array_structure_list.dimension'
    _item.category_id          array_structure_list
    _item.mandatory_code       yes 
    _item_type.code            int
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            1  1
                            .  1
     save_
 
 
save__array_structure_list.direction
    _item_description.description
;
              Identifies the direction in which this array index changes.
;
    _item.name                '_array_structure_list.direction'
    _item.category_id          array_structure_list
    _item.mandatory_code       yes 
    _item_type.code            int
     loop_
    _item_enumeration.value
    _item_enumeration.detail        

                              'increasing'
;
         Indicates the index changes from 1 to the maximum dimension.
;
                              'decreasing'
;
         Indicates the index changes from the maximum dimension to 1.
;
     save_
 
 
save__array_structure_list.index
    _item_description.description
;              
               Identifies the one-based index of the row or column in the
               array structure.
;
     loop_
    _item.name                
    _item.category_id          
    _item.mandatory_code       
           '_array_structure_list.index'        array_structure_list   yes
           '_array_structure_list.precedence'   array_structure_list   yes
           '_array_element_size.index'          array_element_size     yes

    _item_type.code            int

     loop_
    _item_linked.child_name
    _item_linked.parent_name
          '_array_element_size.index'         '_array_structure_list.index'
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            1  1
                            .  1
     save_
 
 
save__array_structure_list.precedence
    _item_description.description
;
               Identifies the rank order in which this array index changes 
               with respect to other array indices.  The precedence of 1  
               indicates the index which changes fastest.
;
    _item.name                '_array_structure_list.precedence'
    _item.category_id          array_structure_list
    _item.mandatory_code       yes 
    _item_type.code            int
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            1  1
                            .  1
     save_
 
 
########
# AXIS #
########

save_AXIS
    _category.description
;
     Data items in the AXIS category record the information required
     to describe the various goniometer, detector, source and other
     axes needed to specify a data collection.  The location of each
     axis is specified by two vectors: the axis itself, given as a unit
     vector, and an offset to the base of the unit vector.  These vectors
     are referenced to a right-handed laboratory coordinate system with
     its origin in the sample or specimen:
     
                             | Y (to complete right-handed system)
                             |
                             |
                             |
                             |
                             |
                             |________________X
                            /       principal goniometer axis
                           /
                          /
                         /
                        /
                       /Z (to source)
 
 
                                                      
     Axis 1 (X): The X-axis is aligned to the mechanical axis pointing from
     the sample or specimen along the  principal axis of the goniometer.
     
     Axis 2 (Y): The Y-axis completes an orthogonal right-handed system
     defined by the X-axis and the Z-axis (see below).
     
     Axis 3 (Z): The Z-axis is derived from the source axis which goes from 
     the sample to the source.  The Z-axis is the component of the source axis
     in the direction of the source orthogonal to the X-axis in the plane 
     defined by the X-axis and the source axis.
          
     These axes are based on the goniometer, not on the orientation of the 
     detector, gravity, etc.  The vectors necessary to specify all other
     axes are given by sets of three components in the order (X, Y, Z).
     If the axis involved is a rotation axis, it is right handed, i.e. as
     one views the object to be rotated from the origin (the tail) of the 
     unit vector, the rotation is clockwise.  If a translation axis is
     specified, the direction of the unit vector specifies the sense of
     positive translation.
     
     All rotations are given in degrees and all translations are given in mm.
     
     Axes may be dependent on one another.  The X-axis is the only goniometer
     axis the direction of which is strictly connected to the hardware.  All
     other axes are specified by the positions they would assume when the
     axes upon which they depend are at their zero points.
     
     When specifying detector axes, the axis is given to the beam center.
     The location of the beam center on the detector should be given in the
     DIFFRN_DETECTOR category in distortion-corrected mm from the (0,0) corner
     of the detector.
     
     It should be noted that many different origins arise in the definition
     of an experiment.  In particular, as noted above, we need to specify the
     location of the beam center on the detector in terms of the origin of the
     detector, which is, of course, not coincident with the center of the
     sample.  
;
    _category.id                   axis
    _category.mandatory_code       no
     loop_
    _category_key.name          '_axis.id' 
                                '_axis.equipment'               
     loop_
    _category_group.id           'inclusive_group'
                                 'axis_group'
                                 'diffrn_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 1 -
        
        This example shows the axis specification of the axes of a kappa
        geometry goniometer (See "X-Ray Structure Determination, A Practical
        Guide", 2nd ed. by  G. H. Stout, L. H. Jensen, Wiley Interscience,
        1989, 453 pp, p 134.).
        
        There are three axes specified, and no offsets.  The outermost axis,
        omega, is pointed along the X-axis.  The next innermost axis, kappa,
        is at a 50 degree angle to the X-axis, pointed away from the source.
        The innermost axis, phi, aligns with the X-axis when omega and
        phi are at their zero-points.  If T-omega, T-kappa and T-phi
        are the transformation matrices derived from the axis settings,
        the complete transformation would be:
            x' = (T-omega) (T-kappa) (T-phi) x
;
;
         loop_
        _axis.id
        _axis.type
        _axis.equipment
        _axis.depends_on
        _axis.vector[1] _axis.vector[2] _axis.vector[3]
        omega rotation goniometer     .    1        0        0
        kappa rotation goniometer omega    -.64279  0       -.76604
        phi   rotation goniometer kappa    1        0        0   
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 2 -
        
        This example show the axis specification of the axes of a
        detector, source and gravity.  We have juggled the order as a
        reminder that the ordering of presentation of tokens is not
        significant.  We have taken the center of rotation of the detector
        to be 68 millimetres in the direction away from the source.
;
;
        loop_
        _axis.id
        _axis.type
        _axis.equipment
        _axis.depends_on
        _axis.vector[1] _axis.vector[2] _axis.vector[3]
        _axis.offset[1] _axis.offset[2] _axis.offset[3]
        source       .        source     .       0     0     1   . . .
        gravity      .        gravity    .       0    -1     0   . . .
        tranz     translation detector rotz      0     0     1   0 0 -68
        twotheta  rotation    detector   .       1     0     0   . . .
        roty      rotation    detector twotheta  0     1     0   0 0 -68
        rotz      rotation    detector roty      0     0     1   0 0 -68
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__axis.depends_on
    _item_description.description
;             The value of  _axis.type specifies the next outermost
              axis upon which this axis depends.
              
              This item is a pointer to axis.id in the same category.
;
    _item.name                      '_axis.depends_on'
    _item.category_id                 axis
    _item.mandatory_code              no

     save_
 
 
save__axis.equipment
    _item_description.description
;             The value of  _axis.type specifies the type of equipment
              using the axis:  goniometer, detector, gravity, source
              or general
;
    _item.name                      '_axis.equipment'
    _item.category_id                 axis
    _item.mandatory_code              no
    _item_type.code                   ucode
    _item_default.value               general
     loop_
    _item_enumeration.value
    _item_enumeration.detail   goniometer
                              'equipment used to orient or position samples'
                               detector
                              'equipment used to detect reflections'
                               general
                              'equipment used for general purposes'
                               gravity
                              'axis specifying the downward direction'
                               source
                              'axis specifying the direction sample to source'

     save_
 
 
save__axis.offset[1]
    _item_description.description
;              The [1] element of the 3-element vector used to specify
               the offset to the base of a rotation or translation axis.
               
               The vector is specified in millimetres
;
    _item.name                  '_axis.offset[1]'
    _item.category_id             axis
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
    _item_units.code              millimetres
     save_
 
 
save__axis.offset[2]
    _item_description.description
;              The [2] element of the 3-element vector used to specify
               the offset to the base of a rotation or translation axis.
               
               The vector is specified in millimetres
;
    _item.name                  '_axis.offset[2]'
    _item.category_id             axis
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
    _item_units.code              millimetres
     save_
 
 
save__axis.offset[3]
    _item_description.description
;              The [3] element of the 3-element vector used to specify
               the offset to the base of a rotation or translation axis.
               
               The vector is specified in millimetres
;
    _item.name                  '_axis.offset[3]'
    _item.category_id             axis
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
    _item_units.code              millimetres
     save_
 
 
save__axis.id
    _item_description.description
;             The value of _axis.id must uniquely identify
              each axis relevant to the experiment.  Note that multiple
              pieces of equipment may share the same axis (e.g. a twotheta
              arm), so that the category key for AXIS also includes the
              equipment.
;
    loop_
    _item.name
    _item.category_id
    _item.mandatory_code
         '_axis.id'                         axis                   yes
         '_diffrn_detector_axis.axis_id'    diffrn_detector_axis    yes
         '_diffrn_measurement_axis.axis_id' diffrn_measurement_axis yes
         '_diffrn_scan_axis.axis_id'        diffrn_scan_axis        yes
         '_diffrn_scan_frame_axis.axis_id'  diffrn_scan_frame_axis  yes

    _item_type.code               code
     loop_
    _item_linked.child_name
    _item_linked.parent_name
         '_axis.depends_on'                   '_axis.id'
         '_diffrn_detector_axis.axis_id'      '_axis.id'
         '_diffrn_measurement_axis.axis_id'   '_axis.id'
         '_diffrn_scan_axis.axis_id'          '_axis.id'      
         '_diffrn_scan_frame_axis.axis_id'    '_axis.id'

     save_
 
 
save__axis.type
    _item_description.description
;             The value of _axis.type specifies the type of
              axis:  rotation, translation (or general when the type is
              not relevant, as for gravity)
;
    _item.name                      '_axis.type'
    _item.category_id                 axis
    _item.mandatory_code              no
    _item_type.code                   ucode
    _item_default.value               general
     loop_
    _item_enumeration.value
    _item_enumeration.detail      rotation
                                 'right-handed axis of rotation'
                                  translation
                                 'translation in the direction of the axis'
                                  general
                                 'axis for which the type is not relevant'

     save_


save__axis.vector[1]
    _item_description.description
;              The [1] element of the 3-element vector used to specify
               the direction of a rotation or translation axis.
               The vector should be normalized to be a unit vector, and
               is dimensionless.
;
    _item.name                  '_axis.vector[1]'
    _item.category_id             axis
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
     save_

save__axis.vector[2]
    _item_description.description
;              The [2] element of the 3-element vector used to specify
               the direction of a rotation or translation axis.
               The vector should be normalized to be a unit vector, and
               is dimensionless.
;
    _item.name                  '_axis.vector[2]'
    _item.category_id             axis
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
     save_

save__axis.vector[3]
    _item_description.description
;              The [3] element of the 3-element vector used to specify
               the direction of a rotation or translation axis.
               The vector should be normalized to be a unit vector, and
               is dimensionless.
;
    _item.name                  '_axis.vector[3]'
    _item.category_id             axis
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
     save_
 
 
##########################################################################
#  The following is a restatement of the mmCIF DIFFRN_DETECTOR and       #
#  DIFFRN_MEASUREMENT categories, modified for the CBF/imgCIF extensions #
##########################################################################

###################
# DIFFRN_DETECTOR #
###################
 
 
save_DIFFRN_DETECTOR
    _category.description
;              Data items in the DIFFRN_DETECTOR category describe the 
               detector used to measure the scattered radiation, including
               any analyser and post-sample collimation.
;
    _category.id                  diffrn_detector
    _category.mandatory_code      no
     loop_
    _category_key.name          '_diffrn_detector.diffrn_id'
                                '_diffrn_detector.id'
     loop_
    _category_group.id           'inclusive_group'
                                 'diffrn_group'
     loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
    Example 1 - based on PDB entry 5HVP and laboratory records for the
                structure corresponding to PDB entry 5HVP
;
;
    _diffrn_detector.diffrn_id             'd1'
    _diffrn_detector.detector              'multiwire'
    _diffrn_detector.type                  'Siemens'
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__diffrn_detector.details
    _item_description.description
;              A description of special aspects of the radiation detector.
;
    _item.name                  '_diffrn_detector.details'
    _item.category_id             diffrn_detector
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_detector_details'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
    _item_examples.case
;                                 Need new example here.
;
     save_
 
 
save__diffrn_detector.detector
    _item_description.description
;              The general class of the radiation detector.
;
    _item.name                  '_diffrn_detector.detector'
    _item.category_id             diffrn_detector
    _item.mandatory_code          no
     loop_
    _item_aliases.alias_name
    _item_aliases.dictionary
    _item_aliases.version       '_diffrn_radiation_detector'
                                  cifdic.c91
                                  1.0
                                '_diffrn_detector'
                                  cif_core.dic
                                  2.0
    _item_type.code               text
     loop_
    _item_examples.case          'photographic film'
                                 'scintillation counter'
                                 'CCD plate'
                                 'BF~3~ counter'
     save_
 
 
save__diffrn_detector.diffrn_id
    _item_description.description
;              This data item is a pointer to _diffrn.id in the DIFFRN
               category.

               The value of _diffrn.id uniquely defines a set of
               diffraction data.
;
    _item.name                  '_diffrn_detector.diffrn_id'
    _item.mandatory_code          yes
     save_
 
 
save__diffrn_detector.dtime
    _item_description.description
;              The deadtime in microseconds of the detectors used to measure
               the diffraction intensities.
;
    _item.name                  '_diffrn_detector.dtime'
    _item.category_id             diffrn_detector
    _item.mandatory_code          no
     loop_
    _item_aliases.alias_name
    _item_aliases.dictionary
    _item_aliases.version       '_diffrn_radiation_detector_dtime'
                                  cifdic.c91
                                  1.0
                                '_diffrn_detector_dtime'
                                  cif_core.dic
                                  2.0
     loop_  
    _item_range.maximum           
    _item_range.minimum            .    0.0
                                  0.0   0.0
    _item_type.code               float
    _item_units.code              microseconds
     save_
 
 
save__diffrn_detector.id
    _item_description.description
;             
               The value of _diffrn_detector.id must uniquely identify
               each detector used to collect each diffraction data set.

               If the value of _diffrn_detector.id is not given, it is
               implicitly equal to the value of _diffrn_detector.diffrn_id
;
     loop_
    _item.name                 
    _item.category_id
    _item.mandatory_code
             '_diffrn_detector.id'         diffrn_detector       implicit
             '_diffrn_detector_axis.id'    diffrn_detector_axis       yes
     loop_
    _item_linked.child_name
    _item_linked.parent_name
             '_diffrn_detector_axis.id'     '_diffrn_detector.id'

    _item_type.code               code
     save_
 
 
save__diffrn_detector.number_of_axes
    _item_description.description
;             
               The value of _diffrn_detector.number_of_axes gives the 
               number of axes of the positioner for the detector identified 
               by _diffrn_detector.id
               
               The word "positioner" is a general term used in instrumentation
               design for devices that are used to change the positions of 
               portions of apparatus by linear translation, rotation, or 
               combinations of such motions.

               The description of each axis should be provided by entries 
               in DIFFRN_DETECTOR_AXIS.
;
    _item.name                  '_diffrn_detector.number_of_axes'
    _item.category_id             diffrn_detector
    _item.mandatory_code          no
     loop_
    _item_range.maximum
    _item_range.minimum           .   1
                                  1   1
    _item_type.code               int
     save_
 
 
save__diffrn_detector.type
    _item_description.description
;              The make, model or name of the detector device used.
;
    _item.name                  '_diffrn_detector.type'
    _item.category_id             diffrn_detector
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_detector_type'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
     save_
 
 
########################
# DIFFRN_DETECTOR_AXIS #
########################
 
 
save_DIFFRN_DETECTOR_AXIS
    _category.description
;
     Data items in the DIFFRN_DETECTOR_AXIS category associate
     axes with detectors.
;
    _category.id                   diffrn_detector_axis
    _category.mandatory_code       no
     loop_
    _category_key.name          '_diffrn_detector_axis.id'
                                '_diffrn_detector_axis.axis_id'
     loop_
    _category_group.id           'inclusive_group'
                                 'diffrn_group'
     save_
 
 
save__diffrn_detector_axis.id
    _item_description.description
;
               This data item is a pointer to _diffrn_detector.id in
               the DIFFRN_DETECTOR category.
;
    _item.name                  '_diffrn_detector_axis.id'
    _item.category_id             diffrn_detector_axis
    _item.mandatory_code          yes
     save_
 
 
save__diffrn_detector_axis.axis_id
    _item_description.description
;
               This data item is a pointer to _axis.id in
               the AXIS category.
;
    _item.name                  '_diffrn_detector_axis.axis_id'
    _item.category_id             diffrn_detector_axis
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
###########################
# DIFFRN_DETECTOR_ELEMENT #
###########################
 
 
save_DIFFRN_DETECTOR_ELEMENT
    _category.description
;
              Data items in the DIFFRN_DETECTOR_ELEMENT category record
              the details about spatial layout and other characteristics
              of each element of a detector which may have multiple elements.  
 
 
     DRAFT NOTE:    

              This category is intended to hold definitions which are 
              specific to the elements of area/array detectors. Generic
              features about the detector class are defined in the existing
              mmCIF category DIFFRN_DETECTOR.   
;
    _category.id                   diffrn_detector_element
    _category.mandatory_code       no
     loop_
    _category_key.name             '_diffrn_detector_element.id'
                                   '_diffrn_detector_element.detector_id'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
        Example 1 - Detector d1 is composed of four CCD detector elements,
        each 200 mm by 200 mm, arranged in a square. in the pattern
                    
                   1     2
                      *
                   3     4

        Note that the beam center is slightly off of each of the
        detector elements, just beyond the lower right corner of 1,
        the lower left corner of 2, the upper right corner of 3 and
        the upper left corner of 4.
;
;
        loop_
        _diffrn_detector_element.id
        _diffrn_detector_element.detector_id
        _diffrn_detector_element.center[1]
        _diffrn_detector_element.center[2]
        d1     d1_ccd_1  201.5 -1.5
        d1     d1_ccd_2  -1.8  -1.5
        d1     d1_ccd_3  201.6 201.4    
        d1     d1_ccd_4  -1.7  201.5
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    save_


save__diffrn_detector_element.center[1]
    _item_description.description
;             
              The value of _diffrn_detector_element.center[1] is the X
              component of the distortion-corrected beam-center in mm from the
              (0, 0) (lower left) corner of the detector element viewed from 
              the sample side.
;
    _item.name                  '_diffrn_detector_element.center[1]'
    _item.category_id             diffrn_detector_element
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
    _item_units.code              millimetres

    save_
    
save__diffrn_detector_element.center[2]
    _item_description.description
;             
              The value of _diffrn_detector_element.center[2] is the Y
              component of the distortion-corrected beam-center in mm from the
              (0, 0) (lower left) corner of the detector element viewed from 
              the sample side.
;
    _item.name                  '_diffrn_detector_element.center[2]'
    _item.category_id             diffrn_detector_element
    _item.mandatory_code          no
    _item_default.value           0.0
    _item_sub_category.id         vector
    _item_type.code               float
    _item_units.code              millimetres

    save_
 
 
save__diffrn_detector_element.id
    _item_description.description
;             
              The value of _diffrn_detector_element.id must uniquely identify
              each element of a detector.
;
     loop_
    _item.name                
    _item.category_id          
    _item.mandatory_code       
           '_diffrn_detector_element.id'
           diffrn_detector_element
           yes
    _item_type.code               code
     loop_
    _item_linked.child_name
    _item_linked.parent_name
           '_diffrn_frame_data.detector_element_id'
           '_diffrn_detector_element.id'

     save_
 
 
save__diffrn_detector_element.detector_id
    _item_description.description
;             
               This item is a pointer to _diffrn_detector.id
               in the DIFFRN_DETECTOR category. 
;
    _item.name                  '_diffrn_detector_element.detector_id'
    _item.category_id             diffrn_detector_element
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
#####################
# DIFFRN_FRAME_DATA #
#####################
 
 
save_DIFFRN_FRAME_DATA
    _category.description
;
              Data items in the DIFFRN_FRAME_DATA category record
              the details about each frame of data. 
;
    _category.id                   diffrn_frame_data
    _category.mandatory_code       no
     loop_
    _category_key.name             '_diffrn_frame_data.id'
                                   '_diffrn_frame_data.detector_element_id'
    loop_
    _category_group.id             'inclusive_group'
                                   'array_data_group'
    loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
    Example 1 - A frame containing data from 4 frame elements.
                Each frame element has a common array configuration
                'array_1' described in ARRAY_STRUCTURE and related
                categories.  The data for each detector element is 
                stored in four groups of binary data in the
                ARRAY_DATA category, linked by the array_id and
                binary_id
;
;
        loop_
        _diffrn_frame_data.id
        _diffrn_frame_data.detector_element_id
        _diffrn_frame_data.array_id
        _diffrn_frame_data.binary_id
        frame_1   d1_ccd_1  array_1  1  
        frame_1   d1_ccd_2  array_1  2 
        frame_1   d1_ccd_3  array_1  3 
        frame_1   d1_ccd_4  array_1  4 
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    save_
 
 
save__diffrn_frame_data.array_id
    _item_description.description
;             
              This item is a pointer to _array_structure.id in the
              ARRAY_STRUCTURE category. 
;
    _item.name                  '_diffrn_frame_data.array_id'
    _item.category_id             diffrn_frame_data
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
save__diffrn_frame_data.binary_id
    _item_description.description
;             This item is a pointer to _array_data.binary_id in the
              ARRAY_STRUCTURE category. 
;
    _item.name                  '_diffrn_frame_data.binary_id'
    _item.category_id             diffrn_frame_data
    _item.mandatory_code          implicit
    _item_type.code               int
     save_
 
 
save__diffrn_frame_data.detector_element_id
    _item_description.description
;             
               This item is a pointer to _diffrn_detector_element.id
               in the DIFFRN_DETECTOR_ELEMENT category. 
;
    _item.name                  '_diffrn_frame_data.detector_element_id'
    _item.category_id             diffrn_frame_data
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
save__diffrn_frame_data.id
    _item_description.description
;             
              The value of _diffrn_frame_data.id must uniquely identify
              each complete frame of data.
;
     loop_
    _item.name                
    _item.category_id          
    _item.mandatory_code       
           '_diffrn_frame_data.id'        diffrn_frame_data  yes
           '_diffrn_refln.frame_id'       diffrn_refln       yes
           '_diffrn_scan.frame_id_start'  diffrn_scan        yes
           '_diffrn_scan.frame_id_end'    diffrn_scan        yes
           '_diffrn_scan_frame.frame_id'  diffrn_scan_frame  yes
           '_diffrn_scan_frame_axis.frame_id'  
                                          diffrn_scan_frame_axis
                                                             yes
    _item_type.code               code
     loop_
    _item_linked.child_name
    _item_linked.parent_name
           '_diffrn_refln.frame_id'        '_diffrn_frame_data.id'
           '_diffrn_scan.frame_id_start'   '_diffrn_frame_data.id'
           '_diffrn_scan.frame_id_end'     '_diffrn_frame_data.id'
           '_diffrn_scan_frame.frame_id'   '_diffrn_frame_data.id'
           '_diffrn_scan_frame_axis.frame_id'
                                           '_diffrn_frame_data.id'
     save_
 
 
########################
## DIFFRN_MEASUREMENT ##
########################
 
 
save_DIFFRN_MEASUREMENT
    _category.description
;              Data items in the DIFFRN_MEASUREMENT category record details
               about the device used to orient and/or position the crystal
               during data measurement and the manner in which the diffraction
               data were measured.
;
    _category.id                  diffrn_measurement
    _category.mandatory_code      no
     loop_
    _category_key.name          '_diffrn_measurement.diffrn_id'
                                '_diffrn_measurement.id'
     loop_
    _category_group.id           'inclusive_group'
                                 'diffrn_group'
     loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
    Example 1 - based on PDB entry 5HVP and laboratory records for the
                structure corresponding to PDB entry 5HVP
;
;
    _diffrn_measurement.diffrn_id          'd1'
    _diffrn_measurement.device             '3-circle camera'
    _diffrn_measurement.device_type        'Supper model x'
    _diffrn_measurement.device_details     'none'
    _diffrn_measurement.method             'omega scan'
    _diffrn_measurement.details
    ; Need new example here
    ;
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
    Example 2 - based on data set TOZ of Willis, Beckwith & Tozer [(1991).
                Acta Cryst. C47, 2276-2277].
;
;
    _diffrn_measurement.diffrn_id       's1'
    _diffrn_measurement.device_type     'Philips PW1100/20 diffractometer'
    _diffrn_measurement.method          'theta/2theta (\q/2\q)'
;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     save_
 
 
save__diffrn_measurement.device
    _item_description.description
;              The general class of  goniometer or device used to support and
               orient the specimen.
;
    _item.name                  '_diffrn_measurement.device'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_measurement_device'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
     loop_
    _item_examples.case          '3-circle camera'
                                 '4-circle camera'
                                 'kappa-geometry camera'
                                 'oscillation camera'
                                 'precession camera'
     save_
 
 
save__diffrn_measurement.device_details
    _item_description.description
;              A description of special aspects of the device used to measure
               the diffraction intensities.
;
    _item.name                  '_diffrn_measurement.device_details'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_measurement_device_details'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
    _item_examples.case
;                                 commercial goniometer modified locally to
                                  allow for 90\% \t arc
;
     save_
 
 
save__diffrn_measurement.device_type
    _item_description.description
;              The make, model or name of the measurement device
               (goniometer) used.
;
    _item.name                  '_diffrn_measurement.device_type'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_measurement_device_type'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
     loop_
    _item_examples.case          'Supper model q'
                                 'Huber model r'
                                 'Enraf-Nonius model s'
                                 'homemade'
     save_
 
 
save__diffrn_measurement.diffrn_id
    _item_description.description
;              This data item is a pointer to _diffrn.id in the DIFFRN 
               category.
;
    _item.name                  '_diffrn_measurement.diffrn_id'
    _item.mandatory_code          yes
     save_
 
 
save__diffrn_measurement.details
    _item_description.description
;              A description of special aspects of the intensity measurement.
;
    _item.name                  '_diffrn_measurement.details'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_measurement_details'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
    _item_examples.case
;                                 440 frames, 0.20 degrees, 150 sec, detector
                                  distance 12 cm, detector angle 22.5 degrees
;
     save_
 
 
save__diffrn_measurement.id
    _item_description.description
;             
               The value of _diffrn_measurement.id must uniquely identify
               the set of mechanical characteristics of the device used to 
               orient and/or position the sample used during collection 
               of each diffraction data set.

               If the value of _diffrn_measurement.id is not given, it is
               implicitly equal to the value of _diffrn_measurement.diffrn_id
;
     loop_
    _item.name                 
    _item.category_id
    _item.mandatory_code
             '_diffrn_measurement.id'      diffrn_measurement     implicit
             '_diffrn_measurement_axis.id' diffrn_measurement_axis     yes
     loop_
    _item_linked.child_name
    _item_linked.parent_name
             '_diffrn_measurement_axis.id'  '_diffrn_measurement.id'

    _item_type.code               code
     save_
 
 
save__diffrn_measurement.method
    _item_description.description
;              Method used to measure intensities.
;
    _item.name                  '_diffrn_measurement.method'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_measurement_method'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
    _item_examples.case          'profile data from theta/2theta (\q/2\q) scans'
     save_
 
 
save__diffrn_measurement.number_of_axes
    _item_description.description
;             
               The value of _diffrn_measurement.number_of_axes gives the 
               number of axes of the positioner for the goniometer or
               other sample orientation or positioning device identified 
               by _diffrn_measurement.id

               The description of the axes should be provided by entries in 
               DIFFRN_MEASUREMENT_AXIS.
;
    _item.name                  '_diffrn_measurement.number_of_axes'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
     loop_
    _item_range.maximum
    _item_range.minimum           .   1
                                  1   1
    _item_type.code               int
     save_
 
 
save__diffrn_measurement.specimen_support
    _item_description.description
;              The physical device used to support the crystal during data
               collection.
;
    _item.name                  '_diffrn_measurement.specimen_support'
    _item.category_id             diffrn_measurement
    _item.mandatory_code          no
    _item_aliases.alias_name    '_diffrn_measurement_specimen_support'
    _item_aliases.dictionary      cif_core.dic
    _item_aliases.version         2.0.1
    _item_type.code               text
     loop_
    _item_examples.case          'glass capillary'
                                 'quartz capillary'
                                 'fiber'
                                 'metal loop'
     save_
 
 
###########################
# DIFFRN_MEASUREMENT_AXIS #
###########################
 
 
save_DIFFRN_MEASUREMENT_AXIS
    _category.description
;
     Data items in the DIFFRN_MEASUREMENT_AXIS category associate
     axes with goniometers.
;
    _category.id                   diffrn_measurement_axis
    _category.mandatory_code       no
     loop_
    _category_key.name          '_diffrn_measurement_axis.id'
                                '_diffrn_measurement_axis.axis_id'
     loop_
    _category_group.id           'inclusive_group'
                                 'diffrn_group'
     save_
 
 
save__diffrn_measurement_axis.id
    _item_description.description
;
               This data item is a pointer to _diffrn_measurement.id in
               the DIFFRN_MEASUREMENT category.
;
    _item.name                  '_diffrn_measurement_axis.id'
    _item.category_id             diffrn_measurement_axis
    _item.mandatory_code          yes
     save_
 
 
save__diffrn_measurement_axis.axis_id
    _item_description.description
;
               This data item is a pointer to _axis.id in
               the AXIS category.
;
    _item.name                  '_diffrn_measurement_axis.axis_id'
    _item.category_id             diffrn_measurement_axis
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
################
# DIFFRN_REFLN #
################
 
 
save_DIFFRN_REFLN
    _category.description 
;
     This category redefinition has been added to extend the key of 
     the standard DIFFRN_REFLN category.
;
    _category.id                   diffrn_refln
    _category.mandatory_code       no
    _category_key.name             '_diffrn_refln.frame_id'
     loop_
    _category_group.id             'inclusive_group'
                                   'diffrn_group'
     save_
 
 
save__diffrn_refln.frame_id
    _item_description.description
;             
               This item is a pointer to _diffrn_frame_data.id
               in the DIFFRN_FRAME_DATA category. 
;
    _item.name                  '_diffrn_refln.frame_id'
    _item.category_id             diffrn_refln
    _item.mandatory_code          yes
    _item_type.code               code
     save_
 
 
###############
# DIFFRN_SCAN #
###############

save_DIFFRN_SCAN
    _category.description 
;
     Data items in the DIFFRN_SCAN category describe the parameters of one
     or more scans, relating axis positions to frames.

;
    _category.id                   diffrn_scan
    _category.mandatory_code       no
    _category_key.name            '_diffrn_scan.id'
     loop_
    _category_group.id            'inclusive_group'
                                  'diffrn_group'
     loop_
    _category_examples.detail
    _category_examples.case
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
    Example 1 - derived from a suggestion by R. M. Sweet.

   The vector of each axis is not given here, because it is provided in
   the AXIS category.  By making _diffrn_scan_axis.scan_id and
   _diffrn_scan_axis.axis_id keys of the DIFFRN_SCAN_AXIS category,
   an arbitrary number of scanning and fixed axes can be specified for a 
   scan.  We have specified three rotation axes and one translation axis 
   at non-zero values, with one axis stepping.  There is no reason why 
   more axes could not have been specified to step.   We have specified
   range information, but note that it is redundant from the  number of 
   frames and the increment, so we could drop the data item
   _diffrn_scan_axis.angle_range .
   
   We have specified both the sweep data and the data for a single frame.
 
;
;
      _diffrn_scan.id                   1
      _diffrn_scan.integration_time    3.0
      _diffrn_scan.frame_id_start      mad_L2_000
      _diffrn_scan.frame_id_end        mad_L2_200
      _diffrn_scan.frames              201

       loop_
      _diffrn_scan_axis.scan_id
      _diffrn_scan_axis.axis_id
      _diffrn_scan_axis.angle_start
      _diffrn_scan_axis.angle_range
      _diffrn_scan_axis.angle_increment
      _diffrn_scan_axis.displacement_start
      _diffrn_scan_axis.displacement_range
      _diffrn_scan_axis.displacement_increment

       1 omega 200.0 20.0 0.1 . . . 
       1 kappa -40.0  0.0 0.0 . . . 
       1 phi   127.5  0.0 0.0 . . . 
       1 tranz  . . .   2.3 0.0 0.0 

      _diffrn_scan_frame.scan_id                   1
      _diffrn_scan_frame.integration_time    3.0
      _diffrn_scan_frame.frame_id            mad_L2_018
      _diffrn_scan_frame.frame_number        18

      loop_
      _diffrn_scan_frame_axis.frame_id
      _diffrn_scan_frame_axis.axis_id
      _diffrn_scan_frame_axis.angle
      _diffrn_scan_frame_axis.displacement

       mad_L2_018 omega 201.8  . 
       mad_L2_018 kappa -40.0  . 
       mad_L2_018 phi   127.5  . 
       mad_L2_018 tranz  .    2.3 

;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       save_
 
 
save__diffrn_scan.id
    _item_description.description
;             The value of _diffrn_scan.id uniquely identifies each
              scan.  The identifier is used to tie together all the 
              information about the scan.
;
     loop_
    _item.name                
    _item.category_id          
    _item.mandatory_code       
       '_diffrn_scan.id'                 diffrn_scan             yes
       '_diffrn_scan_axis.scan_id'       diffrn_scan_axis        yes
       '_diffrn_scan_frame.scan_id'      diffrn_scan_frame       yes
    _item_type.code               code
     loop_
    _item_linked.child_name
    _item_linked.parent_name
       '_diffrn_scan_axis.scan_id'          '_diffrn_scan.id'
       '_diffrn_scan_frame.scan_id'         '_diffrn_scan.id'
     save_
 
 
save__diffrn_scan.integration_time
    _item_description.description
;
               The time in seconds to integrate each step of the scan.
;
    _item.name                 '_diffrn_scan.integration_time'
    _item.category_id          diffrn_scan
    _item.mandatory_code       yes
    _item_type.code            float
    _item_units.code           'seconds'
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            .   0.0
     save_
 
 
save__diffrn_scan.frame_id_start
    _item_description.description
;
               The value of this data item is the identifier of the
               first frame in the scan.

               This item is a pointer to _diffrn_frame_data.id in the
               DIFFRN_FRAME_DATA category.
;
    _item.name                 '_diffrn_scan.frame_id_start'
    _item.category_id          diffrn_scan
    _item.mandatory_code       yes
     save_
 
 
save__diffrn_scan.frame_id_end
    _item_description.description
;
               The value of this data item is the identifier of the
               last frame in the scan.

               This item is a pointer to _diffrn_frame_data.id in the
               DIFFRN_FRAME_DATA category.
;
    _item.name                 '_diffrn_scan.frame_id_end'
    _item.category_id          diffrn_scan
    _item.mandatory_code       yes 
     save_
 
 
save__diffrn_scan.frames
    _item_description.description
;
               The value of this data item is the number of frames in
               the scan.

;
    _item.name                 '_diffrn_scan.frames'
    _item.category_id          diffrn_scan
    _item.mandatory_code       no 
    _item_type.code            int
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            .   1
                            1   1
     save_
 
 
####################
# DIFFRN_SCAN_AXIS #
####################

save_DIFFRN_SCAN_AXIS
    _category.description 
;
     Data items in the DIFFRN_SCAN_AXIS category describe the settings of
     axes for particular scans.  Unspecified axes are assumed to be at
     their zero points.

;
    _category.id                   diffrn_scan_axis
    _category.mandatory_code       no
     loop_
    _category_key.name            
                                  '_diffrn_scan_axis.scan_id'
                                  '_diffrn_scan_axis.axis_id'
     loop_
    _category_group.id           'inclusive_group'
                                 'diffrn_group'
     save_
 
 
save__diffrn_scan_axis.scan_id
    _item_description.description
;
               The value of this data item is the identifier of the
               scan for which axis settings are being specified.

               Multiple axes may be specified for the same value of
               _diffrn_scan.id

               This item is a pointer to _diffrn_scan.id in the
               DIFFRN_SCAN category.
;
    _item.name                 '_diffrn_scan_axis.scan_id'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       yes
     save_
 
 
save__diffrn_scan_axis.axis_id
    _item_description.description
;
               The value of this data item is the identifier of one of
               the axes for the scan for which settings are being specified.

               Multiple axes may be specified for the same value of
               _diffrn_scan.id .

               This item is a pointer to _axis.id in the
               AXIS category.
;
    _item.name                 '_diffrn_scan_axis.axis_id'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       yes
     save_
 
 
save__diffrn_scan_axis.angle_start
    _item_description.description
;
               The starting position for the specified axis in degrees.
;
    _item.name                 '_diffrn_scan_axis.angle_start'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'degrees'
     save_
 
 
save__diffrn_scan_axis.angle_range
    _item_description.description
;
               The range from the starting position for the specified axis 
               in degrees.
;
    _item.name                 '_diffrn_scan_axis.angle_range'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'degrees'
     save_
 
 
save__diffrn_scan_axis.angle_increment
    _item_description.description
;
               The increment for each step for the specified axis 
               in degrees.
;
    _item.name                 '_diffrn_scan_axis.angle_increment'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'degrees'
     save_
 
 
save__diffrn_scan_axis.displacement_start
    _item_description.description
;
               The starting position for the specified axis in millimetres.
;
    _item.name                 '_diffrn_scan_axis.displacement_start'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'millimetres'
     save_
 
 
save__diffrn_scan_axis.displacement_range
    _item_description.description
;
               The range from the starting position for the specified axis 
               in millimetres.
;
    _item.name                 '_diffrn_scan_axis.displacement_range'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'millimetres'
     save_
 
 
save__diffrn_scan_axis.displacement_increment
    _item_description.description
;
               The increment for each step for the specified axis 
               in millimetres.
;
    _item.name                 '_diffrn_scan_axis.displacement_increment'
    _item.category_id          diffrn_scan_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'millimetres'
     save_
 
 
#####################
# DIFFRN_SCAN_FRAME #
#####################

save_DIFFRN_SCAN_FRAME
    _category.description 
;
     Data items in the DIFFRN_SCAN_FRAME category describe the settings of
     axes for particular frames.  Unspecified axes are assumed to be at
     their zero points.

;
    _category.id                   diffrn_scan_frame
    _category.mandatory_code       no
     loop_
    _category_key.name     
                                  '_diffrn_scan_frame.scan_id'
                                  '_diffrn_scan_frame.frame_id'
     loop_
    _category_group.id            'inclusive_group'
                                  'diffrn_group'
     save_
 
 
save__diffrn_scan_frame.frame_id
    _item_description.description
;
               The value of this data item is the identifier of the
               frame being examined.

               This item is a pointer to _diffrn_frame_data.id in the
               DIFFRN_FRAME_DATA category.
;
    _item.name                 '_diffrn_scan_frame.frame_id'
    _item.category_id          diffrn_scan_frame
    _item.mandatory_code       yes
     save_
 
 
save__diffrn_scan_frame.frame_number
    _item_description.description
;
               The value of this data item is the number of the frame within
               the scan, starting with 1.  It is not necessarily the same as
               the value of _diffrn_scan_frame.frame_id, but may be.

;
    _item.name                 '_diffrn_scan_frame.frame_number'
    _item.category_id          diffrn_scan_frame
    _item.mandatory_code       no 
    _item_type.code            int
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            .   0
                            0   0
     save_
 
 
save__diffrn_scan_frame.integration_time
    _item_description.description
;
               The time in seconds to integrate this step of the scan.
;
    _item.name                 '_diffrn_scan_frame.integration_time'
    _item.category_id          diffrn_scan_frame
    _item.mandatory_code       yes 
    _item_type.code            float
    _item_units.code           'seconds'
     loop_
    _item_range.maximum           
    _item_range.minimum           
                            .   0.0
     save_
 
 
save__diffrn_scan_frame.scan_id
    _item_description.description
;             The value of _diffrn_scan_frame.scan_id identifies the scan
              containing this frame.

              This item is a pointer to _diffrn_scan.id in the
              DIFFRN_SCAN category.
;
     loop_
    _item.name             '_diffrn_scan_frame.scan_id'    
    _item.category_id        diffrn_scan_frame        
    _item.mandatory_code     yes     
     save_
 
 
##########################
# DIFFRN_SCAN_FRAME_AXIS #
##########################

save_DIFFRN_SCAN_FRAME_AXIS
    _category.description
;
     Data items in the DIFFRN_SCAN_FRAME_AXIS category describe the settings
     of axes for particular frames.  Unspecified axes are assumed to be at
     their zero points.

;
    _category.id                   diffrn_scan_frame_axis
    _category.mandatory_code       no
     loop_
    _category_key.name
                                  '_diffrn_scan_frame_axis.frame_id'
                                  '_diffrn_scan_frame_axis.axis_id'
     loop_
    _category_group.id           'inclusive_group'
                                 'diffrn_group'
     save_
 
 
save__diffrn_scan_frame_axis.axis_id
    _item_description.description
;
               The value of this data item is the identifier of one of
               the axes for the frame for which settings are being specified.

               Multiple axes may be specified for the same value of
               _diffrn_scan_frame.frame_id

               This item is a pointer to _axis.id in the
               AXIS category.
;
    _item.name                 '_diffrn_scan_frame_axis.axis_id'
    _item.category_id          diffrn_scan_frame_axis
    _item.mandatory_code       yes
     save_
 
 
save__diffrn_scan_frame_axis.angle
    _item_description.description
;
               The setting of the specified axis in degrees for this frame.
;
    _item.name                 '_diffrn_scan_frame_axis.angle'
    _item.category_id          diffrn_scan_frame_axis
    _item.mandatory_code       no 
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'degrees'
     save_
 
 
save__diffrn_scan_frame_axis.displacement
    _item_description.description
;
               The setting of the specified axis in millimetres for this
               frame
;
    _item.name                 '_diffrn_scan_frame_axis.displacement'
    _item.category_id          diffrn_scan_frame_axis
    _item.mandatory_code       no
    _item_default.value        0.0
    _item_type.code            float
    _item_units.code           'millimetres'
     save_

save__diffrn_scan_frame_axis.frame_id
    _item_description.description
;
               The value of this data item is the identifier of the
               frame for which axis settings are being specified.

               Multiple axes may be specified for the same value of
               _diffrn_scan_frame.frame_id .

               This item is a pointer to _diffrn_frame_data.id in the
               DIFFRN_FRAME_DATA category.
;
    _item.name                 '_diffrn_scan_frame_axis.frame_id'
    _item.category_id          diffrn_scan_frame_axis
    _item.mandatory_code       yes
     save_
 
 
####################
## ITEM_TYPE_LIST ##
####################
#
#
#  The regular expressions defined here are not compliant
#  with the POSIX 1003.2 standard as they include the
#  '\n' and '\t' special characters.  These regular expressions
#  have been tested using version 0.12 of Richard Stallman's
#  GNU regular expression library in POSIX mode.
#  In order to allow presentation of a regular expression
#  in a text field concatenate any line ending in a backslash
#  with the following line, after discarding the backslash.
#
#  A formal definition of the '\n' and '\t' special characters
#  is most properly done in the DDL, but for completeness, please
#  note that '\n' is the line termination character ('newline')
#  and '\t' is the horizontal tab character.  There is a formal
#  ambiguity in the use of '\n' for line termination, in that
#  the intention is that the equivalent machine/OS-dependent line
#  termination character sequence should be accepted as a match, e.g.
#
#      '\r' (control-M) under MacOS
#      '\n' (control-J) under Unix
#      '\r\n' (control-M control-J) under DOS and MS Windows
#
     loop_
    _item_type_list.code
    _item_type_list.primitive_code
    _item_type_list.construct
    _item_type_list.detail
               code      char
'[_,.;:"&<>/\{}'`~!@#$%A-Za-z0-9*|+-]*'
;              code item types/single words ...
;
               ucode      uchar
'[_,.;:"&<>/\{}'`~!@#$%A-Za-z0-9*|+-]*'
;              code item types/single words (case insensitive)
;
               line      char
'[][ \t_(),.;:"&<>/\{}'`~!@#$%A-Za-z0-9*|+-]*'
;              code item types / multi-word items  ...
;
               uline     uchar
'[][ \t_(),.;:"&<>/\{}'`~!@#$%A-Za-z0-9*|+-]*'
;              code item types / multi-word items (case insensitive)
;
               text      char
'[][ \n\t()_,.;:"&<>/\{}'`~!@#$%?+=*A-Za-z0-9|^-]*'
;              text item types / multi-line text ...
;
               binary    char
;\n--CIF-BINARY-FORMAT-SECTION--\n\
[][ \n\t()_,.;:"&<>/\{}'`~!@#$%?+=*A-Za-z0-9|^-]*}\
\n--CIF-BINARY-FORMAT-SECTION----
;
;              binary items are presented as MIME-like ascii-encoded
               sections in an imgCIF.  In a CBF, raw octet streams
               are used to convey the same information.
;
               int       numb
'-?[0-9]+'
;              int item types are the subset of numbers that are the negative
               or positive integers.
;
               float     numb
'-?(([0-9]+)|([0-9]*[.][0-9]+))([(][0-9]+[)])?([eE][+-]?[0-9]+)?'
;              float item types are the subset of numbers that are the floating
               numbers.
;
               any       char
'.*'
;              A catch all for items that may take any form...
;

#####################
## ITEM_UNITS_LIST ##
#####################

     loop_
    _item_units_list.code
    _item_units_list.detail
#
     'metres'                 'metres'
     'centimetres'            'centimetres (metres * 10^( -2))'
     'millimetres'            'millimetres (metres * 10^( -3))'
     'nanometres'             'nanometres  (metres * 10^( -9))'
     'angstroms'              'angstroms   (metres * 10^(-10))'
     'picometres'             'picometres  (metres * 10^(-12))'
     'femtometres'            'femtometres (metres * 10^(-15))'
#
     'reciprocal_metres'      'reciprocal metres (metres * 10^-1)'
     'reciprocal_centimetres' 'reciprocal centimetres (metres * 10^( -2)^-1)'
     'reciprocal_millimetres' 'reciprocal millimetres (metres * 10^( -3)^-1)'
     'reciprocal_nanometres'  'reciprocal nanometres  (metres * 10^( -9)^-1)'
     'reciprocal_angstroms'   'reciprocal angstroms   (metres * 10^(-10)^-1)'
     'reciprocal_picometres'  'reciprocal picometres  (metres * 10^(-12)^-1)'
#
     'nanometres_squared'     'nanometres squared (metres * 10^( -9))^2'
     'angstroms_squared'      'angstroms squared  (metres * 10^(-10))^2'
     '8pi2_angstroms_squared' '8pi^2 * angstroms squared (metres * 10^(-10))^2'
     'picometres_squared'     'picometres squared (metres * 10^(-12))^2'
#
     'nanometres_cubed'       'nanometres cubed (metres * 10^( -9))^3'
     'angstroms_cubed'        'angstroms cubed  (metres * 10^(-10))^3'
     'picometres_cubed'       'picometres cubed (metres * 10^(-12))^3'
#
     'kilopascals'            'kilopascals'
     'gigapascals'            'gigapascals'
#
     'hours'                  'hours'
     'minutes'                'minutes'
     'seconds'                'seconds'
     'microseconds'           'microseconds'
#
     'degrees'                'degrees (of arc)'
#
     'degrees_per_minute'     'degrees (of arc) per minute'
#
     'celsius'                'degrees (of temperature) Celsius'
     'kelvins'                'degrees (of temperature) Kelvin'
#
     'electrons'              'electrons'
#
     'electrons_squared'      'electrons squared'
#
     'electrons_per_nanometres_cubed'
; electrons per nanometres cubed (metres * 10^( -9))^3
;
     'electrons_per_angstroms_cubed'
; electrons per angstroms  cubed (metres * 10^(-10))^3
;
     'electrons_per_picometres_cubed'
; electrons per picometres cubed (metres * 10^(-12))^3
;
     'kilowatts'              'kilowatts'
     'milliamperes'           'milliamperes'
     'kilovolts'              'kilovolts'
#
     'arbitrary'
; arbitrary system of units.
;
#

     loop_
    _item_units_conversion.from_code
    _item_units_conversion.to_code
    _item_units_conversion.operator
    _item_units_conversion.factor
###
     'metres'                   'centimetres'              '*'   1.0E+02
     'metres'                   'millimetres'              '*'   1.0E+03
     'metres'                   'nanometres'               '*'   1.0E+09
     'metres'                   'angstroms'                '*'   1.0E+10
     'metres'                   'picometres'               '*'   1.0E+12
     'metres'                   'femtometres'              '*'   1.0E+15
#
     'centimetres'              'metres'                   '*'   1.0E-02
     'centimetres'              'millimetres'              '*'   1.0E+01
     'centimetres'              'nanometres'               '*'   1.0E+07
     'centimetres'              'angstroms'                '*'   1.0E+08
     'centimetres'              'picometres'               '*'   1.0E+10
     'centimetres'              'femtometres'              '*'   1.0E+13
#
     'millimetres'              'metres'                   '*'   1.0E-03
     'millimetres'              'centimetres'              '*'   1.0E-01
     'millimetres'              'nanometres'               '*'   1.0E+06
     'millimetres'              'angstroms'                '*'   1.0E+07
     'millimetres'              'picometres'               '*'   1.0E+09
     'millimetres'              'femtometres'              '*'   1.0E+12
#
     'nanometres'               'metres'                   '*'   1.0E-09
     'nanometres'               'centimetres'              '*'   1.0E-07
     'nanometres'               'millimetres'              '*'   1.0E-06
     'nanometres'               'angstroms'                '*'   1.0E+01
     'nanometres'               'picometres'               '*'   1.0E+03
     'nanometres'               'femtometres'              '*'   1.0E+06
#
     'angstroms'                'metres'                   '*'   1.0E-10
     'angstroms'                'centimetres'              '*'   1.0E-08
     'angstroms'                'millimetres'              '*'   1.0E-07
     'angstroms'                'nanometres'               '*'   1.0E-01
     'angstroms'                'picometres'               '*'   1.0E+02
     'angstroms'                'femtometres'              '*'   1.0E+05
#
     'picometres'               'metres'                   '*'   1.0E-12
     'picometres'               'centimetres'              '*'   1.0E-10
     'picometres'               'millimetres'              '*'   1.0E-09
     'picometres'               'nanometres'               '*'   1.0E-03
     'picometres'               'angstroms'                '*'   1.0E-02
     'picometres'               'femtometres'              '*'   1.0E+03
#
     'femtometres'              'metres'                   '*'   1.0E-15
     'femtometres'              'centimetres'              '*'   1.0E-13
     'femtometres'              'millimetres'              '*'   1.0E-12
     'femtometres'              'nanometres'               '*'   1.0E-06
     'femtometres'              'angstroms'                '*'   1.0E-05
     'femtometres'              'picometres'               '*'   1.0E-03
###
     'reciprocal_centimetres'   'reciprocal_metres'        '*'   1.0E+02
     'reciprocal_centimetres'   'reciprocal_millimetres'   '*'   1.0E-01
     'reciprocal_centimetres'   'reciprocal_nanometres'    '*'   1.0E-07
     'reciprocal_centimetres'   'reciprocal_angstroms'     '*'   1.0E-08
     'reciprocal_centimetres'   'reciprocal_picometres'    '*'   1.0E-10
#
     'reciprocal_millimetres'   'reciprocal_metres'        '*'   1.0E+03
     'reciprocal_millimetres'   'reciprocal_centimetres'   '*'   1.0E+01
     'reciprocal_millimetres'   'reciprocal_nanometres'    '*'   1.0E-06
     'reciprocal_millimetres'   'reciprocal_angstroms'     '*'   1.0E-07
     'reciprocal_millimetres'   'reciprocal_picometres'    '*'   1.0E-09
#
     'reciprocal_nanometres'    'reciprocal_metres'        '*'   1.0E+09
     'reciprocal_nanometres'    'reciprocal_centimetres'   '*'   1.0E+07
     'reciprocal_nanometres'    'reciprocal_millimetres'   '*'   1.0E+06
     'reciprocal_nanometres'    'reciprocal_angstroms'     '*'   1.0E-01
     'reciprocal_nanometres'    'reciprocal_picometres'    '*'   1.0E-03
#
     'reciprocal_angstroms'     'reciprocal_metres'        '*'   1.0E+10
     'reciprocal_angstroms'     'reciprocal_centimetres'   '*'   1.0E+08
     'reciprocal_angstroms'     'reciprocal_millimetres'   '*'   1.0E+07
     'reciprocal_angstroms'     'reciprocal_nanometres'    '*'   1.0E+01
     'reciprocal_angstroms'     'reciprocal_picometres'    '*'   1.0E-02
#
     'reciprocal_picometres'    'reciprocal_metres'        '*'   1.0E+12
     'reciprocal_picometres'    'reciprocal_centimetres'   '*'   1.0E+10
     'reciprocal_picometres'    'reciprocal_millimetres'   '*'   1.0E+09
     'reciprocal_picometres'    'reciprocal_nanometres'    '*'   1.0E+03
     'reciprocal_picometres'    'reciprocal_angstroms'     '*'   1.0E+01
###
     'nanometres_squared'       'angstroms_squared'        '*'   1.0E+02
     'nanometres_squared'       'picometres_squared'       '*'   1.0E+06
#
     'angstroms_squared'        'nanometres_squared'       '*'   1.0E-02
     'angstroms_squared'        'picometres_squared'       '*'   1.0E+04
     'angstroms_squared'        '8pi2_angstroms_squared'   '*'   78.9568

#
     'picometres_squared'       'nanometres_squared'       '*'   1.0E-06
     'picometres_squared'       'angstroms_squared'        '*'   1.0E-04
###
     'nanometres_cubed'         'angstroms_cubed'          '*'   1.0E+03
     'nanometres_cubed'         'picometres_cubed'         '*'   1.0E+09
#
     'angstroms_cubed'          'nanometres_cubed'         '*'   1.0E-03
     'angstroms_cubed'          'picometres_cubed'         '*'   1.0E+06
#
     'picometres_cubed'         'nanometres_cubed'         '*'   1.0E-09
     'picometres_cubed'         'angstroms_cubed'          '*'   1.0E-06
###
     'kilopascals'              'gigapascals'              '*'   1.0E-06
     'gigapascals'              'kilopascals'              '*'   1.0E+06
###
     'hours'                    'minutes'                  '*'   6.0E+01
     'hours'                    'seconds'                  '*'   3.6E+03
     'hours'                    'microseconds'             '*'   3.6E+09
#
     'minutes'                  'hours'                    '/'   6.0E+01
     'minutes'                  'seconds'                  '*'   6.0E+01
     'minutes'                  'microseconds'             '*'   6.0E+07
#
     'seconds'                  'hours'                    '/'   3.6E+03
     'seconds'                  'minutes'                  '/'   6.0E+01
     'seconds'                  'microseconds'             '*'   1.0E+06
#
     'microseconds'             'hours'                    '/'   3.6E+09
     'microseconds'             'minutes'                  '/'   6.0E+07
     'microseconds'             'seconds'                  '/'   1.0E+06
###
     'celsius'                  'kelvins'                  '-'     273.0
     'kelvins'                  'celsius'                  '+'     273.0
###
     'electrons_per_nanometres_cubed'
     'electrons_per_angstroms_cubed'                       '*'   1.0E-03
     'electrons_per_nanometres_cubed'
     'electrons_per_picometres_cubed'                      '*'   1.0E-09
#
     'electrons_per_angstroms_cubed'
     'electrons_per_nanometres_cubed'                      '*'   1.0E+03
     'electrons_per_angstroms_cubed'
     'electrons_per_picometres_cubed'                      '*'   1.0E-06
#
     'electrons_per_picometres_cubed'
     'electrons_per_nanometres_cubed'                      '*'   1.0E+09
     'electrons_per_picometres_cubed'
     'electrons_per_angstroms_cubed'                       '*'   1.0E+06
###
 
 
########################
## DICTIONARY_HISTORY ##
########################

     loop_
    _dictionary_history.version
    _dictionary_history.update
    _dictionary_history.revision

   1.0     2000-12-21
;
   Release version - few typos and tidying up (BM & HJB)
   
   + Move ITEM_TYPE_LIST, ITEM_UNITS_LIST and DICTIONARY_HISTORY to end
   of dictionary.
   
   + Alphabetize dictionary.
;

   0.7.1   2000-09-29
;
   Cleanup fixes (JW)

   + Correct spelling of diffrn_measurement_axis in _axis.id

   + Correct ordering of uses of _item.mandatory_code and _item_default.value
;

   0.7.0   2000-09-09
;
   Respond to comments by I. David Brown (HJB)

   + Added further comments on '\n' and '\t'

   + Updated ITEM_UNITS_LIST by taking section from mmCIF dictionary
 and adding metres.  Changed all spelling 'meter' to 'metre' throughout.

   + Added missing enumerations to _array_structure.compression_type
 and made 'none' the default.

   + Removed parent-child relationship between _array_structure_list.index
 and _array_structure_list.precedence .

   + Improve alphabetization.

   + Fix _array_intensities_gain.esd related function.

   + Improved comments in AXIS.

   + Fixed DIFFRN_FRAME_DATA example.

   + Removed erroneous DIFFRN_MEASUREMENT example.

   + Added _diffrn_measurement_axis.id to the category key.
;

   0.6.0   1999-01-14
;
   Remove redundant information for ENC_NONE data (HJB)

   + After the D5 remove binary section identifier, size and
 compression type.

   + Add Control-L to header.
;
   0.5.1   1999-01-03
;
   Cleanup of typos and syntax errors (HJB)

   + Cleanup example details for DIFFRN_SCAN category.

   + Add missing quote marks for _diffrn_scan.id definition.
;

   0.5   1999-01-01
;
   Modifications for axis definitions and reduction of binary header (HJB)

   + Restored _diffrn_detector.diffrn_id to DIFFRN_DETECTOR KEY.

   + Added AXIS category.

   + Brought complete DIFFRN_DETECTOR and DIFFRN_MEASUREMENT categories
 in from cif_mm.dic for clarity.

   + changed _array_structure.encoding_type from type code to uline and
 added X-Binary-Element-Type to MIME header.

   + added detector beam center _diffrn_detector_element.center[1] and 
_diffrn_detector_element.center[2]

   + corrected item name of _diffrn_refln.frame_id

   + replace reference to _array_intensities.undefined by
 _array_intensities.undefined_value

   + replace references to _array_intensity.scaling with
 _array_intensities.scaling

   + added DIFFRN_SCAN... categories
;

   0.4   1998-08-11
;
   Modifications to the 0.3 imgCIF draft (HJB)

   +  Reflowed comment lines over 80 characters and corrected typos.

   +  Updated examples and descriptions of MIME encoded data.

   +  Change name to cbfext98.dic.
;

   0.3   1998-07-04
;
   Modifications for imgCIF (HJB)

   +  Added binary type, which is a text field containing a variant on
      MIME encoded data.
      
   +  Changed type of _array_data.data to binary and specified internal
      structure of raw binary data.
      
   +  Added _array_data.binary_id, and made 
      _diffrn_frame_data.binary_id and _array_intensities.binary_id
      into pointers to this item.
;

   0.2   1997-12-02
;
   Modifications to the CBF draft (JW):  

   +  Added category hierarchy for describing frame data developed from
      discussions at the BNL imgCIF Workshop Oct 1997.   The following
      changes were made in implementing the workshop draft.  Category
      DIFFRN_ARRAY_DATA was renamed to DIFFRN_FRAME_DATA.  Category
      DIFFRN_FRAME_TYPE was renamed to DIFFRN_DETECTOR_ELEMENT.   The
      parent item for _diffrn_frame_data.array_id was changed from
      array_structure_list.array_id to array_structure.id. Item 
      _diffrn_detector.array_id was deleted.  
   +  Added data item _diffrn_frame_data.binary_id to identify data groups
      within a binary section.  The formal identification of the binary section
      is still fuzzy.  
;

   0.1   1997-01-24
;
   First draft of this dictionary in DDL 2.1 compliant format by John 
   Westbrook (JW).  This version was adapted from the Crystallographic 
   Binary File (CBF) Format Draft Proposal provided by Andy Hammersley (AH).  
 
   Modifications to the CBF draft (JW):  
 
   + In this version the array description has been cast in the categories 
     ARRAY_STRUCTURE and ARRAY_STRUCTURE_LIST.  These categories have been 
     generalized to describe array data  of arbitrary dimension.  

   + Array data in this description are contained in the category ARRAY_DATA.
     This departs from the CBF notion of data existing in some special comment.
     In this description, data is handled as an ordinary data item encapsulated
     in a character data type.   Although handling binary data this manner
     deviates from CIF conventions, it does not violate any DDL 2.1 rules.
     DDL 2.1 regular expressions can be used to define the binary 
     representation which will permit some level of data validation.  In 
     this version, the placeholder type code "any" has been used.
     This translates to a regular expression which will match any pattern.  

     It should be noted that DDL 2.1 already supports array data objects 
     although these have not been used in the current mmCIF dictionary.  It 
     may be possible to use the DDL 2.1 ITEM_STRUCTURE and ITEM_STRUCTURE_LIST
     categories to provide the information that is carried in by the 
     ARRAY_STRUCTURE and ARRAY_STRUCTURE_LIST.  By moving the array 
     structure to the DDL level it would be possible to define an array 
     type as well as a regular expression defining the data format. 

   + Multiple array sections can be properly handled within a single datablock.
;
 
 
#-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof-eof