#\#CIF_2.0
##############################################################################
#                                                                            #
#                        Test CIF Dictionary                                 #
#                                                                            #
#  CIF data definitions that merge in full core dictionary                   #
#                                                                            #
#                                                                            #
##############################################################################

data_CIF_MER

    _dictionary.title            CIF_MER
    _dictionary.formalism        Powder
    _dictionary.class            Instance
    _dictionary.version          2.4
    _dictionary.date             2017-04-05
    _dictionary.uri              www.iucr.org/cif/dic/cif_pow.dic
    _dictionary.ddl_conformance  3.11.10
    _dictionary.namespace        CifPow
    _description.text                   
;

    The CIF_POW dictionary records the definitions of data items needed in
    powder diffraction studies. Note that unlike most IUCr CIF
    dictionaries, the dataname is not always constructed as
    <category>.<object>

;

save_PD_GROUP

    _definition.id               PD_GROUP
    _definition.scope            Category
    _definition.class            Head
    _definition.update           2014-06-20
    _description.text                   
;

      Groups all of the categories of definitions in the powder
      diffraction study of materials.
;
    _name.category_id            CIF_POW
    _name.object_id              PD_GROUP
    _import.get                 [{"file":"cif_core_ddlm.dic" "save":"CIF_CORE" "mode":"Full"}]
    
save_


save_PD_BLOCK

    _definition.id               PD_BLOCK
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2016-10-18
    _description.text                   
;

      _pd_block.id is used to assign a unique ID code to a data block.
      This code is then used for references between different blocks
      (see _pd_block.diffractogram_id, _pd_calib.std_external_block_id
      and _pd_phase.block_id).
 
      Note that a data block may contain only a single diffraction
      data set or information about a single crystalline phase.
      However, a single diffraction measurement may yield structural
      information on more than one phase, or a single structure
      determination may use more than one data set. Alternatively,
      results from a single data set, such as calibration parameters
      from measurements of a standard, may be used for many subsequent
      analyses. Through use of the ID code, a reference made between
      data sets may be preserved when the file is exported from the
      laboratory from which the CIF originated.
 
      The ID code assigned to each data block should be unique with
      respect to an ID code assigned for any other data block in the
      world. The naming scheme chosen for the block-ID format is
      designed to ensure uniqueness.
 
      It is the responsibility of a data archive site or local
      laboratory to create a catalogue of block ID's if that site
      wishes to resolve these references.
;
    _name.category_id            PD_GROUP
    _name.object_id              PD_BLOCK

save_


save__pd_block.id

    _definition.id               '_pd_block.id'
    _definition.update           2016-10-17
    loop_
      _alias.definition_id
          '_pd_block_id' 
    _description.text                   
;

      Used to assign a unique character string to a block.
      Note that this code is not intended to be parsed; the
      concatenation of several strings is used in order to
      generate a string that can reasonably be expected to
      be unique.
 
      This code is assigned by the originator of the data set and
      is used for references between different CIF blocks.
      The ID will normally be created when the block is first
      created. It is possible to loop more than one ID for a
      block: if changes or additions are made to the
      block later, a new ID may be assigned, but the original name
      should be retained.
 
      The format for the ID code is:
        <date-time>|<block_name>|<creator_name>|<instr_name>
 
       <date-time>    is the date and time the CIF was created
                      or modified.
 
       <block_name>   is an arbitrary name assigned by the
                      originator of the data set. It will
                      usually match the name of the phase
                      and possibly the name of the current CIF
                      data block (i.e. the string xxxx in a
                      data_xxxx identifier). It may be a sample name.
 
       <creator_name> is the name of the person who measured the
                      diffractogram, or prepared or modified the CIF.
 
       <instr_name>  is a unique name (as far as possible) for
                      the data-collection instrument, preferably
                      containing the instrument serial number for
                      commercial instruments. It is also possible to
                      use the Internet name or address for the
                      instrument computer as a unique name.
 
      As blocks are created in a CIF, the original sample identifier
      (i.e. <block_name>) should be retained, but the <creator_name>
      may be changed and the <date-time> will always change.
      The <date-time> will usually match either the
      _pd_meas_datetime_initiated or the _pd_proc_info_datetime
      entry.
 
      Within each section of the code, the following characters
      may be used:
                    A-Z a-z 0-9 # & * . : , - _ + / ( ) \ [ ]\
 
      The sections are separated with vertical rules '|' which are
      not allowed within the sections. Blank spaces may also
      not be used.  Capitalization may be used within the ID code
      but should not be considered significant - searches for
      data-set ID names should be case-insensitive.
 
      Date-time entries are in the standard CIF format
      'yyyy-mm-ddThh:mm:ss+zz' Use of seconds and a time zone
      is optional, but use of hours and minutes is strongly
      encouraged as this will help ensure that the ID code is unique.
 
      An archive site that wishes to make CIFs available via
      the web may substitute the URL for the file containing the
      appropriate block for the final two sections of the ID
      (<creator_name> and <instr_name>). Note that this should
      not be done unless the archive site is prepared to keep the
      file available online indefinitely.
;
    _name.category_id            pd_block
    _name.object_id              id
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
    loop_
    _description_example.case
            "1991-15-09T16:54|Si-std|B.Toby|D500#1234-987"
            '1991-15-09T16:54|SEPD7234|B.Toby|SEPD.IPNS.ANL.GOV'
save_

save_PD_BLOCK_DIFFRACTOGRAM
    _definition.id               PD_BLOCK_DIFFRACTOGRAM
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2016-10-18
    _description.text                   
;

    A number of diffractograms may contribute to the
    determination of the structure of a single phase.
    The _pd_block.ids of those diffractograms should
    be listed here.
    
;
    _name.category_id            PD_GROUP
    _name.object_id              PD_BLOCK_DIFFRACTOGRAM
    loop_
    _category_key.name           '_pd_block_diffractogram.id'
    
save_

save__pd_block_diffractogram.id

    _definition.id               '_pd_block_diffractogram.id'
    _definition.update           2016-10-18
    loop_
      _alias.definition_id
          '_pd_block_diffractogram_id' 
    _description.text                   
;

      A block ID code (see _pd_block.id) that identifies
      diffraction data contained in a data block other
      than the current block. This will occur most frequently
      when more than one set of diffraction data
      is used for a structure determination. The data
      block containing the diffraction data will contain
      a _pd_block.id code matching the code in
      _pd_block.diffractogram_id.
;
    _name.category_id            pd_block_diffractogram
    _name.object_id              id
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text

save_

save_PD_CALC_OVERALL

    _definition.id               PD_CALC_OVERALL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2016-10-18
    _description.text                   
;

      Items in this category record overall features of the computed
      diffractogram.

;
    _name.category_id            PD_GROUP
    _name.object_id              PD_CALC_OVERALL

save_

save__pd_calc.method

    _definition.id               '_pd_calc.method'
    _definition.update           2016-10-18
    loop_
      _alias.definition_id
          '_pd_calc_method' 
    _description.text                   
;

      A description of the method used for the calculation of the
      intensities in _pd_calc.intensity_*. If the pattern was
      calculated from crystal structure data for a single phase, the
      atom coordinates and other crystallographic information should
      be included in the datablock using the core CIF _atom_site_ and
      _cell_ data items.  If multiple phases were used, these should
      be listed in the pd_phase category.

;

    _name.category_id            pd_calc_overall
    _name.object_id              method
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text

save_


save_PD_CALC

    _definition.id               PD_CALC
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2016-10-17
    _description.text                   
;

      This section is used for storing a computed diffractogram trace.
      This may be a simulated powder pattern for a material from a
      program such as LAZY/PULVERIX or the computed intensities from a
      Rietveld refinement.
;
    _name.category_id            PD_DATA
    _name.object_id              PD_CALC
    loop_
    _category_key.name           '_pd_calc.point_id'

save_


save__pd_calc.intensity_net

    _definition.id               '_pd_calc.intensity_net'
    _definition.update           2014-06-20
    loop_
      _alias.definition_id
          '_pd_calc_intensity_net' 
    _description.text                   
;

      Intensity values for a computed diffractogram at
      each angle setting. Values should be computed at the
      same locations as the processed diffractogram, and thus
      the numbers of points will be defined by
      _pd_proc.number_of_points and point positions may
      be defined using _pd_proc.2theta_range_* or
      _pd_proc.2theta_corrected.
 
      Use _pd_calc.intensity_net if the computed diffractogram
      does not contain background or normalization corrections
      and thus is specified on the same scale as the
      _pd_proc_intensity_net values.
      If an observed pattern is included, _pd_calc.intensity_*
      should be looped with either _pd_proc.intensity_net,
      _pd_meas.counts_* or _pd_meas.intensity_*.
;
    _name.category_id            pd_calc
    _name.object_id              intensity_net
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:

save_


save__pd_calc.intensity_total

    _definition.id               '_pd_calc.intensity_total'
    _definition.update           2014-06-20
    loop_
      _alias.definition_id
          '_pd_calc_intensity_total' 
    _description.text                   
;

      Intensity values for a computed diffractogram at
      each angle setting. Values should be computed at the
      same locations as the processed diffractogram, and thus
      the numbers of points will be defined by
      _pd_proc.number_of_points and point positions may
      be defined using _pd_proc.2theta_range_* or
      _pd_proc.2theta_corrected.
 
      Use _pd_calc.intensity_total if the computed diffraction
      pattern includes background or normalization corrections
      (or both) and thus is specified on the same scale as the
      observed intensities (_pd_meas_counts_* or _pd_meas_intensity_*).
      If an observed pattern is included, _pd_calc.intensity_*
      should be looped with either _pd_proc.intensity_net,
      _pd_meas.counts_* or _pd_meas.intensity_*.
;
    _name.category_id            pd_calc
    _name.object_id              intensity_total
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:

save_

save__pd_calc.point_id

    _definition.id               '_pd_calc.point_id'
    _definition.update           2014-06-20
    loop_
      _alias.definition_id
          '_pd_calc_point_id' 
    _description.text                   
;

      Arbitrary label identifying a calculated data point. Used to
      identify a specific entry in a list of values forming the
      calculated diffractogram. The role of this identifier may
      be adopted by _pd_data_point_id if measured, processed and
      calculated intensity values are combined in a single list.
;
    _name.category_id            pd_calc
    _name.object_id              point_id
    _name.linked_item_id         '_pd_data.point_id'
    _type.purpose                Key
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code

save_

save_REFLN

_definition.id                          REFLN
_definition.scope                       Category
_definition.class                       Loop
_definition.update                      2016-11-09
_description.text                       
;
     The CATEGORY of data items used to describe the reflection data
     used in the refinement of one or more crystallographic phases.
;
_name.category_id                       DIFFRACTION
_name.object_id                         REFLN
loop_
  _category_key.name
         '_refln.index_h'    
         '_refln.index_k'    
         '_refln.index_l'
         '_pd_refln.phase_id'
save_

save_refln.F_complex

_definition.id                          '_refln.F_complex'
loop_
  _alias.definition_id
         '_refln_F_complex' 
_definition.update                      2017-03-07
_description.text                       
;
     The structure factor vector for the reflection calculated from
     the atom site data for the phase given by phase_id.
;
_name.category_id                       refln
_name.object_id                         F_complex
_type.purpose                           Measurand
_type.source                            Derived
_type.container                         Single
_type.contents                          Complex
_enumeration.default                    0.
loop_
  _method.purpose
  _method.expression
         Definition          
;
         If (_diffrn_radiation.probe == "neutron")  _units.code =  "femtometres"
    Else If (_diffrn_radiation.probe == "electron") _units.code =  "volts"
    Else                                            _units.code =  "electrons"
;        

save_

save_refln.F_squared_meas

_definition.id                          '_refln.F_squared_meas'
loop_
  _alias.definition_id
         '_refln.F_meas'     
         '_refln_F_meas' 
_definition.update                      2017-03-22
_description.text                       
;
     The structure factor amplitude for the reflection derived by partitioning
     the background-subtracted observed intensity _pd_proc.intensity_net between
     reflections in the same proportion as those reflections contribute to
     the corresponding background-free calculated point in _pd_calc.intensity_net 

;
_name.category_id                       refln
_name.object_id                         F_squared_meas
_type.purpose                           Measurand
_type.source                            Derived
_type.container                         Single
_type.contents                          Real
_enumeration.default                    0.
loop_
  _method.purpose
  _method.expression
         Definition          
;
         If (_diffrn_radiation.probe == "neutron")  _units.code =  "femtometres"
    Else If (_diffrn_radiation.probe == "electron") _units.code =  "volts"
    Else                                            _units.code =  "electrons"
; 

save_

save_pd_refln.phase_id

    _definition.id               '_pd_refln.phase_id'
    _definition.update           2016-11-09
    loop_
      _alias.definition_id
          '_pd_refln_phase_id' 
    _description.text                   
;
      A code which identifies the particular phase to which
      this reflection belongs.
;
    _name.category_id            refln
    _name.object_id              phase_id
    _name.linked_object_id       '_pd_phase.id'
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code

save_

save__pd_refln.peak_id

    _definition.id               '_pd_refln.peak_id'
    _definition.update           2014-06-20
    loop_
      _alias.definition_id
          '_pd_refln_peak_id' 
    _description.text                   
;

      Code which identifies the powder diffraction peak that
      contains the current reflection. This code must match a
      _pd_peak.id code. 
;
    _name.category_id            refln
    _name.object_id              peak_id
    _name.linked_item_id         '_pd_peak.id'
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code

save_

save__pd_refln.wavelength_id

    _definition.id               '_pd_refln.wavelength_id'
    _definition.update           2016-11-03
    loop_
      _alias.definition_id
          '_pd_refln_wavelength_id' 
    _description.text                   
;

      Code which identifies the wavelength associated with the
      reflection and the peak pointed to by _pd_refln.peak_id.
      This code must match a _diffrn_radiation_wavelength.id code.
;
    _name.category_id            refln
    _name.object_id              wavelength_id
    _name.linked_item_id         '_diffrn_radiation_wavelength.id'
    _type.purpose                Link
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code

save_

loop_
  _dictionary_audit.version
  _dictionary_audit.date
  _dictionary_audit.revision
         2.0.1    2014-06-20
;
     Initial conversion to DDLm (Syd Hall)
;
         2.0.2    2016-10-21
;
     Substantial edits to conform to current DDLm, CIF2 syntax
     and intended DDL1 usage (James Hester).
;
         2.0.3    2016-11-03
;
     Removed pd_refln category and pd_refln.phase_id, remaining
     datanames assigned to core REFLN category (James Hester).
;
         2.1      2016-11-09
;
     Changed PD_PHASE to Set category. Multiple phases are now
     covered by an extension dictionary. (James Hester)
;
         2.2      2016-11-12
;
     Added _pd_calib_offset.detector_id to allow for per-detector
     2 theta offsets (James Hester)
;
         2.3      2017-01-26
;
     Returned pd_phase and pd_refln.phase_id to dictionary after
     acceptance of _dictionary.formalism mechanism. Set
     _dictionary.formalism to 'powder'.
;
         2.4      2017-04-05
;
     Added definition for _refln.F_meas after consultation with
     PD DMG. (James Hester)
;
