##############################################################################
#                                                                            #
#                      CIF CORE DICTIONARY                                   #
#                                                                            #
##############################################################################
 
data_CIF_CORE
 
    _dictionary.title            CIF_CORE
    _dictionary.class            Instance
    _dictionary.version          3.0.03
    _dictionary.date             2014-07-22
    _dictionary.uri              www.iucr.org/cif/dic/cif_core.dic
    _dictionary.ddl_conformance  3.11.04
    _dictionary.namespace        CifCore
    _description.text
;
    The CIF_CORE dictionary records all the CORE data items defined
    and used with in the Crystallographic Information Framework (CIF).
;
 
 
save_CIF_CORE
    _definition.id               CIF_CORE
    _definition.scope            Category
    _definition.class            Head
    _definition.update           2014-06-18
    _description.text
;
     The CIF_CORE group contains the definitions of data items that
     are common to all domains of crystallographic studies.
;
    _name.category_id            CIF_DIC
    _name.object_id              CIF_CORE
 
 
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
save_EXPERIMENTAL
    _definition.id               EXPERIMENTAL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
    The DICTIONARY group encompassing the CORE experimental data defined
    and used with in the Crystallographic Information Framework (CIF).
;
    _name.category_id            CIF_CORE
    _name.object_id              EXPERIMENTAL
 
 
#============================================================================
 
save_EXPERIMENTS
    _definition.id               EXPERIMENTS
    _definition.scope            Category
    _definition.class            Ref-loop
    _definition.update           2013-09-08
    _description.text
;
    This category is designed specifically to facilitate studies
    involving multiple sets of experiments and their associated data
    values. The data items are defined within the EXPTL category.
    This category class is only used in an instance document when
    there is more than one experiment encompassed by the category
    of EXPTL items. When this is the case each set of EXPTL data,
    one set per experiment, is enclosed in its own save frame.
    In the instance document these are referred to as a loop of
    the item _experiments.key.  See a typical example below.
    When only one set of experimental data exists the EXPTL items
    need not be enclosed in a save frame and the reference loop is
    unnecessary.
;
    _name.category_id            EXPERIMENTAL
    _name.object_id              EXPERIMENTS
    _category.key_id           '_experiments.key'
    _category.key_list        ['_experiments.key']
 
     loop_
    _description_example.case
;
     In an instance document this category is typically invoked as
 
            loop_ _experiments.key
                           ${"frame":"exptl_blue"}$
                           ${"frame":"exptl_red"}$
;
 
 
save_experiments.key
    _definition.id             '_experiments.key'
     loop_
    _alias.definition_id       '_experiments.key'
    _definition.update           2012-11-22
    _description.text
;
     Unique key to a set of save frames in a looped list.
;
    _name.category_id            experiments
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Ref-table
    _type.contents               Name
     loop_
    _description_example.case  '${"frame":phase1}$'
     save_
 
 
#============================================================================
 
save_EXPTL
 
    _definition.id               EXPTL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to specify the experimental work
     prior to diffraction measurements. These include crystallization
     crystal measurements and absorption-correction techniques used..
;
    _name.category_id            EXPERIMENTS
    _name.object_id              EXPTL
 
 
 
save_exptl.id
    _definition.id             '_exptl.id'
     loop_
    _alias.definition_id       '_exptl.id'
    _definition.update           2012-11-22
    _description.text
;
     Code identifying an experiment if there are multiple sets of
     experimental data. See _experiments.key.
;
    _name.category_id            exptl
    _name.object_id              id
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_exptl.crystals_number
    _definition.id             '_exptl.crystals_number'
     loop_
    _alias.definition_id       '_exptl.crystals_number'
                               '_exptl_crystals_number'
    _definition.update           2012-11-22
    _description.text
;
     Total number of crystals used in the measurement of intensities.
;
    _name.category_id            exptl
    _name.object_id              crystals_number
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           1:
    _enumeration.default         1
     save_
 
 
save_exptl.method
    _definition.id             '_exptl.method'
     loop_
    _alias.definition_id       '_exptl.method'
    _definition.update          2014-06-12
    _description.text
;
     The method used in the experiment.
;
    _name.category_id           exptl
    _name.object_id             method
    _type.purpose               Describe
    _type.source                Recorded
    _type.container             Single
    _type.contents              Text
     loop_
    _description_example.case
         'single-crystal x-ray diffraction'
         'single-crystal neutron diffraction'
         'single-crystal electron diffraction'
         'fiber x-ray diffraction'
         'fiber neutron diffraction'
         'fiber electron diffraction'
         'single-crystal joint x-ray and neutron diffraction'
         'single-crystal joint x-ray and electron diffraction'
         'solution nmr'
         'solid-state nmr'
         'theoretical model'
         'other'
    save_
 
 
save_exptl.method_details
    _definition.id             '_exptl.method_details'
     loop_
    _alias.definition_id       '_exptl.method_details'
    _definition.update          2014-06-12
    _description.text
;
     A description of special aspects of the experimental method.
;
    _name.category_id           exptl
    _name.object_id             method_details
    _type.purpose               Describe
    _type.source                Recorded
    _type.container             Single
    _type.contents              Text
     loop_
    _description_example.case
         '29 structures'
         'minimized average structure'
    save_
 
 
save_exptl.special_details
    _definition.id             '_exptl.special_details'
     loop_
    _alias.definition_id       '_exptl.special_details'
                               '_exptl_special_details'
                               '_exptl.details'
    _definition.update           2012-11-22
    _description.text
;
     Details of the experiment prior to intensity measurement.
     See also _exptl_crystal.preparation
;
    _name.category_id            exptl
    _name.object_id              special_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_exptl.transmission_factor_max
    _definition.id             '_exptl.transmission_factor_max'
     loop_
    _alias.definition_id       '_exptl.transmission_factor_max'
                               '_exptl_transmission_factor_max'
    _definition.update           2013-04-11
    _description.text
;
     The calculated maximum value of the transmission factor for
     the specimen. Its value does not include the effects of
     absorption in the specimen mount. The presence of this
     item does not imply that the structure factors have been
     corrected for absorption. For the applied correction see
     _exptl_absorpt.correction_T_max.
;
    _name.category_id            exptl
    _name.object_id              transmission_factor_max
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_exptl.transmission_factor_min
    _definition.id             '_exptl.transmission_factor_min'
     loop_
    _alias.definition_id       '_exptl.transmission_factor_min'
                               '_exptl_transmission_factor_min'
    _definition.update           2013-04-11
    _description.text
;
     The calculated minimum value of the transmission factor for
     the specimen. Its value does not include the effects of
     absorption in the specimen mount. The presence of this
     item does not imply that the structure factors have been
     corrected for absorption. For the applied correction see
     _exptl_absorpt.correction_T_max.
;
    _name.category_id            exptl
    _name.object_id              transmission_factor_min
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
#============================================================================
 
save_EXPTL_CRYSTALS
    _definition.id               EXPTL_CRYSTALS
    _definition.scope            Category
    _definition.class            Ref-loop
    _definition.update           2013-09-08
    _description.text
;
    This category is designed specifically to facilitate studies
    involving multiple sets of experiments and their associated data
    values. The data items are defined in the EXPTL_CRYSTAL category.
    This category class is only used in an instance document when
    there is more than one experiment encompassed by the category of
    EXPTL items. When this is the case each set of EXPTL_CRYSTALa
    data, one set per experiment, is enclosed in its own save frame.
    In the instance document these are referred to as a loop of
    the item _experiments.key.  See a typical example below.
    When only one set of experimental data exists the EXPTL items
    need not be enclosed in a save frame and the reference loop is
    unnecessary.
;
    _name.category_id            EXPTL
    _name.object_id              EXPTL_CRYSTALS
    _category.key_id           '_exptl_crystals.key'
    _category.key_list        ['_exptl_crystals.key']
 
     loop_
    _description_example.case
;
     In an instance document this category is typically invoked as
 
            loop_ _exptl_crystals.key
                           ${"frame":"crystal_1"}$
                           ${"frame":"crystal_2"}$
;
 
 
save_exptl_crystals.key
    _definition.id             '_exptl_crystals.key'
     loop_
    _alias.definition_id       '_exptl_crystals.key'
    _definition.update           2012-11-22
    _description.text
;
     Unique key code to a set of EXPTL_CRYSTAL items in a looped list.
;
    _name.category_id            exptl_crystals
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Ref-table
    _type.contents               Code
     loop_
    _description_example.case  '       ${"frame":c1}$       '
     save_
 
 
#----------------------------------------------------------------------------
 
save_EXPTL_CRYSTAL
 
    _definition.id               EXPTL_CRYSTAL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to specify information about a
     crystal used in the diffraction measurements.
;
    _name.category_id            EXPTL_CRYSTALS
    _name.object_id              EXPTL_CRYSTAL
 
 
save_exptl_crystal.id
    _definition.id             '_exptl_crystal.id'
     loop_
    _alias.definition_id       '_exptl_crystal.id'
                               '_exptl_crystal_id'
    _definition.update           2012-11-22
    _description.text
;
     Code identifying a crystal if multiple crystals are used.
     See _exptl_crystals.key.
;
    _name.category_id            exptl_crystal
    _name.object_id              id
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_exptl_crystal.colour
    _definition.id             '_exptl_crystal.colour'
     loop_
    _alias.definition_id       '_exptl_crystal.colour'
                               '_exptl_crystal_colour'
    _definition.update           2012-11-22
    _description.text
;
     Colour description of a crystal as a list of the allowed
     exptl_crystal_appearance states for general, intensity and hue.
;
    _name.category_id            exptl_crystal
    _name.object_id              colour
    _type.purpose                Composite
    _type.source                 Derived
    _type.container              List
    _type.contents               Code
    _type.dimension              [3]
     loop_
    _description_example.case    "[transluscent, pale, green]"
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With  c  as  exptl_crystal_appearance
 
      _exptl_crystal.colour = [ c.general, c.intensity, c.hue ]
;
     save_
 
 
save_exptl_crystal.density_diffrn
    _definition.id             '_exptl_crystal.density_diffrn'
     loop_
    _alias.definition_id       '_exptl_crystal.density_diffrn'
                               '_exptl_crystal_density_diffrn'
    _definition.update           2012-11-22
    _description.text
;
     Crystal density calculated from crystal unit cell and atomic content.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_diffrn
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  megagrams_per_metre_cubed
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _exptl_crystal.density_diffrn = 1.6605 * _cell.atomic_mass / _cell.volume
;
     save_
 
 
save_exptl_crystal.density_meas
    _definition.id             '_exptl_crystal.density_meas'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas'
                               '_exptl_crystal_density_meas'
    _definition.update           2012-11-22
    _description.text
;
     Crystal density measured using standard chemical and physical methods.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  megagrams_per_metre_cubed
     save_
 
 
save_exptl_crystal.density_meas_su
    _definition.id             '_exptl_crystal.density_meas_su'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_su'
                               '_exptl_crystal_density_meas_su'
                               '_exptl_crystal.density_meas_esd'
    _definition.update           2012-11-22
    _description.text
;
     Standard Uncertainty of the
     Crystal density measured using standard chemical and physical methods.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_su
    _type.purpose                SU
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  megagrams_per_metre_cubed
     save_
 
 
save_exptl_crystal.density_meas_gt
    _definition.id             '_exptl_crystal.density_meas_gt'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_gt'
                               '_exptl_crystal_density_meas_gt'
    _definition.update           2012-12-11
    _description.text
;
     The value above which the density measured using standard
     chemical and physical methods lies. This item is used only
     when _exptl_crystal.density_meas cannot be employed. It is
     intended for use in reporting information in databases and
     archives which would be misleading if reported otherwise.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_gt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  megagrams_per_metre_cubed
     save_
 
 
save_exptl_crystal.density_meas_lt
    _definition.id             '_exptl_crystal.density_meas_lt'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_lt'
                               '_exptl_crystal_density_meas_lt'
    _definition.update           2012-12-11
    _description.text
;
     The value below which the density measured using standard
     chemical and physical methods lies. This item is used only
     when _exptl_crystal.density_meas cannot be employed. It is
     intended for use in reporting information in databases and
     archives which would be misleading if reported otherwise.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_lt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  megagrams_per_metre_cubed
     save_
 
 
save_exptl_crystal.density_meas_temp
    _definition.id             '_exptl_crystal.density_meas_temp'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_temp'
                               '_exptl_crystal_density_meas_temp'
    _definition.update           2012-11-22
    _description.text
;
     Temperature at which _exptl_crystal.density_meas was determined.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_temp
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _enumeration.default         293.
    _units.code                  kelvins
     save_
 
 
save_exptl_crystal.density_meas_temp_su
    _definition.id             '_exptl_crystal.density_meas_temp_su'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_temp_su'
                               '_exptl_crystal_density_meas_temp_su'
                               '_exptl_crystal.density_meas_temp_esd'
    _definition.update           2012-11-22
    _description.text
;
     Standard Uncertainty of the
     Temperature at which _exptl_crystal.density_meas was determined.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_temp_su
    _type.purpose                SU
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_exptl_crystal.density_meas_temp_gt
    _definition.id             '_exptl_crystal.density_meas_temp_gt'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_temp_gt'
                               '_exptl_crystal_density_meas_temp_gt'
    _definition.update           2012-12-11
    _description.text
;
     Temperature above which the measured density was determined.
     This item is used only when exptl_crystal.density_meas_temp
     cannot be employed. It is intended for use in reporting values
     from databases which would be misleading if reported otherwise.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_temp_gt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _enumeration.default         293.
    _units.code                  kelvins
     save_
 
 
save_exptl_crystal.density_meas_temp_lt
    _definition.id             '_exptl_crystal.density_meas_temp_lt'
     loop_
    _alias.definition_id       '_exptl_crystal.density_meas_temp_lt'
                               '_exptl_crystal_density_meas_temp_lt'
    _definition.update           2012-12-11
    _description.text
;
     Temperature below which the measured density was determined.
     This item is used only when exptl_crystal.density_meas_temp
     cannot be employed. It is intended for use in reporting values
     from databases which would be misleading if reported otherwise.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_meas_temp_lt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _enumeration.default         293.
    _units.code                  kelvins
     save_
 
 
save_exptl_crystal.density_method
    _definition.id             '_exptl_crystal.density_method'
     loop_
    _alias.definition_id       '_exptl_crystal.density_method'
                               '_exptl_crystal_density_method'
    _definition.update           2012-11-22
    _description.text
;
     Description of method used to measure _exptl_crystal.density_meas.
;
    _name.category_id            exptl_crystal
    _name.object_id              density_method
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'flotation in aqueous KI'
     save_
 
 
save_exptl_crystal.description
    _definition.id             '_exptl_crystal.description'
     loop_
    _alias.definition_id       '_exptl_crystal.description'
                               '_exptl_crystal_description'
    _definition.update           2012-11-22
    _description.text
;
     Description of the quality and habit of the crystal. The crystal
     dimensions should appear in the exptl_crystal_size category.
;
    _name.category_id            exptl_crystal
    _name.object_id              description
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
save_exptl_crystal.F_000
    _definition.id             '_exptl_crystal.F_000'
     loop_
    _alias.definition_id       '_exptl_crystal.F_000'
                               '_exptl_crystal_F_000'
    _definition.update           2012-11-22
    _description.text
;
     Number of electrons in the crystal unit cell contributing to F(000).
     It may contain dispersion contributions, and is calculated as
 
          F(000) = [ (sum f~r~)^2^ + (sum f~i~)^2^ ]^1/2^
 
          f~r~   = real part of the scattering factors at theta = 0
          f~i~   = imaginary part of the scattering factors at theta = 0
 
                  the sum is taken over each atom in the unit cell
 
     For X-rays, non-dispersive F(000) is a positive number and counts
     the effective number of electrons in the unit cell; for neutrons,
     non-dispersive F(000) (which may be negative) counts the total
     nuclear scattering power in the unit cell. See
        http://reference.iucr.org/dictionary/F(000)
;
    _name.category_id            exptl_crystal
    _name.object_id              F_000
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.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_exptl_crystal.preparation
    _definition.id             '_exptl_crystal.preparation'
     loop_
    _alias.definition_id       '_exptl_crystal.preparation'
                               '_exptl_crystal_preparation'
    _definition.update           2012-11-22
    _description.text
;
     Details of crystal growth and preparation of the crystals
     (e.g.  mounting) prior to the intensity measurements.
;
    _name.category_id            exptl_crystal
    _name.object_id              preparation
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'mounted in an argon-filled quartz capillary'
     save_
 
 
save_exptl_crystal.pressure_history
    _definition.id             '_exptl_crystal.pressure_history'
     loop_
    _alias.definition_id       '_exptl_crystal.pressure_history'
                               '_exptl_crystal_pressure_history'
    _definition.update           2012-11-22
    _description.text
;
     Details concerning the pressure history of the crystals.
;
    _name.category_id            exptl_crystal
    _name.object_id              pressure_history
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_exptl_crystal.recrystallization_method
    _definition.id             '_exptl_crystal.recrystallization_method'
     loop_
    _alias.definition_id       '_exptl_crystal.recrystallization_method'
                               '_exptl_crystal_recrystallization_method'
    _definition.update           2012-12-11
    _description.text
;
     Method used to recrystallize the sample. Sufficient details should
     be given for the procedure to be repeated. Temperatures, solvents,
     flux or carrier gases with concentrations or pressures and ambient
     atmosphere details should be given.
;
    _name.category_id            exptl_crystal
    _name.object_id              recrystallization_method
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_exptl_crystal.size_length
    _definition.id             '_exptl_crystal.size_length'
     loop_
    _alias.definition_id       '_exptl_crystal.size_length'
                               '_exptl_crystal_size_length'
    _definition.update           2012-11-22
    _description.text
;
     The length of needle/cylindrical crystals.
;
    _name.category_id            exptl_crystal
    _name.object_id              size_length
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  millimetres
     save_
 
 
save_exptl_crystal.size_max
    _definition.id             '_exptl_crystal.size_max'
     loop_
    _alias.definition_id       '_exptl_crystal.size_max'
                               '_exptl_crystal_size_max'
    _definition.update           2012-11-22
    _description.text
;
     The maximum dimension of a crystal.
;
    _name.category_id            exptl_crystal
    _name.object_id              size_max
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  millimetres
     save_
 
 
save_exptl_crystal.size_mid
    _definition.id             '_exptl_crystal.size_mid'
     loop_
    _alias.definition_id       '_exptl_crystal.size_mid'
                               '_exptl_crystal_size_mid'
    _definition.update           2012-11-22
    _description.text
;
     The median dimension of a crystal.
;
    _name.category_id            exptl_crystal
    _name.object_id              size_mid
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  millimetres
     save_
 
 
save_exptl_crystal.size_min
    _definition.id             '_exptl_crystal.size_min'
     loop_
    _alias.definition_id       '_exptl_crystal.size_min'
                               '_exptl_crystal_size_min'
    _definition.update           2012-11-22
    _description.text
;
     The minimum dimension of a crystal.
;
    _name.category_id            exptl_crystal
    _name.object_id              size_min
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  millimetres
     save_
 
 
save_exptl_crystal.size_rad
    _definition.id             '_exptl_crystal.size_rad'
     loop_
    _alias.definition_id       '_exptl_crystal.size_rad'
                               '_exptl_crystal_size_rad'
    _definition.update           2012-11-22
    _description.text
;
     The radius of a spherical or cylindrical crystal.
;
    _name.category_id            exptl_crystal
    _name.object_id              size_rad
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  millimetres
     save_
 
 
save_exptl_crystal.thermal_history
    _definition.id             '_exptl_crystal.thermal_history'
     loop_
    _alias.definition_id       '_exptl_crystal.thermal_history'
                               '_exptl_crystal_thermal_history'
    _definition.update           2012-11-22
    _description.text
;
     Details concerning the thermal history of the crystals.
;
    _name.category_id            exptl_crystal
    _name.object_id              thermal_history
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
#----------------------------------------------------------------------------
 
save_EXPTL_CRYSTAL_FACE
 
    _definition.id               EXPTL_CRYSTAL_FACE
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items which specify the dimensions of the
     crystals used in the diffraction measurements.
;
    _name.category_id            EXPTL_CRYSTAL
    _name.object_id              EXPTL_CRYSTAL_FACE
    _category.key_id           '_exptl_crystal_face.key'
    _category.key_list        ['_exptl_crystal_face.id']
 
 
save_exptl_crystal_face.key
    _definition.id             '_exptl_crystal_face.key'
     loop_
    _alias.definition_id       '_exptl_crystal_face.key'
    _definition.update           2012-11-22
    _description.text
;
     Value is a unique key to a set of EXPTL_CRYSTAL items
     in a looped list.
;
    _name.category_id            exptl_crystal_face
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;              _type.contents = Type_Contents(exptl_crystal_face.id)
;
     Evaluation
;              _exptl_crystal_face.key = _exptl_crystal_face.id
;
     save_
 
save_exptl_crystal_face.crystal_id
    _definition.id             '_exptl_crystal_face.crystal_id'
     loop_
    _alias.definition_id       '_exptl_crystal_face.crystal_id'
    _definition.update           2012-11-22
    _description.text
;
     Code identifying a crystal if multiple crystals are used.
;
    _name.category_id            exptl_crystal_face
    _name.object_id              crystal_id
    _name.linked_item_id       '_exptl_crystal.id'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_exptl_crystal_face.diffr_chi
    _definition.id             '_exptl_crystal_face.diffr_chi'
     loop_
    _alias.definition_id       '_exptl_crystal_face.diffr_chi'
                               '_exptl_crystal_face_diffr_chi'
    _import.get        [{"file":'templ_attr.cif',"save":'face_angle'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              diffr_chi
     save_
 
 
save_exptl_crystal_face.diffr_kappa
    _definition.id             '_exptl_crystal_face.diffr_kappa'
     loop_
    _alias.definition_id       '_exptl_crystal_face.diffr_kappa'
                               '_exptl_crystal_face_diffr_kappa'
    _import.get        [{"file":'templ_attr.cif',"save":'face_angle'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              diffr_kappa
     save_
 
 
save_exptl_crystal_face.diffr_phi
    _definition.id             '_exptl_crystal_face.diffr_phi'
     loop_
    _alias.definition_id       '_exptl_crystal_face.diffr_phi'
                               '_exptl_crystal_face_diffr_phi'
    _import.get        [{"file":'templ_attr.cif',"save":'face_angle'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              diffr_phi
     save_
 
 
save_exptl_crystal_face.diffr_psi
    _definition.id             '_exptl_crystal_face.diffr_psi'
     loop_
    _alias.definition_id       '_exptl_crystal_face.diffr_psi'
                               '_exptl_crystal_face_diffr_psi'
    _import.get         [{"file":'templ_attr.cif',"save":'face_angle'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              diffr_psi
     save_
 
 
save_exptl_crystal_face.hkl
    _definition.id             '_exptl_crystal_face.hkl'
     loop_
    _alias.definition_id       '_exptl_crystal_face.hkl'
    _definition.update           2012-11-22
    _description.text
;
     Miller indices of the crystal face.
;
    _name.category_id            exptl_crystal_face
    _name.object_id              hkl
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Integer
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With f as exptl_crystal_face
 
      _exptl_crystal_face.hkl = [f.index_h, f.index_h, f.index_l]
;
     save_
 
 
save_exptl_crystal_face.index_h
    _definition.id             '_exptl_crystal_face.index_h'
     loop_
    _alias.definition_id       '_exptl_crystal_face.index_h'
                               '_exptl_crystal_face_index_h'
    _import.get       [{"file":'templ_attr.cif',"save":'Miller_index'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              index_h
     save_
 
 
save_exptl_crystal_face.index_k
    _definition.id             '_exptl_crystal_face.index_k'
     loop_
    _alias.definition_id       '_exptl_crystal_face.index_k'
                               '_exptl_crystal_face_index_k'
    _import.get        [{"file":'templ_attr.cif',"save":'Miller_index'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              index_k
     save_
 
 
save_exptl_crystal_face.index_l
    _definition.id             '_exptl_crystal_face.index_l'
     loop_
    _alias.definition_id       '_exptl_crystal_face.index_l'
                               '_exptl_crystal_face_index_l'
    _import.get        [{"file":'templ_attr.cif',"save":'Miller_index'}]
    _name.category_id            exptl_crystal_face
    _name.object_id              index_l
     save_
 
 
save_exptl_crystal_face.id
    _definition.id             '_exptl_crystal_face.id'
     loop_
    _alias.definition_id       '_exptl_crystal_face.id'
    _definition.update           2013-04-18
    _description.text
;
     Identifier which combines the crystal id and the face indices
     as a list. This is normally the key item of the category.
;
    _name.category_id            exptl_crystal_face
    _name.object_id              id
    _type.purpose                Composite
    _type.source                 Derived
    _type.container              List
    _type.contents              'Code,Matrix(Index,Index,index)'
    _type.dimension              [1]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With f as exptl_crystal_face
 
        _exptl_crystal_face.id = [ f.crystal_id, f.hkl ]
;
     save_
 
 
save_exptl_crystal_face.perp_dist
    _definition.id             '_exptl_crystal_face.perp_dist'
     loop_
    _alias.definition_id       '_exptl_crystal_face.perp_dist'
                               '_exptl_crystal_face_perp_dist'
    _definition.update           2012-11-22
    _description.text
;
     Perpendicular distance of face to the centre of rotation of the crystal.
;
    _name.category_id            exptl_crystal_face
    _name.object_id              perp_dist
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  millimetres
     save_
 
     save_    #----------- close of EXPTL_CRYSTAL_FACE category
 
#-------------------------------------------------------------------------------
 
save_EXPTL_CRYSTAL_APPEARANCE
 
    _definition.id               EXPTL_CRYSTAL_APPEARANCE
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of ENUMERATION items used to specify information about the
     crystal colour and appearance.
;
    _name.category_id            EXPTL_CRYSTAL
    _name.object_id              EXPTL_CRYSTAL_APPEARANCE
 
 
save_exptl_crystal_appearance.general
    _definition.id             '_exptl_crystal_appearance.general'
     loop_
    _alias.definition_id       '_exptl_crystal_appearance.general'
                               '_exptl_crystal_colour_lustre'
                               '_exptl_crystal.colour_lustre'
    _definition.update           2012-11-22
    _description.text
;
     Appearance of the crystal as prescribed state codes.
;
    _name.category_id            exptl_crystal_appearance
    _name.object_id              general
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state      'metallic'
                                'lustrous'
                                'transparent'
                                'transluscent'
                                'opaque'
                                '.'
    _enumeration.default        '.'
     save_
 
 
save_exptl_crystal_appearance.intensity
    _definition.id             '_exptl_crystal_appearance.intensity'
     loop_
    _alias.definition_id       '_exptl_crystal_appearance.intensity'
                               '_exptl_crystal_colour_modifier'
                               '_exptl_crystal.colour_modifier'
    _definition.update           2012-11-22
    _description.text
;
     Colour intensity of the crystal as prescribed state codes.
;
    _name.category_id            exptl_crystal_appearance
    _name.object_id              intensity
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state  dark      light     intense     pale
                            whitish   blackish  grayish    brownish
                            reddish   pinkish   orangish   yellowish
                            greenish  bluish    '.'
    _enumeration.default        '.'
     save_
 
 
save_exptl_crystal_appearance.hue
    _definition.id             '_exptl_crystal_appearance.hue'
     loop_
    _alias.definition_id       '_exptl_crystal_appearance.hue'
                               '_exptl_crystal_colour_primary'
                               '_exptl_crystal.colour_primary'
    _definition.update           2012-11-22
    _description.text
;
     Colour hue of the crystals as prescribed state codes.
;
    _name.category_id            exptl_crystal_appearance
    _name.object_id              hue
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
    _import.get       [{"file":'templ_enum.cif',"save":'colour_RGB'}]
    _enumeration.default        'white'
     save_
 
     save_    #------ close EXPTL_CRYSTAL_APPEARANCE category
 
     save_    #------ close EXPTL_CRYSTAL category
 
#---------------------------------------------------------------------------
 
save_EXPTL_ABSORPT
 
    _definition.id               EXPTL_ABSORPT
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to specify the experimental details
     of the  absorption measurements and corrections to the diffraction
     data.
;
    _name.category_id            EXPTL_CRYSTALS
    _name.object_id              EXPTL_ABSORPT
 
 
save_exptl_absorpt.coefficient_mu
    _definition.id             '_exptl_absorpt.coefficient_mu'
     loop_
    _alias.definition_id       '_exptl_absorpt.coefficient_mu'
                               '_exptl_absorpt_coefficient_mu'
                               '_exptl.absorpt_coefficient_mu'
    _definition.update           2012-11-22
    _description.text
;
     Absorption coefficient mu calculated from the atomic content of
     the cell, the density and the radiation wavelength.
;
    _name.category_id            exptl_absorpt
    _name.object_id              coefficient_mu
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  reciprocal_millimetres
     save_
 
 
save_exptl_absorpt.correction_T_max
    _definition.id             '_exptl_absorpt.correction_T_max'
     loop_
    _alias.definition_id       '_exptl_absorpt.correction_T_max'
                               '_exptl_absorpt_correction_T_max'
                               '_exptl.absorpt_correction_T_max'
    _definition.update           2012-11-22
    _description.text
;
     Maximum transmission factor for the crystal and radiation applied
     to the measured intensities, it includes the correction for
     absorption by the specimen mount and diffractometer as well
     as by the specimen itself. These values give the transmission (T)
     factor by which measured intensities have been REDUCED due to
     absorption. Sometimes referred to as absorption correction A or
     1/A* (see "Crystal Structure Analysis for Chemists and Biologists"
     by J.P. Glusker et al., Wiley)
;
    _name.category_id            exptl_absorpt
    _name.object_id              correction_T_max
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_exptl_absorpt.correction_T_min
    _definition.id             '_exptl_absorpt.correction_T_min'
     loop_
    _alias.definition_id       '_exptl_absorpt.correction_T_min'
                               '_exptl_absorpt_correction_T_min'
                               '_exptl.absorpt_correction_T_min'
    _definition.update           2012-11-22
    _description.text
;
     Maximum transmission factor for the crystal and radiation applied
     to the measured intensities, it includes the correction for
     absorption by the specimen mount and diffractometer as well
     as by the specimen itself. These values give the transmission (T)
     factor by which measured intensities have been REDUCED due to
     absorption. Sometimes referred to as absorption correction A ori
     1/A* (see "Crystal Structure Analysis for Chemists and Biologists"
     by J.P. Glusker et al., Wiley)
;
    _name.category_id            exptl_absorpt
    _name.object_id              correction_T_min
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_exptl_absorpt.correction_type
    _definition.id             '_exptl_absorpt.correction_type'
     loop_
    _alias.definition_id       '_exptl_absorpt.correction_type'
                               '_exptl_absorpt_correction_type'
                               '_exptl.absorpt_correction_type'
    _definition.update           2012-11-22
    _description.text
;
     Code identifying the absorption correction type and method.
     The 'empirical' approach should NOT be used if more detailed
     information on the crystal shape  is available.
;
    _name.category_id            exptl_absorpt
    _name.object_id              correction_type
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail  analytical  'analytical from crystal shape'
                             cylinder    'cylindrical'
                             empirical   'empirical from intensities'
                             gaussian    'Gaussian from crystal shape'
                             integration 'integration from crystal shape'
                             multi-scan  'symmetry-related measurements'
                             none        'no absorption correction applied'
                             numerical   'numerical from crystal shape'
                             psi-scan    'psi-scan corrections'
                             refdelf     'refined from delta-F'
                             sphere      'spherical'
    _enumeration.default     none
     save_
 
 
save_exptl_absorpt.process_details
    _definition.id             '_exptl_absorpt.process_details'
     loop_
    _alias.definition_id       '_exptl_absorpt.process_details'
                               '_exptl_absorpt_process_details'
                               '_exptl.absorpt_process_details'
    _definition.update           2012-11-22
    _description.text
;
     Description of the absorption correction process applied to the
     measured intensities. A literature reference should be supplied
     for psi-scan or multi-scan techniques.
;
    _name.category_id            exptl_absorpt
    _name.object_id              process_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'Tompa analytical'
                                'MolEN (Fair, 1990)'
                                '(North, Phillips & Mathews, 1968)'
     save_
 
     save_    #------ close EXPTL_ABSORPT category
 
     save_    #------ close EXPTL_CRYSTALS category
 
 
#============================================================================
 
save_CELL
 
    _definition.id               CELL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the parameters of
     the crystal unit cell and their measurement.
;
    _name.category_id            EXPTL
    _name.object_id              CELL
 
 
save_cell.atomic_mass
    _definition.id             '_cell.atomic_mass'
     loop_
    _alias.definition_id       '_cell.atomic_mass'
    _definition.update           2012-11-22
    _description.text
;
     Atomic mass of the contents of the unit cell. This calculated
     from the atom sites present in the ATOM_TYPE list, rather than
     the ATOM_SITE lists of atoms in the refined model.
;
    _name.category_id            cell
    _name.object_id              atomic_mass
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  dalton
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    mass = 0.
 
    Loop t as atom_type  {
 
                   mass += t.number_in_cell * t.atomic_mass
    }
      _cell.atomic_mass = mass
;
     save_
 
 
save_cell.formula_units_Z
    _definition.id             '_cell.formula_units_Z'
     loop_
    _alias.definition_id       '_cell.formula_units_Z'
                               '_cell_formula_units_Z'
    _definition.update           2012-11-22
    _description.text
;
     The number of the formula units in the unit cell as specified
     by _chemical_formula.structural, _chemical_formula.moiety or
     _chemical_formula.sum.
;
    _name.category_id            cell
    _name.object_id              formula_units_Z
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Count
    _enumeration.range           1:
     save_
 
 
save_cell.metric_tensor
    _definition.id             '_cell.metric_tensor'
     loop_
    _alias.definition_id       '_cell.metric_tensor'
    _definition.update           2012-11-22
    _description.text
;
     The direct space (covariant) metric tensor used to transform
     vectors and coordinates from real (direct) to reciprocal space.
;
    _name.category_id            cell
    _name.object_id              metric_tensor
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     with v  as  cell_vector
 
           _cell.metric_tensor = [[ v.a*v.a, v.a*v.b, v.a*v.c ],
                                  [ v.b*v.a, v.b*v.b, v.b*v.c ],
                                  [ v.c*v.a, v.c*v.b, v.c*v.c ]]
;
    save_
 
 
save_cell.orthogonal_matrix
    _definition.id             '_cell.orthogonal_matrix'
     loop_
    _alias.definition_id       '_cell.orthogonal_matrix'
    _definition.update           2012-11-22
    _description.text
;
     Orthogonal matrix of the crystal unit cell. Definition uses
     Rollet's axial assignments with cell vectors a,b,c aligned
     with orthogonal axes X,Y,Z so that c||Z and b in plane YZ.
;
    _name.category_id            cell
    _name.object_id              orthogonal_matrix
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With p  as  cell_length
     With q  as  cell_angle
     With r  as  cell_reciprocal_angle
 
    _cell.orthogonal_matrix =   [
          [  p.a*Sind(q.beta)*Sind(r.gamma),                 0,   0 ],
          [ -p.a*Sind(q.beta)*Cosd(r.gamma), p.b*Sind(q.alpha),   0 ],
          [  p.a*Cosd(q.beta),               p.b*Cosd(q.alpha), p.c ]]
;
     save_
 
 
save_cell.special_details
    _definition.id             '_cell.special_details'
     loop_
    _alias.definition_id       '_cell.special_details'
                               '_cell_special_details'
                               '_cell.details'
    _definition.update           2012-11-22
    _description.text
;
     Description of special aspects of the cell choice, noting
     possible alternative settings.
;
    _name.category_id            cell
    _name.object_id              special_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_cell.volume
    _definition.id             '_cell.volume'
     loop_
    _alias.definition_id       '_cell.volume'
                               '_cell_volume'
    _definition.update           2013-03-07
    _description.text
;
     Volume of the crystal unit cell.
;
    _name.category_id            cell
    _name.object_id              volume
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_cubed
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
      With v  as  cell_vector
 
      _cell.volume =  v.a * ( v.b ^ v.c )
;
     save_
 
 
save_cell.volume_su
    _definition.id             '_cell.volume_su'
     loop_
    _alias.definition_id       '_cell.volume_su'
                               '_cell_volume_su'
                               '_cell.volume_esd'
    _definition.update           2014-06-08
    _description.text
;
     Standard uncertainty of the volume of the crystal unit cell.
;
    _name.category_id            cell
    _name.object_id              volume_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_cubed
     save_
 
 
#----------------------------------------------------------------------------
 
 
save_CELL_ANGLE
 
    _definition.id               CELL_ANGLE
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the angles between
     the axes in the crystal unit cell.
;
    _name.category_id            CELL
    _name.object_id              CELL_ANGLE
 
 
save_cell_angle.alpha
    _definition.id             '_cell_angle.alpha'
     loop_
    _alias.definition_id       '_cell_angle.alpha'
                               '_cell_angle_alpha'
                               '_cell.angle_alpha'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_angle'}]
    _name.category_id            cell_angle
    _name.object_id              alpha
     save_
 
 
save_cell_angle.beta
    _definition.id             '_cell_angle.beta'
     loop_
    _alias.definition_id       '_cell_angle.beta'
                               '_cell_angle_beta'
                               '_cell.angle_beta'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_angle'}]
    _name.category_id            cell_angle
    _name.object_id              beta
     save_
 
 
save_cell_angle.gamma
    _definition.id             '_cell_angle.gamma'
     loop_
    _alias.definition_id       '_cell_angle.gamma'
                               '_cell_angle_gamma'
                               '_cell.angle_gamma'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_angle'}]
    _name.category_id            cell_angle
    _name.object_id              gamma
     save_
 
 
save_cell_angle.alpha_su
    _definition.id             '_cell_angle.alpha_su'
     loop_
    _alias.definition_id       '_cell_angle.alpha_su'
                               '_cell_angle_alpha_su'
                               '_cell.angle_alpha_esd'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_angle_su'}]
    _name.category_id            cell_angle
    _name.object_id              alpha_su
     save_
 
 
save_cell_angle.beta_su
    _definition.id             '_cell_angle.beta_su'
     loop_
    _alias.definition_id       '_cell_angle.beta_su'
                               '_cell_angle_beta_su'
                               '_cell.angle_beta_esd'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_angle_su'}]
    _name.category_id            cell_angle
    _name.object_id              beta_su
     save_
 
 
save_cell_angle.gamma_su
    _definition.id             '_cell_angle.gamma_su'
     loop_
    _alias.definition_id       '_cell_angle.gamma_su'
                               '_cell_angle_gamma_su'
                               '_cell.angle_gamma_esd'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_angle_su'}]
    _name.category_id            cell_angle
    _name.object_id              gamma_su
     save_
 
     save_     #-------- close of CELL_ANGLE category
 
 
#----------------------------------------------------------------------------
 
save_CELL_LENGTH
 
    _definition.id               CELL_LENGTH
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the lengths of
     the axes in the crystal unit cell.
;
    _name.category_id            CELL
    _name.object_id              CELL_LENGTH
 
 
save_cell_length.a
    _definition.id             '_cell_length.a'
     loop_
    _alias.definition_id       '_cell_length.a'
                               '_cell_length_a'
                               '_cell.length_a'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_length'}]
    _name.category_id            cell_length
    _name.object_id              a
     save_
 
 
save_cell_length.b
    _definition.id             '_cell_length.b'
     loop_
    _alias.definition_id       '_cell_length.b'
                               '_cell_length_b'
                               '_cell.length_b'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_length'}]
    _name.category_id            cell_length
    _name.object_id              b
     save_
 
 
save_cell_length.c
    _definition.id             '_cell_length.c'
     loop_
    _alias.definition_id       '_cell_length.c'
                               '_cell_length_c'
                               '_cell.length_c'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_length'}]
    _name.category_id            cell_length
    _name.object_id              c
     save_
 
 
save_cell_length.a_su
    _definition.id             '_cell_length.a_su'
     loop_
    _alias.definition_id       '_cell_length.a_su'
                               '_cell_length_a_su'
                               '_cell.length_a_esd'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_length_su'}]
    _name.category_id            cell_length
    _name.object_id              a_su
     save_
 
 
save_cell_length.b_su
    _definition.id             '_cell_length.b_su'
     loop_
    _alias.definition_id       '_cell_length.b_su'
                               '_cell_length_b_su'
                               '_cell.length_b_esd'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_length_su'}]
    _name.category_id            cell_length
    _name.object_id              b_su
     save_
 
 
save_cell_length.c_su
    _definition.id             '_cell_length.c_su'
     loop_
    _alias.definition_id       '_cell_length.c_su'
                               '_cell_length_c_su'
                               '_cell.length_c_esd'
    _import.get       [{"file":'templ_attr.cif',"save":'cell_length_su'}]
    _name.category_id            cell_length
    _name.object_id              c_su
     save_
 
 
     save_     #-------- close of CELL_LENGTH category
 
 
#----------------------------------------------------------------------------
 
save_CELL_VECTOR
 
    _definition.id               CELL_VECTOR
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the axial vectors of
     the crystal unit cell.
;
    _name.category_id            CELL
    _name.object_id              CELL_VECTOR
 
 
save_cell_vector.a
    _definition.id             '_cell_vector.a'
     loop_
    _alias.definition_id       '_cell_vector.a'
    _definition.update           2012-11-22
    _description.text
;
     The cell vector along the x axis.
;
    _name.category_id            cell_vector
    _name.object_id              a
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_vector.a = _cell.orthogonal_matrix * Matrix([1,0,0])
;
     save_
 
 
save_cell_vector.b
    _definition.id             '_cell_vector.b'
     loop_
    _alias.definition_id       '_cell_vector.b'
    _definition.update           2012-11-22
    _description.text
;
     The cell vector along the y axis.
;
    _name.category_id            cell_vector
    _name.object_id              b
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_vector.b = _cell.orthogonal_matrix * Matrix([0,1,0])
;
     save_
 
 
save_cell_vector.c
    _definition.id             '_cell_vector.c'
     loop_
    _alias.definition_id       '_cell_vector.c'
    _definition.update           2012-11-22
    _description.text
;
     The cell vector along the z axis.
;
    _name.category_id            cell_vector
    _name.object_id              c
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_vector.c = _cell.orthogonal_matrix * Matrix([0,0,1])
;
     save_
 
     save_    #------- close of CELL_VECTOR category
 
#----------------------------------------------------------------------------
 
save_CELL_MEASUREMENT
 
    _definition.id               CELL_MEASUREMENT
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the angles between
     the axes in the crystal unit cell.
;
    _name.category_id            CELL
    _name.object_id              CELL_MEASUREMENT
 
 
save_cell_measurement.pressure
    _definition.id             '_cell_measurement.pressure'
     loop_
    _alias.definition_id       '_cell_measurement.pressure'
                               '_cell_measurement_pressure'
    _definition.update           2012-11-22
    _description.text
;
     The pressure at which the unit-cell parameters were measured
     (not the pressure used to synthesize the sample).
;
    _name.category_id            cell_measurement
    _name.object_id              pressure
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kilopascals
     save_
 
 
save_cell_measurement.pressure_su
    _definition.id             '_cell_measurement.pressure_su'
     loop_
    _alias.definition_id       '_cell_measurement.pressure_su'
                               '_cell_measurement_pressure_su'
                               '_cell_measurement.pressure_esd'
    _definition.update           2014-06-08
    _description.text
;
     The standard uncertainty value that the temperature of
     the pressure at which the unit-cell parameters were measured
;
    _name.category_id            cell_measurement
    _name.object_id              pressure_su
    _type.purpose                SU
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kilopascals
     save_
 
 
save_cell_measurement.radiation
    _definition.id             '_cell_measurement.radiation'
     loop_
    _alias.definition_id       '_cell_measurement.radiation'
                               '_cell_measurement_radiation'
    _definition.update           2012-11-22
    _description.text
;
     Description of the radiation used to measure the unit-cell data.
;
    _name.category_id            cell_measurement
    _name.object_id              radiation
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'neutron'  'X-ray tube' 'synchrotron'
     save_
 
 
save_cell_measurement.reflns_used
    _definition.id             '_cell_measurement.reflns_used'
     loop_
    _alias.definition_id       '_cell_measurement.reflns_used'
                               '_cell_measurement_reflns_used'
    _definition.update           2012-11-22
    _description.text
;
     Total number of reflections used to determine the unit cell.
     The reflections may be specified as cell_measurement_refln items.
;
    _name.category_id            cell_measurement
    _name.object_id              reflns_used
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Count
    _enumeration.range           3:
     save_
 
 
save_cell_measurement.temperature
    _definition.id             '_cell_measurement.temperature'
     loop_
    _alias.definition_id       '_cell_measurement.temperature'
                               '_cell_measurement_temperature'
                               '_cell_measurement_temp'
                               '_cell_measurement.temp'
    _definition.update           2012-11-22
    _description.text
;
     The temperature at which the unit-cell parameters were measured
     (not the temperature of synthesis).
;
    _name.category_id            cell_measurement
    _name.object_id              temperature
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_cell_measurement.temperature_su
    _definition.id             '_cell_measurement.temperature_su'
     loop_
    _alias.definition_id       '_cell_measurement.temperature_su'
                               '_cell_measurement_temp_su'
                               '_cell_measurement.temp_esd'
    _definition.update           2012-11-22
    _description.text
;
     The standard uncertainty value that the temperature of
      the unit-cell parameters were measured
;
    _name.category_id            cell_measurement
    _name.object_id              temperature_su
    _type.purpose                SU
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_cell_measurement.theta_max
    _definition.id             '_cell_measurement.theta_max'
     loop_
    _alias.definition_id       '_cell_measurement.theta_max'
                               '_cell_measurement_theta_max'
    _definition.update           2012-11-22
    _description.text
;
     Maximum theta scattering angle of reflections used to measure
     the crystal unit cell.
;
    _name.category_id            cell_measurement
    _name.object_id              theta_max
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:90.0
    _units.code                  degrees
     save_
 
 
save_cell_measurement.theta_min
    _definition.id             '_cell_measurement.theta_min'
     loop_
    _alias.definition_id       '_cell_measurement.theta_min'
                               '_cell_measurement_theta_min'
    _definition.update           2012-11-22
    _description.text
;
     Minimum theta scattering angle of reflections used to measure
     the crystal unit cell.
;
    _name.category_id            cell_measurement
    _name.object_id              theta_min
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:90.0
    _units.code                  degrees
     save_
 
 
save_cell_measurement.wavelength
    _definition.id             '_cell_measurement.wavelength'
     loop_
    _alias.definition_id       '_cell_measurement.wavelength'
                               '_cell_measurement_wavelength'
    _definition.update           2012-11-22
    _description.text
;
     Wavelength of the radiation used to measure the unit cell.
     If this is not specified, the wavelength is assumed to be the
     same as that given in _diffrn_radiation_wavelength.value
;
    _name.category_id            cell_measurement
    _name.object_id              wavelength
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstroms
     save_
 
 
#----------------------------------------------------------------------------
 
save_CELL_MEASUREMENT_REFLN
 
    _definition.id               CELL_MEASUREMENT_REFLN
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe the reflection data
     used in the measurement of the crystal unit cell.
;
    _name.category_id            CELL_MEASUREMENT
    _name.object_id              CELL_MEASUREMENT_REFLN
    _category.key_id           '_cell_measurement_refln.key'
    _category.key_list        ['_cell_measurement_refln.index_h',
                               '_cell_measurement_refln.index_k',
                               '_cell_measurement_refln.index_l']
 
 
save_cell_measurement_refln.key
    _definition.id             '_cell_measurement_refln.key'
     loop_
    _alias.definition_id       '_cell_measurement_refln.key'
    _definition.update           2012-11-22
    _description.text
;
     Value is a unique key to a set of CELL_MEASUREMENT_REFLN items
     in a looped list.
;
    _name.category_id            cell_measurement_refln
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;          _type.contents = Type_Contents(cell_measurement_refln.hkl)
;
     Evaluation
;          _cell_measurement_refln.key = _cell_measurement_refln.hkl
;
     save_
 
 
save_cell_measurement_refln.hkl
    _definition.id             '_cell_measurement_refln.hkl'
     loop_
    _alias.definition_id       '_cell_measurement_refln.hkl'
    _definition.update           2012-11-22
    _description.text
;
     Miller indices of a reflection used to measure the unit cell.
;
    _name.category_id            cell_measurement_refln
    _name.object_id              hkl
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Integer
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c  as  cell_measurement_refln
 
     _cell_measurement_refln.hkl = [c.index_h, c.index_k, c.index_l]
;
     save_
 
 
save_cell_measurement_refln.theta
    _definition.id             '_cell_measurement_refln.theta'
     loop_
    _alias.definition_id       '_cell_measurement_refln.theta'
                               '_cell_measurement_refln_theta'
    _definition.update           2012-11-22
    _description.text
;
     Theta angle of reflection used to measure the crystal unit cell.
;
    _name.category_id            cell_measurement_refln
    _name.object_id              theta
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:90.0
    _units.code                  degrees
     save_
 
 
save_cell_measurement_refln.index_h
    _definition.id             '_cell_measurement_refln.index_h'
     loop_
    _alias.definition_id       '_cell_measurement_refln.index_h'
                               '_cell_measurement_refln_index_h'
    _import.get       [{"file":'templ_attr.cif',"save":'Miller_index'}]
    _name.category_id            cell_measurement_refln
    _name.object_id              index_h
     save_
 
 
save_cell_measurement_refln.index_k
    _definition.id             '_cell_measurement_refln.index_k'
     loop_
    _alias.definition_id       '_cell_measurement_refln.index_k'
                               '_cell_measurement_refln_index_k'
    _import.get       [{"file":'templ_attr.cif',"save":'Miller_index'}]
    _name.category_id            cell_measurement_refln
    _name.object_id              index_k
     save_
 
 
save_cell_measurement_refln.index_l
    _definition.id             '_cell_measurement_refln.index_l'
     loop_
    _alias.definition_id       '_cell_measurement_refln.index_l'
                               '_cell_measurement_refln_index_l'
    _import.get        [{"file":'templ_attr.cif',"save":'Miller_index'}]
    _name.category_id            cell_measurement_refln
    _name.object_id              index_l
     save_
 
     save_    #------- close of CELL_MEASUREMENT_REFLN category
 
     save_    #------- close of CELL_MEASUREMENT category
 
 
#----------------------------------------------------------------------------
 
 
save_CELL_RECIPROCAL
 
    _definition.id               CELL_RECIPROCAL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the unit cell data
     in reciprocal space.
;
    _name.category_id            CELL
    _name.object_id              CELL_RECIPROCAL
 
 
save_cell_reciprocal.convert_Uij_to_betaij
    _definition.id             '_cell_reciprocal.convert_Uij_to_betaij'
     loop_
    _alias.definition_id       '_cell_reciprocal.convert_Uij_to_betaij'
    _definition.update           2013-04-28
    _description.text
;
     The reciprocal space matrix for converting the U(ij) matrix of
     atomic displacement parameters to a dimensionless beta(IJ) matrix.
     The adp factor in a structure factor expression:
 
     t = exp -2pi**2 ( U11    h h a* a* + ...... 2 U23    k l b* c* )
     t = exp - 0.25  ( B11    h h a* a* + ...... 2 B23    k l b* c* )
       = exp -       ( beta11 h h + ............ 2 beta23 k l )
 
    The conversion of the U or B matrices to the beta matrix
 
         beta =   C U C   =    C B C /8pi**2
 
    where C is conversion matrix defined here.
;
    _name.category_id            cell_reciprocal
    _name.object_id              convert_Uij_to_betaij
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With r  as  cell_reciprocal_length
 
    _cell_reciprocal.convert_Uij_to_betaij = \
                             1.4142 * Pi * Matrix([[ r.a, 0, 0 ],
                                                   [ 0, r.b, 0 ],
                                                   [ 0, 0, r.c ]])
;
     save_
 
 
save_cell_reciprocal.convert_Uiso_to_Uij
    _definition.id             '_cell_reciprocal.convert_Uiso_to_Uij'
     loop_
    _alias.definition_id       '_cell_reciprocal.convert_Uiso_to_Uij'
    _definition.update           2013-04-28
    _description.text
;
     The reciprocal space matrix for converting the isotropic Uiso
     atomic displacement parameter to the anisotropic matrix Uij.
 
                       | 1            cos(gamma*)   cos(beta*)  |
      U[i,j]  = Uiso * | cos(gamma*)  1             cos(alpha*) |
                       | cos(beta*)   cos(alpha*)   1           |
 
;
    _name.category_id            cell_reciprocal
    _name.object_id              convert_Uiso_to_Uij
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With r  as  cell_reciprocal_angle
 
    _cell_reciprocal.convert_Uiso_to_Uij = \
                          [[ 1., Cosd(r.gamma), Cosd(r.beta)  ],
                           [ Cosd(r.gamma), 1., Cosd(r.alpha) ],
                           [ Cosd(r.beta), Cosd(r.alpha), 1.  ]]
;
     save_
 
 
save_cell_reciprocal.metric_tensor
    _definition.id             '_cell_reciprocal.metric_tensor'
     loop_
    _alias.definition_id       '_cell_reciprocal.metric_tensor'
    _definition.update           2012-11-22
    _description.text
;
     The reciprocal (contravariant) metric tensor used to transform
     vectors and coordinates from reciprocal space to real (direct)
     space.
;
    _name.category_id            cell_reciprocal
    _name.object_id              metric_tensor
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     with r  as  cell_reciprocal_vector
 
    _cell_reciprocal.metric_tensor = [[ r.a*r.a, r.a*r.b, r.a*r.c ],
                                      [ r.b*r.a, r.b*r.b, r.b*r.c ],
                                      [ r.c*r.a, r.c*r.b, r.c*r.c ]]
;
     save_
 
 
save_cell_reciprocal.orthogonal_matrix
    _definition.id             '_cell_reciprocal.orthogonal_matrix'
     loop_
    _alias.definition_id       '_cell_reciprocal.orthogonal_matrix'
    _definition.update           2012-11-22
    _description.text
;
     Orthogonal matrix of the reciprocal space. The matrix may be
     used to transform the non-orthogonal vector h = (h,k,l) into
     the orthogonal indices p = (p,q,r)
 
                     M h = p
;
    _name.category_id            cell_reciprocal
    _name.object_id              orthogonal_matrix
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_reciprocal.orthogonal_matrix  =  Inverse(
 
                           Transpose( _cell.orthogonal_matrix ))
;
     save_
 
 
#----------------------------------------------------------------------------
 
 
save_CELL_RECIPROCAL_ANGLE
 
    _definition.id               CELL_RECIPROCAL_ANGLE
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the unit cell angles
     in reciprocal space.
;
    _name.category_id            CELL_RECIPROCAL
    _name.object_id              CELL_RECIPROCAL_ANGLE
 
 
save_cell_reciprocal_angle.alpha
    _definition.id             '_cell_reciprocal_angle.alpha'
     loop_
    _alias.definition_id       '_cell_reciprocal_angle.alpha'
                               '_cell_reciprocal_angle_alpha'
                               '_cell.reciprocal_angle_alpha'
    _definition.update           2013-01-18
    _description.text
;
     Reciprocal of the angle between _cell_length.b and _cell_length.c.
     Ref: Buerger, M. J. (1942). X-ray Crystallography, p. 360.
          New York: John Wiley & Sons Inc.
;
    _name.category_id            cell_reciprocal_angle
    _name.object_id              alpha
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:180.
    _units.code                  degrees
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c as cell_angle
 
    _cell_reciprocal_angle.alpha = Acosd(
    (Cosd(c.beta)*Cosd(c.gamma)-Cosd(c.alpha))/(Sind(c.beta)*Sind(c.gamma)))
;
     save_
 
 
save_cell_reciprocal_angle.alpha_su
    _definition.id             '_cell_reciprocal_angle.alpha_su'
     loop_
    _alias.definition_id       '_cell_reciprocal_angle.alpha_su'
                               '_cell_reciprocal_angle_alpha_su'
                               '_cell.reciprocal_angle_alpha_esd'
    _definition.update           2013-01-18
    _description.text
;
     Standard Uncertainty of the
     Reciprocal of the angle between _cell_length.b and _cell_length.c.
;
    _name.category_id            cell_reciprocal_angle
    _name.object_id              alpha_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:180.
    _units.code                  degrees
    save_
 
 
save_cell_reciprocal_angle.beta
    _definition.id             '_cell_reciprocal_angle.beta'
     loop_
    _alias.definition_id       '_cell_reciprocal_angle.beta'
                               '_cell_reciprocal_angle_beta'
                               '_cell.reciprocal_angle_beta'
    _definition.update           2013-01-18
    _description.text
;
     Reciprocal of the angle between _cell_length.a and _cell_length.c.
     Ref: Buerger, M. J. (1942). X-ray Crystallography, p. 360.
          New York: John Wiley & Sons Inc.
;
    _name.category_id            cell_reciprocal_angle
    _name.object_id              beta
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:180.
    _units.code                  degrees
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c as cell_angle
 
    _cell_reciprocal_angle.beta = Acosd(
    (Cosd(c.alpha)*Cosd(c.gamma)-Cosd(c.beta))/(Sind(c.alpha)*Sind(c.gamma)))
;
     save_
 
 
save_cell_reciprocal_angle.beta_su
    _definition.id             '_cell_reciprocal_angle.beta_su'
     loop_
    _alias.definition_id       '_cell_reciprocal_angle.beta_su'
                               '_cell_reciprocal_angle_beta_su'
                               '_cell.reciprocal_angle_beta_esd'
    _definition.update           2013-01-18
    _description.text
;
     Standard Uncertainty of the
     Reciprocal of the angle between _cell_length.a and _cell_length.c.
;
    _name.category_id            cell_reciprocal_angle
    _name.object_id              beta_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:180.
    _units.code                  degrees
    save_
 
 
save_cell_reciprocal_angle.gamma
    _definition.id             '_cell_reciprocal_angle.gamma'
     loop_
    _alias.definition_id       '_cell_reciprocal_angle.gamma'
                               '_cell_reciprocal_angle_gamma'
                               '_cell.reciprocal_angle_gamma'
    _definition.update           2013-01-18
    _description.text
;
     Reciprocal of the angle between _cell_length.a and _cell_length.b.
     Ref: Buerger, M. J. (1942). X-ray Crystallography, p. 360.
          New York: John Wiley & Sons Inc.
;
    _name.category_id            cell_reciprocal_angle
    _name.object_id              gamma
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:180.
    _units.code                  degrees
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c as cell_angle
 
    _cell_reciprocal_angle.gamma = Acosd(
    (Cosd(c.alpha)*Cosd(c.beta)-Cosd(c.gamma))/(Sind(c.alpha)*Sind(c.beta)))
;
     save_
 
 
save_cell_reciprocal_angle.gamma_su
    _definition.id             '_cell_reciprocal_angle.gamma_su'
     loop_
    _alias.definition_id       '_cell_reciprocal_angle.gamma_su'
                               '_cell_reciprocal_angle_gamma_su'
                               '_cell.reciprocal_angle_gamma_esd'
    _definition.update           2013-01-18
    _description.text
;
     Standard Uncertainty of the
     Reciprocal of the angle between _cell_length.a and _cell_length.b.
;
    _name.category_id            cell_reciprocal_angle
    _name.object_id              gamma_su
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:180.
    _units.code                  degrees
    save_
 
 
     save_   #--------- close of CELL_RECIPROCAL_ANGLE category
 
 
#----------------------------------------------------------------------------
 
save_CELL_RECIPROCAL_LENGTH
 
    _definition.id               CELL_RECIPROCAL_LENGTH
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the unit cell lengths
     in reciprocal space.
;
    _name.category_id            CELL_RECIPROCAL
    _name.object_id              CELL_RECIPROCAL_LENGTH
 
 
save_cell_reciprocal_length.a
    _definition.id             '_cell_reciprocal_length.a'
     loop_
    _alias.definition_id       '_cell_reciprocal_length.a'
                               '_cell_reciprocal_length_a'
                               '_cell.reciprocal_length_a'
    _definition.update           2012-11-22
    _description.text
;
     Reciprocal of the _cell_length.a.
;
    _name.category_id            cell_reciprocal_length
    _name.object_id              a
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  reciprocal_angstroms
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_reciprocal_length.a = Norm ( _cell_reciprocal_vector.a )
;
     save_
 
 
save_cell_reciprocal_length.a_su
    _definition.id             '_cell_reciprocal_length.a_su'
     loop_
    _alias.definition_id       '_cell_reciprocal_length.a_su'
                               '_cell_reciprocal_length_a_su'
                               '_cell.reciprocal_length_a_esd'
    _definition.update           2012-11-22
    _description.text
;
     Standard Uncertainty of the reciprocal of the _cell_length.a.
;
    _name.category_id            cell_reciprocal_length
    _name.object_id              a_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  reciprocal_angstroms
    save_
 
 
save_cell_reciprocal_length.b
    _definition.id             '_cell_reciprocal_length.b'
     loop_
    _alias.definition_id       '_cell_reciprocal_length.b'
                               '_cell_reciprocal_length_b'
                               '_cell.reciprocal_length_b'
    _definition.update           2012-11-22
    _description.text
;
     Reciprocal of the _cell_length.b.
;
    _name.category_id            cell_reciprocal_length
    _name.object_id              b
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  reciprocal_angstroms
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_reciprocal_length.b = Norm ( _cell_reciprocal_vector.b )
;
     save_
 
 
save_cell_reciprocal_length.b_su
    _definition.id             '_cell_reciprocal_length.b_su'
     loop_
    _alias.definition_id       '_cell_reciprocal_length.b_su'
                               '_cell_reciprocal_length_b_su'
                               '_cell.reciprocal_length_b_esd'
    _definition.update           2012-11-22
    _description.text
;
     Standard Uncertainty of the reciprocal of the _cell_length.b.
;
    _name.category_id            cell_reciprocal_length
    _name.object_id              b_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  reciprocal_angstroms
    save_
 
 
save_cell_reciprocal_length.c
    _definition.id             '_cell_reciprocal_length.c'
     loop_
    _alias.definition_id       '_cell_reciprocal_length.c'
                               '_cell_reciprocal_length_c'
                               '_cell.reciprocal_length_c'
    _definition.update           2012-11-22
    _description.text
;
     Reciprocal of the _cell_length.c.
;
    _name.category_id            cell_reciprocal_length
    _name.object_id              c
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  reciprocal_angstroms
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _cell_reciprocal_length.c = Norm ( _cell_reciprocal_vector.c )
;
     save_
 
 
save_cell_reciprocal_length.c_su
    _definition.id             '_cell_reciprocal_length.c_su'
     loop_
    _alias.definition_id       '_cell_reciprocal_length.c_su'
                               '_cell_reciprocal_length_c_su'
                               '_cell.reciprocal_length_c_esd'
    _definition.update           2012-11-22
    _description.text
;
     Standard Uncertainty of the reciprocal of the _cell_length.c.
;
    _name.category_id            cell_reciprocal_length
    _name.object_id              c_su
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  reciprocal_angstroms
     save_
 
 
     save_   #--------- close of CELL_RECIPROCAL_LENGTH category
 
 
#----------------------------------------------------------------------------
 
save_CELL_RECIPROCAL_VECTOR
 
    _definition.id               CELL_RECIPROCAL_VECTOR
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe the unit cell vectors
     in reciprocal space.
;
    _name.category_id            CELL_RECIPROCAL
    _name.object_id              CELL_RECIPROCAL_VECTOR
 
 
save_cell_reciprocal_vector.a
    _definition.id             '_cell_reciprocal_vector.a'
     loop_
    _alias.definition_id       '_cell_reciprocal_vector.a'
    _definition.update           2012-11-22
    _description.text
;
     Reciprocal of the _cell_vector.a.
;
    _name.category_id            cell_reciprocal_vector
    _name.object_id              a
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c  as  cell_vector
 
    _cell_reciprocal_vector.a = c.b ^ c.c / _cell.volume
;
     save_
 
 
save_cell_reciprocal_vector.b
    _definition.id             '_cell_reciprocal_vector.b'
     loop_
    _alias.definition_id       '_cell_reciprocal_vector.b'
    _definition.update           2012-11-22
    _description.text
;
     Reciprocal of the _cell_vector.b.
;
    _name.category_id            cell_reciprocal_vector
    _name.object_id              b
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c  as  cell_vector
 
    _cell_reciprocal_vector.b = c.c ^ c.a / _cell.volume
;
     save_
 
 
save_cell_reciprocal_vector.c
    _definition.id             '_cell_reciprocal_vector.c'
     loop_
    _alias.definition_id       '_cell_reciprocal_vector.c'
    _definition.update           2012-11-22
    _description.text
;
     Reciprocal of the _cell_vector.c.
;
    _name.category_id            cell_reciprocal_vector
    _name.object_id              c
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With c  as  cell_vector
 
    _cell_reciprocal_vector.c = c.a ^ c.b / _cell.volume
;
     save_
 
     save_   #--------- close of CELL_RECIPROCAL_VECTOR category
 
     save_   #--------- close of CELL_RECIPROCAL category
 
     save_   #--------- close of CELL category
 
 
#============================================================================
 
save_CHEMICAL
 
    _definition.id               CHEMICAL
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items which describe the composition and
     chemical properties of the compound under study. The formula data
     items must be consistent with the density, unit-cell and Z values.
;
    _name.category_id            EXPTL
    _name.object_id              CHEMICAL
 
 
save_chemical.absolute_configuration
    _definition.id             '_chemical.absolute_configuration'
     loop_
    _alias.definition_id       '_chemical.absolute_configuration'
                               '_chemical_absolute_configuration'
    _definition.update           2012-11-22
    _description.text
;
     Necessary conditions for this assignment are given by
          Flack, H. D. & Bernardinelli, G. (1999). Acta Cryst. A55,
                       908-915. (http://www.iucr.org/paper?sh0129)
          Flack, H. D. & Bernardinelli, G. (2000). J. Appl. Cryst.
                       33, 1143-1148. (http://www.iucr.org/paper?ks0021)
;
    _name.category_id            chemical
    _name.object_id              absolute_configuration
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
     rm
;       'reference molecule' Absolute configuration established by
         the structure determination of a compound containing a
         chiral reference molecule of known absolute configuration.
;
     ad
;       'anomalous dispersion' Absolute configuration established by
         a-d effects in diffraction measurements on the crystal.
;
     rmad
;       'rm + ad' Absolute configuration established by the structure
         determination of a compound containing a chiral reference
         molecule of known absolute configuration and confirmed by
         a-d effects in diffraction measurements on the crystal.
;
     syn
;       'synthetic' Absolute configuration has not been established
         by anomalous-dispersion effects in diffraction measurements on
         the crystal. The enantiomer has been assigned by reference to
         an unchanging chiral centre in the synthetic procedure.
;
     unk
;       'unknown' No firm chemical or a-d evidence for an assignment
         is available. An arbitrary choice of enantiomer has been made.
;
    '.' 'inapplicable'
    _enumeration.default       '.'
     save_
 
 
save_chemical.compound_source
    _definition.id             '_chemical.compound_source'
     loop_
    _alias.definition_id       '_chemical.compound_source'
                               '_chemical_compound_source'
    _definition.update           2012-11-22
    _description.text
;
     Description of the source of the compound under study, or of the
     parent  molecule if a simple derivative is studied. This includes
     the place of  discovery for minerals or the actual source of a
     natural product.
;
    _name.category_id            chemical
    _name.object_id              compound_source
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_chemical.enantioexcess_bulk
    _definition.id             '_chemical.enantioexcess_bulk'
     loop_
    _alias.definition_id       '_chemical.enantioexcess_bulk'
                               '_chemical_enantioexcess_bulk'
    _definition.update           2013-01-18
    _description.text
;
     The enantioexcess of the bulk material from which the crystals
     were grown. A value of 0.0 indicates the racemate. A value of
     1.0 indicates that the compound is enantiomerically pure.
     Enantioexcess is defined in the IUPAC Recommendations
     (Moss et al., 1996). The composition of the crystal
     and bulk must be the same.
     Ref: Moss G. P. et al. (1996). Basic Terminology of
          Stereochemistry. Pure Appl. Chem., 68, 2193-2222.
          http://www.chem.qmul.ac.uk/iupac/stereo/index.html
;
    _name.category_id            chemical
    _name.object_id              enantioexcess_bulk
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_chemical.enantioexcess_bulk_technique
    _definition.id             '_chemical.enantioexcess_bulk_technique'
     loop_
    _alias.definition_id       '_chemical.enantioexcess_bulk_technique'
                               '_chemical_enantioexcess_bulk_technique'
    _definition.update           2013-01-18
    _description.text
;
     Technique used to determine the enantioexcess of the bulk compound.
;
    _name.category_id            chemical
    _name.object_id              enantioexcess_bulk_technique
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
     OA
;    Enantioexcess determined by measurement of the specific rotation
     of the optical activity of the bulk compound in solution.
;
     CD
;    Enantioexcess determined by measurement of the visible/near UV
     circular dichroism spectrum of the bulk compound in solution.
;
     EC
;    Enantioexcess determined by enantioselective chromatography of
     the bulk compound in solution.
;
     other
;    Enantioexcess determined by a technique not in this list.
;
    _enumeration.default       OA
     save_
 
 
save_chemical.enantioexcess_crystal
    _definition.id             '_chemical.enantioexcess_crystal'
     loop_
    _alias.definition_id       '_chemical.enantioexcess_crystal'
                               '_chemical_enantioexcess_crystal'
    _definition.update           2013-01-18
    _description.text
;
     The enantioexcess of the crystal used for the diffraction
     study. A value of 0.0 indicates the racemate. A value of
     1.0 indicates that the crystal is enantiomerically pure.
     Enantioexcess is defined in the IUPAC Recommendations
     (Moss et al., 1996).
     Ref: Moss G. P. et al. (1996). Basic Terminology of
          Stereochemistry. Pure Appl. Chem., 68, 2193-2222.
          http://www.chem.qmul.ac.uk/iupac/stereo/index.html
;
    _name.category_id            chemical
    _name.object_id              enantioexcess_crystal
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_chemical.enantioexcess_crystal_technique
    _definition.id             '_chemical.enantioexcess_crystal_technique'
     loop_
    _alias.definition_id       '_chemical.enantioexcess_crystal_technique'
                               '_chemical_enantioexcess_crystal_technique'
    _definition.update           2013-01-18
    _description.text
;
     Technique used to determine the enantioexcess of the crystal.
;
    _name.category_id            chemical
    _name.object_id              enantioexcess_crystal_technique
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
     CD
;    Enantioexcess determined by measurement of the visible/near UV
     circular dichroism spectrum of the crystal taken into solution.
;
     EC
;    Enantioexcess determined by enantioselective chromatography of
     the crystal taken into solution.
;
     other
;    Enantioexcess determined by a technique not in this list.
;
    _enumeration.default       CD
     save_
 
 
save_chemical.identifier_inchi
    _definition.id             '_chemical.identifier_inchi'
     loop_
    _alias.definition_id       '_chemical.identifier_inchi'
                               '_chemical_identifier_inchi'
    _definition.update           2013-01-18
    _description.text
;
     The IUPAC International Chemical Identifier (InChI) is a
     textual identifier for chemical substances, designed to provide
     a standard and human-readable way to encode molecular information
     and to facilitate the search for such information in databases
     and on the web.
     Ref: McNaught, A. (2006). Chem. Int. (IUPAC), 28 (6), 12-14.
          http://www.iupac.org/inchi/
;
    _name.category_id            chemical
    _name.object_id              identifier_inchi
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_ _description_example.case
           _description_example.detail
       InChI=1/C10H8/c1-2-6-10-8-4-3-7-9(10)5-1/h1-8H'     naphthalene
     save_
 
 
save_chemical.identifier_inchi_key
    _definition.id             '_chemical.identifier_inchi_key'
     loop_
    _alias.definition_id       '_chemical.identifier_inchi_key'
                               '_chemical_identifier_inchi_key'
    _definition.update           2013-01-18
    _description.text
;
     The InChIKey is a compact hashed version of the full InChI
     (IUPAC International Chemical Identifier), designed to allow
     for easy web searches of chemical compounds. See
     http://www.iupac.org/inchi/
;
    _name.category_id            chemical
    _name.object_id              identifier_inchi_key
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_ _description_example.case
           _description_example.detail
        'InChIKey=OROGSEYTTFOCAN-DNJOTXNNBG'    codeine
     save_
 
 
save_chemical.identifier_inchi_version
    _definition.id             '_chemical.identifier_inchi_version'
     loop_
    _alias.definition_id       '_chemical.identifier_inchi_version'
                               '_chemical_identifier_inchi_version'
    _definition.update           2013-01-18
    _description.text
;
     Version number of the InChI standard to which the associated
     chemical identifier string applies.
;
    _name.category_id            chemical
    _name.object_id              identifier_inchi_version
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_ _description_example.case   1.03
     save_
 
 
save_chemical.melting_point
    _definition.id             '_chemical.melting_point'
     loop_
    _alias.definition_id       '_chemical.melting_point'
                               '_chemical_melting_point'
    _definition.update           2012-11-22
    _description.text
;
     The temperature at which a crystalline solid changes to a liquid.
;
    _name.category_id            chemical
    _name.object_id              melting_point
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.melting_point_gt
    _definition.id             '_chemical.melting_point_gt'
     loop_
    _alias.definition_id       '_chemical.melting_point_gt'
                               '_chemical_melting_point_gt'
    _definition.update           2012-12-11
    _description.text
;
     A temperature above which the melting point lies.
     _chemical.melting_point should be used in preference where possible.
;
    _name.category_id            chemical
    _name.object_id              melting_point_gt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.melting_point_lt
    _definition.id             '_chemical.melting_point_lt'
     loop_
    _alias.definition_id       '_chemical.melting_point_lt'
                               '_chemical_melting_point_lt'
    _definition.update           2012-12-11
    _description.text
;
     A temperature below which the melting point lies.
     _chemical.melting_point should be used in preference where possible.
;
    _name.category_id            chemical
    _name.object_id              melting_point_lt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.name_common
    _definition.id             '_chemical.name_common'
     loop_
    _alias.definition_id       '_chemical.name_common'
                               '_chemical_name_common'
    _definition.update           2012-11-22
    _description.text
;
     Trivial name by which the compound is commonly known.
;
    _name.category_id            chemical
    _name.object_id              name_common
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_chemical.name_mineral
    _definition.id             '_chemical.name_mineral'
     loop_
    _alias.definition_id       '_chemical.name_mineral'
                               '_chemical_name_mineral'
    _definition.update           2012-11-22
    _description.text
;
     Mineral name accepted by the International Mineralogical Association.
     Use only for natural minerals.
;
    _name.category_id            chemical
    _name.object_id              name_mineral
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_chemical.name_structure_type
    _definition.id             '_chemical.name_structure_type'
     loop_
    _alias.definition_id       '_chemical.name_structure_type'
                               '_chemical_name_structure_type'
    _definition.update           2012-11-22
    _description.text
;
     Commonly used structure-type name. Usually only applied to
     minerals or inorganic compounds.
;
    _name.category_id            chemical
    _name.object_id              name_structure_type
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_chemical.name_systematic
    _definition.id             '_chemical.name_systematic'
     loop_
    _alias.definition_id       '_chemical.name_systematic'
                               '_chemical_name_systematic'
    _definition.update           2012-11-22
    _description.text
;
     IUPAC or Chemical Abstracts full name of compound.
;
    _name.category_id            chemical
    _name.object_id              name_systematic
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_chemical.optical_rotation
    _definition.id             '_chemical.optical_rotation'
     loop_
    _alias.definition_id       '_chemical.optical_rotation'
                               '_chemical_optical_rotation'
    _definition.update           2012-11-22
    _description.text
;
     The optical rotation in solution of the compound is
     specified in the following format:
 
        '[\a]^TEMP^~WAVE~ = SORT (c = CONC, SOLV)'
 
     where: TEMP is the temperature of the measurement in degrees Celsius,
            WAVE is an indication of the wavelength of the light
                 used for the measurement,
            CONC is the concentration of the solution given as the
                 mass of the substance in g in 100 ml of solution,
            SORT is the signed value (preceded by a + or a - sign)
                 of 100.\a/(l.c), where \a is the signed optical
                 rotation in degrees measured in a cell of length l in
                 dm and c is the value of CONC in g, and
            SOLV is the chemical formula of the solvent.
;
    _name.category_id            chemical
    _name.object_id              optical_rotation
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   '[\a]^25^~D~ = +108 (c = 3.42, CHCl~3~)'
     save_
 
 
save_chemical.properties_biological
    _definition.id             '_chemical.properties_biological'
     loop_
    _alias.definition_id       '_chemical.properties_biological'
                               '_chemical_properties_biological'
    _definition.update           2012-12-11
    _description.text
;
    A description of the biological properties of the material.
;
    _name.category_id            chemical
    _name.object_id              properties_biological
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case
;    diverse biological activities including use as a laxative
     and strong antibacterial activity against S. aureus and weak
     activity against cyclooxygenase-1 (COX-1)
;
;    antibiotic activity against Bacillus subtilis (ATCC 6051) but no
     significant activity against Candida albicans (ATCC 14053),
     Aspergillus flavus (NRRL 6541) & Fusarium verticillioides (NRRL 25457)
;
;    weakly potent lipoxygenase nonredox inhibitor
;
;    no influenza A virus sialidase inhibitory & plaque reduction activities
;
;    low toxicity against Drosophila melanogaster
;
     save_
 
 
save_chemical.properties_physical
    _definition.id             '_chemical.properties_physical'
     loop_
    _alias.definition_id       '_chemical.properties_physical'
                               '_chemical_properties_physical'
    _definition.update           2012-12-11
    _description.text
;
    A description of the physical properties of the material.
;
    _name.category_id            chemical
    _name.object_id              properties_physical
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case
       air-sensitive   moisture-sensitive   hygroscopic
       deliquescent    oxygen-sensitive    photo-sensitive
       pyrophoric      semiconductor
      'ferromagnetic at low temperature' 'paramagnetic and thermochromic'
     save_
 
 
save_chemical.temperature_decomposition
    _definition.id             '_chemical.temperature_decomposition'
     loop_
    _alias.definition_id       '_chemical.temperature_decomposition'
                               '_chemical_temperature_decomposition'
    _definition.update           2012-12-11
    _description.text
;
     The temperature at which a crystalline solid decomposes.
;
    _name.category_id            chemical
    _name.object_id              temperature_decomposition
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_decomposition_su
    _definition.id             '_chemical.temperature_decomposition_su'
     loop_
    _alias.definition_id       '_chemical.temperature_decomposition_su'
                               '_chemical_temperature_decomposition_su'
                               '_chemical.temperature_decomposition_esd'
    _definition.update           2012-12-11
    _description.text
;
     Standard Uncertainty of the
     temperature at which a crystalline solid decomposes.
;
    _name.category_id            chemical
    _name.object_id              temperature_decomposition_su
    _type.purpose                SU
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_decomposition_gt
    _definition.id             '_chemical.temperature_decomposition_gt'
     loop_
    _alias.definition_id       '_chemical.temperature_decomposition_gt'
                               '_chemical_temperature_decomposition_gt'
    _definition.update           2014-07-22
    _description.text
;
     The temperature above which a crystalline solid decomposes.
    _chemical.temperature_decomposition should be used in preference.
;
    _name.category_id            chemical
    _name.object_id              temperature_decomposition_gt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_decomposition_lt
    _definition.id             '_chemical.temperature_decomposition_lt'
     loop_
    _alias.definition_id       '_chemical.temperature_decomposition_lt'
                               '_chemical_temperature_decomposition_lt'
    _definition.update           2012-12-11
    _description.text
;
     The temperature below which a crystalline solid decomposes.
    _chemical.temperature_decomposition should be used in preference.
;
    _name.category_id            chemical
    _name.object_id              temperature_decomposition_lt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_sublimation
    _definition.id             '_chemical.temperature_sublimation'
     loop_
    _alias.definition_id       '_chemical.temperature_sublimation'
                               '_chemical_temperature_sublimation'
    _definition.update           2012-12-11
    _description.text
;
     The temperature at which a crystalline solid sublimates.
;
    _name.category_id            chemical
    _name.object_id              temperature_sublimation
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_sublimation_su
    _definition.id             '_chemical.temperature_sublimation_su'
     loop_
    _alias.definition_id       '_chemical.temperature_sublimation_su'
                               '_chemical_temperature_sublimation_su'
                               '_chemical.temperature_sublimation_esd'
    _definition.update           2012-12-11
    _description.text
;
     Standard Uncertainty of the
     temperature at which a crystalline solid sublimates.
;
    _name.category_id            chemical
    _name.object_id              temperature_sublimation_su
    _type.purpose                SU
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_sublimation_gt
    _definition.id             '_chemical.temperature_sublimation_gt'
     loop_
    _alias.definition_id       '_chemical.temperature_sublimation_gt'
                               '_chemical_temperature_sublimation_gt'
    _definition.update           2012-12-11
    _description.text
;
     The temperature above which a crystalline solid sublimates.
    _chemical.temperature_sublimation should be used in preference.
;
    _name.category_id            chemical
    _name.object_id              temperature_sublimation_gt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
 
save_chemical.temperature_sublimation_lt
    _definition.id             '_chemical.temperature_sublimation_lt'
     loop_
    _alias.definition_id       '_chemical.temperature_sublimation_lt'
                               '_chemical_temperature_sublimation_lt'
    _definition.update           2012-12-11
    _description.text
;
     The temperature below which a crystalline solid sublimates.
    _chemical.temperature_sublimation should be used in preference.
;
    _name.category_id            chemical
    _name.object_id              temperature_sublimation_lt
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  kelvins
     save_
 
#============================================================================
 
save_CHEMICAL_CONN_ATOM
 
    _definition.id               CHEMICAL_CONN_ATOM
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items which describe the 2D chemical structure of
     the molecular species. They allow a 2D chemical diagram to be
     reconstructed for use in a publication or in a database search
     for structural and substructural relationships. In particular,
     the chemical_conn_atom data items provide information about the
     chemical properties of the atoms in the structure. In cases
     where crystallographic and molecular symmetry elements coincide
     they must also contain symmetry-generated atoms, so as to describe
     a complete chemical entity.
 
;
    _name.category_id            CHEMICAL
    _name.object_id              CHEMICAL_CONN_ATOM
    _category.key_id           '_chemical_conn_atom.key'
    _category.key_list        ['_chemical_conn_atom.number']
 
 
save_chemical_conn_atom.key
    _definition.id             '_chemical_conn_atom.key'
     loop_
    _alias.definition_id       '_chemical_conn_atom.key'
    _definition.update           2012-11-22
    _description.text
;
     Value is a unique key to a set of CHEMICAL_CONN_ATOM items
     in a looped list.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;         _type.contents = Type_Contents(chemical_conn_atom.number))
;
     Evaluation
;         _chemical_conn_atom.key = _chemical_conn_atom.number
;
     save_
 
save_chemical_conn_atom.charge
    _definition.id             '_chemical_conn_atom.charge'
     loop_
    _alias.definition_id       '_chemical_conn_atom.charge'
                               '_chemical_conn_atom_charge'
    _definition.update           2012-11-22
    _description.text
;
     The net integer charge assigned to this atom. This is the
     formal charge assignment normally found in chemical diagrams.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              charge
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Integer
    _enumeration.range           -6:6
    _enumeration.default         0
     save_
 
 
save_chemical_conn_atom.display_x
    _definition.id             '_chemical_conn_atom.display_x'
     loop_
    _alias.definition_id       '_chemical_conn_atom.display_x'
                               '_chemical_conn_atom_display_x'
    _definition.update           2012-11-22
    _description.text
;
     Cartesian coordinate (x) of the atom site in a chemical diagram. The
     coordinate origin is at the lower left corner, the x axis is horizontal.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              display_x
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_chemical_conn_atom.display_y
    _definition.id             '_chemical_conn_atom.display_y'
     loop_
    _alias.definition_id       '_chemical_conn_atom.display_y'
                               '_chemical_conn_atom_display_y'
    _definition.update           2012-11-22
    _description.text
;
     Cartesian coordinate (y) of the atom site in a chemical diagram. The
     coordinate origin is at the lower left corner, the y axis is vertical.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              display_y
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_chemical_conn_atom.NCA
    _definition.id             '_chemical_conn_atom.NCA'
     loop_
    _alias.definition_id       '_chemical_conn_atom.NCA'
                               '_chemical_conn_atom_NCA'
    _definition.update           2012-11-22
    _description.text
;
     Total number of connected atoms excluding terminal hydrogen atoms.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              NCA
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Count
    _enumeration.range           0:
     save_
 
 
save_chemical_conn_atom.NH
    _definition.id             '_chemical_conn_atom.NH'
     loop_
    _alias.definition_id       '_chemical_conn_atom.NH'
                               '_chemical_conn_atom_NH'
    _definition.update           2012-11-22
    _description.text
;
     Total number of hydrogen atoms attached to this atom,
     regardless of whether they are included in the refinement or
     the atom_site list. This number will be the same as
     _atom_site.attached_hydrogens only if none of the hydrogen
     atoms appear in the atom_site list.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              NH
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           0:
     save_
 
 
save_chemical_conn_atom.number
    _definition.id             '_chemical_conn_atom.number'
     loop_
    _alias.definition_id       '_chemical_conn_atom.number'
                               '_chemical_conn_atom_number'
    _definition.update           2012-11-22
    _description.text
;
     The chemical sequence number to be associated with this atom.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              number
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:
     save_
 
 
save_chemical_conn_atom.type_symbol
    _definition.id             '_chemical_conn_atom.type_symbol'
     loop_
    _alias.definition_id       '_chemical_conn_atom.type_symbol'
                               '_chemical_conn_atom_type_symbol'
    _definition.update           2012-11-22
    _description.text
;
     A code identifying the atom type.
;
    _name.category_id            chemical_conn_atom
    _name.object_id              type_symbol
    _name.linked_item_id       '_atom_type.symbol'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Code
     save_
 
     save_    #------ close the CHEMICAL_CONN_ATOM category
 
#----------------------------------------------------------------------------
 
save_CHEMICAL_CONN_BOND
 
    _definition.id               CHEMICAL_CONN_BOND
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items which specify the connections between
     the atoms sites in the chemical_conn_atom list and the nature
     of the chemical bond between these atoms. These are details about
     the two-dimensional (2D) chemical structure of the molecular species.
     They allow a 2D chemical diagram to be reconstructed for use in a
     publication or in a database search for structural and substructural
     relationships.
 
;
    _name.category_id            CHEMICAL
    _name.object_id              CHEMICAL_CONN_BOND
    _category.key_id           '_chemical_conn_bond.key'
    _category.key_list        ['_chemical_conn_bond.atom_1',
                               '_chemical_conn_bond.atom_2']
 
 
save_chemical_conn_bond.key
    _definition.id             '_chemical_conn_bond.key'
     loop_
    _alias.definition_id       '_chemical_conn_bond.key'
    _definition.update           2012-11-22
    _description.text
;
     Value is a unique key to a set of CHEMICAL_CONN_BOND items
     in a looped list.
;
    _name.category_id            chemical_conn_bond
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;         _type.contents = Type_Contents(chemical_conn_bond.id)
;
     Evaluation
;         _chemical_conn_bond.key = _chemical_conn_bond.id
;
     save_
 
save_chemical_conn_bond.atom_1
    _definition.id             '_chemical_conn_bond.atom_1'
     loop_
    _alias.definition_id       '_chemical_conn_bond.atom_1'
                               '_chemical_conn_bond_atom_1'
                               '_chem_comp_bond.atom_id_1'
    _definition.update           2012-11-22
    _description.text
;
     Index id of first atom in a bond connecting two atom sites.
;
    _name.category_id            chemical_conn_bond
    _name.object_id              atom_1
    _name.linked_item_id       '_chemical_conn_atom.number'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:
     save_
 
 
save_chemical_conn_bond.atom_2
    _definition.id             '_chemical_conn_bond.atom_2'
     loop_
    _alias.definition_id       '_chemical_conn_bond.atom_2'
                               '_chemical_conn_bond_atom_2'
                               '_chem_comp_bond.atom_id_2'
    _definition.update           2012-11-22
    _description.text
;
     Index id of second atom in a bond connecting two atom sites.
;
    _name.category_id            chemical_conn_bond
    _name.linked_item_id       '_chemical_conn_atom.number'
    _name.object_id              atom_2
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:
     save_
 
 
save_chemical_conn_bond.id
    _definition.id             '_chemical_conn_bond.id'
     loop_
    _alias.definition_id       '_chemical_conn_bond.id'
    _definition.update           2012-11-22
    _description.text
;
     Bond identifier composed of a list of two sequence indices
     specified as _chemical_conn_atom.number values.
;
    _name.category_id            chemical_conn_bond
    _name.object_id              id
    _type.purpose                Number
    _type.source                 Derived
    _type.container              List
    _type.contents               Index
    _type.dimension              [2]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With  c  as  chemical_conn_bond
 
    _chemical_conn_bond.id =  [ c.atom_1, c.atom_2 ]
;
     save_
 
 
save_chemical_conn_bond.type
    _definition.id             '_chemical_conn_bond.type'
     loop_
    _alias.definition_id       '_chemical_conn_bond.type'
                               '_chemical_conn_bond_type'
                               '_chem_comp_bond.value_order'
    _definition.update           2012-11-22
    _description.text
;
     Code for the chemical bond type.
;
    _name.category_id            chemical_conn_bond
    _name.object_id              type
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail      sing    'single bond'
                                 doub    'double bond'
                                 trip    'triple bond'
                                 quad    'quadruple bond'
                                 arom    'aromatic bond'
                                 poly    'polymeric bond'
                                 delo    'delocalized double bond'
                                 pi      'pi bond'
    _enumeration.default         sing
     save_
 
 
save_chemical_conn_bond.distance
    _definition.id             '_chemical_conn_bond.distance'
     loop_
    _alias.definition_id       '_chemical_conn_bond.distance'
                               '_chem_comp_bond.value_dist'
    _definition.update           2014-06-12
    _description.text
;
     The value that should be taken as the target for the chemical
     bond associated with the specified atoms, expressed as a
     distance.
;
    _name.category_id            chemical_conn_bond
    _name.object_id              distance
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.5:
    _enumeration.default         0.0
    _units.code                  angstroms
     save_
 
 
save_chemical_conn_bond.distance_su
    _definition.id             '_chemical_conn_bond.distance_su'
     loop_
    _alias.definition_id       '_chemical_conn_bond.distance_su'
                               '_chem_comp_bond.value_dist_esd'
    _definition.update         2014-06-12
    _description.text
;
     The value that should be taken as the target for the chemical
     bond associated with the specified atoms, expressed as a
     distance.
;
    _name.category_id            chemical_conn_bond
    _name.object_id              distance_su
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.5:
    _enumeration.default         0.0
    _units.code                  angstroms
     save_
 
     save_     #------ close the CHEMICAL_CONN_BOND category
 
 
#----------------------------------------------------------------------------
 
save_CHEMICAL_FORMULA
 
    _definition.id               CHEMICAL_FORMULA
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items which specify the composition and chemical
     properties of the compound. The formula data items must agree
     with those that specify the density, unit-cell and Z values.
 
     The following rules apply to the construction of the data items
     _chemical_formula.analytical, *.structural and *.sum. For the
     data item *.moiety the formula construction is broken up into
     residues or moieties, i.e. groups of atoms that form a molecular
     unit or molecular ion. The  rules given below apply within each
     moiety but different requirements apply to the way that moieties
     are connected (see _chemical_formula.moiety).
 
     1. Only recognized element symbols may be used.
 
     2. Each element symbol is followed by a 'count' number. A count of
        '1' may be omitted.
 
     3. A space or parenthesis must separate each cluster of (element
        symbol + count).
 
     4. Where a group of elements is enclosed in parentheses, the
        multiplier for the group must follow the closing parentheses.
        That is, all element and group multipliers are assumed to be
        printed as subscripted numbers. [An exception to this rule
        exists for *.moiety formulae where pre- and post-multipliers
        are permitted for molecular units].
 
     5. Unless the elements are ordered in a manner that corresponds to
        their chemical structure, as in _chemical_formula.structural,
        the order of the elements within any group or moiety
        depends on whether or not carbon is present. If carbon is
        present, the order should be: C, then H, then the other
        elements in alphabetical order of their symbol. If carbon is
        not present, the elements are listed purely in alphabetic order
        of their symbol. This is the 'Hill' system used by Chemical
        Abstracts. This ordering is used in _chemical_formula.moiety
        and _chemical_formula.sum.
 
           _chemical_formula.iupac      '[Mo (C O)4 (C18 H33 P)2]'
           _chemical_formula.moiety     'C40 H66 Mo O4 P2'
           _chemical_formula.structural '((C O)4 (P (C6 H11)3)2)Mo'
           _chemical_formula.sum         'C40 H66 Mo O4 P2'
           _chemical_formula.weight      768.81
;
    _name.category_id            CHEMICAL
    _name.object_id              CHEMICAL_FORMULA
 
 
save_chemical_formula.analytical
    _definition.id             '_chemical_formula.analytical'
     loop_
    _alias.definition_id       '_chemical_formula.analytical'
                               '_chemical_formula_analytical'
    _definition.update           2012-11-22
    _description.text
;
     Formula determined by standard chemical analysis including trace
     elements. Parentheses are used only for standard uncertainties (su's).
;
    _name.category_id            chemical_formula
    _name.object_id              analytical
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case    'Fe2.45(2)  Ni1.60(3)  S4'
     save_
 
 
save_chemical_formula.iupac
    _definition.id             '_chemical_formula.iupac'
     loop_
    _alias.definition_id       '_chemical_formula.iupac'
                               '_chemical_formula_iupac'
    _definition.update           2012-11-22
    _description.text
;
     Formula expressed in conformance with IUPAC rules for inorganic
     and metal-organic compounds where these conflict with the rules
     for any other chemical_formula entries. Typically used for
     formatting a formula in accordance with journal rules. This
     should appear in the data block in addition to the most
     appropriate of the other chemical_formula data names.
     Ref: IUPAC (1990). Nomenclature of Inorganic Chemistry.
          Oxford: Blackwell Scientific Publications.
;
    _name.category_id            chemical_formula
    _name.object_id              iupac
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case    '[Co Re (C12 H22 P)2 (C O)6].0.5C H3 O H'
     save_
 
 
save_chemical_formula.moiety
    _definition.id             '_chemical_formula.moiety'
     loop_
    _alias.definition_id       '_chemical_formula.moiety'
                               '_chemical_formula_moiety'
    _definition.update           2012-11-22
    _description.text
;
     Formula with each discrete bonded residue or ion shown as a
     separate moiety. See above CHEMICAL_FORMULA for rules
     for writing chemical formulae. In addition to the general
     formulae requirements, the following rules apply:
        1. Moieties are separated by commas ','.
        2. The order of elements within a moiety follows general rule
           5 in CHEMICAL_FORMULA.
        3. Parentheses are not used within moieties but may surround
           a moiety. Parentheses may not be nested.
        4. Charges should be placed at the end of the moiety. The
           Singlege '+' or '-' may be preceded by a numerical multiplier
           and should be separated from the last (element symbol +
           count) by a space. Pre- or post-multipliers may be used for
           individual moieties.
;
    _name.category_id            chemical_formula
    _name.object_id              moiety
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'C7 H4 Cl Hg N O3 S'
                                'C12 H17 N4 O S 1+, C6 H2 N3 O7 1-'
                                'C12 H16 N2 O6, 5(H2 O1)'
                                "(Cd 2+)3, (C6 N6 Cr 3-)2, 2(H2 O)"
     save_
 
 
save_chemical_formula.structural
    _definition.id             '_chemical_formula.structural'
     loop_
    _alias.definition_id       '_chemical_formula.structural'
                               '_chemical_formula_structural'
    _definition.update           2012-11-22
    _description.text
;
     This formula should correspond to the structure as reported, i.e.
     trace elements not included in atom type and atom site lists should
     not be included. See category description for the rules for writing
     chemical formulae for inorganics, organometallics, metal complexes
     etc., in which  bonded groups are preserved as discrete entities
     within parentheses, with post-multipliers as required. The order of
     the elements should give as much information as possible about the
     chemical structure.  Parentheses may be used and nested as required.
     This formula should correspond to the structure as actually reported,
     i.e. trace elements not included in atom-type and atom-site lists
     should not be included (see also _chemical_formula.analytical).
;
    _name.category_id            chemical_formula
    _name.object_id              structural
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   '(Pt (N H3)2 (C5 H7 N3 O)2) (Cl O4)2'
                                'Ca ((Cl O3)2 O)2 (H2 O)6'
     save_
 
 
save_chemical_formula.sum
    _definition.id             '_chemical_formula.sum'
     loop_
    _alias.definition_id       '_chemical_formula.sum'
                               '_chemical_formula_sum'
    _definition.update           2012-11-22
    _description.text
;
     Chemical formulae in which all discrete bonded residues and ions are
     summed over the constituent elements, following the ordering given
     in rule 5 of the CATEGORY description. Parentheses normally not used.
;
    _name.category_id            chemical_formula
    _name.object_id              sum
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'C18 H19 N7 O8 S'
     save_
 
 
save_chemical_formula.weight
    _definition.id             '_chemical_formula.weight'
     loop_
    _alias.definition_id       '_chemical_formula.weight'
                               '_chemical_formula_weight'
    _definition.update           2012-11-22
    _description.text
;
     Mass corresponding to the formulae _chemical_formula.structural,
     *_iupac, *_moiety or *_sum and, together with the Z value and cell
     parameters yield the density given as _exptl_crystal.density_diffrn.
;
    _name.category_id            chemical_formula
    _name.object_id              weight
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           1.0:
    _units.code                  dalton
     save_
 
 
save_chemical_formula.weight_meas
    _definition.id             '_chemical_formula.weight_meas'
     loop_
    _alias.definition_id       '_chemical_formula.weight_meas'
                               '_chemical_formula_weight_meas'
    _definition.update           2012-11-22
    _description.text
;
     Formula mass measured by a non-diffraction experiment.
;
    _name.category_id            chemical_formula
    _name.object_id              weight_meas
    _type.purpose                Measurand
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Real
    _enumeration.range           1.0:
    _units.code                  dalton
     save_
 
     save_     #------ close the CHEMICAL_FORMULA category
 
     save_     #------ close the CHEMICAL category
 
 
#============================================================================
 
save_SPACE_GROUPS
    _definition.id               SPACE_GROUPS
    _definition.scope            Category
    _definition.class            Ref-loop
    _definition.update           2013-09-08
    _description.text
;
     Contains all the data items that refer to the space group as a
     whole, such as its name, crystal system etc. It may be looped,
     for example, in a list of space groups and their properties.
 
     Only a subset of the SPACE_GROUP category items appear in the
     core dictionary.  The remainder are found in the cif_sym
     dictionary.
 
     Space group types are identified by their International Tables
     for Crystallography Vol. A number. Specific settings of the
     space groups can be identified either by their Hall symbol
     or by specifying their symmetry operations.
 
     The commonly-used Hermann-Mauguin symbol determines the
     space group type uniquely but several different Hermann-Mauguin
     symbols may refer to the same space group type. It contains
     information on the choice of the basis, but not on the
     choice of origin.  Different formats for the Hermann-Mauguin
     symbol are found in the cif_sym dictionary.
 
;
    _name.category_id            EXPTL
    _name.object_id              SPACE_GROUPS
    _category.key_id           '_space_groups.key'
    _category.key_list        ['_space_groups.key']
 
     loop_
    _description_example.case
;
     In an instance document this category is typically invoked as
 
            loop_ _exptl_crystals.key
                           ${"frame":"space_group_1"}$
                           ${"frame":"space_group_2"}$
;
 
 
save_space_groups.key
    _definition.id             '_space_groups.key'
     loop_
    _alias.definition_id       '_space_groups.key'
    _definition.update           2012-11-22
    _description.text
;
     Unique key code to a set of SPACE_GROUP items in a looped list.
;
    _name.category_id            space_groups
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Ref-table
    _type.contents               Code
     loop_
    _description_example.case  '       ${"frame":"sg_set_1}$      '
     save_
 
#----------------------------------------------------------------------------
 
save_SPACE_GROUP
 
    _definition.id               SPACE_GROUP
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to specify space group
     information about the crystal used in the diffraction measurements.
;
    _name.category_id            SPACE_GROUPS
    _name.object_id              SPACE_GROUP
 
 
save_space_group.id
    _definition.id             '_space_group.id'
     loop_
    _alias.definition_id       '_space_group.id'
                               '_space_group_id'
    _definition.update           2012-11-22
    _description.text
;
     Code identifying a space group if multiple symmetries.
     See _exptl_crystals.key.
;
    _name.category_id            space_group
    _name.object_id              id
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_space_group.crystal_system
    _definition.id             '_space_group.crystal_system'
     loop_
    _alias.definition_id       '_space_group.crystal_system'
    _definition.update           2014-06-12
    _description.text
;
     The name of the system of geometric crystal classes of space
     groups (crystal system) to which the space group belongs.
     Note that rhombohedral space groups belong to the
     trigonal system.
;
    _name.category_id            space_group
    _name.object_id              crystal_system
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_ _enumeration_set.state
         triclinic
         monoclinic
         orthorhombic
         tetragonal
         trigonal
         hexagonal
         cubic
    _enumeration.default         triclinic
    save_
 
 
save_space_group.IT_number
    _definition.id             '_space_group.IT_number'
     loop_
    _alias.definition_id       '_space_group.IT_number'
                               '_space_group_IT_number'
    _definition.update           2012-11-22
    _description.text
;
     The number as assigned in International Tables for Crystallography
     Vol A, specifying the proper affine class (i.e. the orientation
     preserving affine class) of space groups (crystallographic space
     group type) to which the space group belongs. This number defines
     the space group type but not the coordinate system expressed.
;
    _name.category_id            space_group
    _name.object_id              IT_number
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Integer
    _enumeration.range           1:
     save_
 
 
save_space_group.name_Hall
    _definition.id             '_space_group.name_Hall'
     loop_
    _alias.definition_id       '_space_group.name_Hall'
                               '_space_group_name_Hall'
    _definition.update           2012-11-22
    _description.text
;
     Space group symbol defined by Hall. Each component of the
     space group name is separated by a space or an underscore.
     The use of space is strongly recommended because it specifies
     the coordinate system. The underscore in the name is only
     retained because it was used in earlier archived files. It
     should not be used in new CIFs.
     Ref: Hall, S. R. (1981). Acta Cryst. A37, 517-525
          [See also International Tables for Crystallography,
          Vol.B (1993) 1.4 Appendix B]
;
    _name.category_id            space_group
    _name.object_id              name_Hall
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'P 2ac  2n' '-R 3 2"'  'P 61 2 2 (0 0 -1)'
     save_
 
 
save_space_group.name_H_M_alt
    _definition.id             '_space_group.name_H_M_alt'
     loop_
    _alias.definition_id       '_space_group.name_H_M_alt'
                               '_space_group_name_H-M_alt'
                               '_space_group.name_H-M_alt'
    _definition.update           2013-03-09
    _description.text
;
    _space_group.name_H_M_alt allows for any Hermann-Mauguin symbol
     to be given. The way in which this item is used is determined
     by the user and in general is not intended to be interpreted by
     computer. It may, for example, be used to give one of the
     extended Hermann-Mauguin symbols given in Table 4.3.1 of
     International Tables for Crystallography Vol. A (1995) or
     a Hermann-Mauguin symbol for a conventional or unconventional
     setting.
     Each component of the space group name is separated by a
     space or underscore. The use of space is strongly
     recommended.  The underscore is only retained because it
     was used in earlier archived files. It should not be
     used in new CIFs. Subscripts should appear without special
     symbols. Bars should be given as negative signs before the
     numbers to which they apply.
     The commonly used Hermann-Mauguin symbol determines the space
     group type uniquely but a given space group type may be
     described by more than one Hermann-Mauguin symbol. The space
     group type is best described using _space_group_IT_number.
     The Hermann-Mauguin symbol may contain information on the
     choice of basis though not on the choice of origin. To
     define the setting uniquely use _space_group.name_Hall or
     list the symmetry operations.
;
    _name.category_id            space_group
    _name.object_id              name_H_M_alt
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case
    _description_example.detail
          'P 1 21/m 1'                     'space group No. 10'
          'P 2/n 2/n 2/n (origin at -1)'   'space group No. 48 origin 2'
          'R -3 2/m'                       'space group No. 166 rhomb'
;         loop_
         _space_group.id
         _space_group.name_H_M_alt
                          '1'   'C m c m'
                          '2'   'C 2/c 2/m 21/m'
                          '3'   'A m a m'
;
                               'three examples for space group No. 63'
 
     save_
 
 
#-------------------------------------------------------------------------
 
save_SPACE_GROUP_SYMOP
 
    _definition.id               SPACE_GROUP_SYMOP
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe symmetry equivalent sites
     in the crystal unit cell.
;
    _name.category_id            SPACE_GROUP
    _name.object_id              SPACE_GROUP_SYMOP
    _category.key_id           '_space_group_symop.key'
    _category.key_list        ['_space_group_symop.id']
 
 
save_space_group_symop.key
    _definition.id             '_space_group_symop.key'
     loop_
    _alias.definition_id       '_space_group_symop.key'
    _definition.update           2012-11-22
    _description.text
;
     Value is a unique key to a set of space_group_symop items
     in a looped list.
;
    _name.category_id            space_group_symop
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;         _type.contents = Type_Contents(_space_group_symop.id)
;
     Evaluation
;         _symmetry_equiv.key = _space_group_symop.id
;
     save_
 
 
save_space_group_symop.id
    _definition.id             '_space_group_symop.id'
     loop_
    _alias.definition_id       '_space_group_symop.id'
                               '_space_group_symop_id'
                               '_space_group_symop.sg_id'
                               '_space_group_symop_sg_id'
    _definition.update           2012-11-22
    _description.text
;
     A sequential number that identifies each symmetry operation.
     The identity operation (i.e. _space_group_symop.operation_xyz
     set to 'x,y,z') should be set to 1.
;
    _name.category_id            space_group_symop
    _name.object_id              id
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:
     save_
 
save_space_group_symop.operation_xyz
    _definition.id             '_space_group_symop.operation_xyz'
     loop_
    _alias.definition_id       '_space_group_symop.operation_xyz'
                               '_space_group_symop_operation_xyz'
    _definition.update           2012-11-22
    _description.text
;
     A parsable string giving one of the symmetry operations of the
     space group in algebraic form.  If W is a matrix representation
     of the rotational part of the symmetry operation defined by the
     positions and signs of x, y and z, and w is a column of
     translations defined by fractions, an equivalent position
     X' is generated from a given position X by the equation
 
               X' = WX + w
 
     (Note: X is used to represent bold_italics_x in International
     Tables for Crystallography Vol. A, Part 5)
 
     When a list of symmetry operations is given, it must contain
     a complete set of coordinate representatives which generates
     all the operations of the space group by the addition of
     all primitive translations of the space group. Such
     representatives are to be found as the coordinates of
     the general-equivalent position in International Tables for
     Crystallography Vol. A (2002), to which it is necessary to
     add any centring translations shown above the
     general-equivalent position.
 
     That is to say, it is necessary to list explicitly all the
     symmetry operations required to generate all the atoms in
     the unit cell defined by the setting used.
;
    _name.category_id            space_group_symop
    _name.object_id              operation_xyz
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case
    _description_example.detail
                                 'x,1/2-y,1/2+z'
    "glide reflection through the plane (x,1/4,z) with glide vector (1/2)c"
     save_
 
     save_   #------- close the SPACE_GROUP_SYMOP category
 
     save_   #------- close the SPACE_GROUP category
 
     save_   #------- close the SPACE_GROUPS category
 
 
#=======================================================================
 
save_SYMMETRY
 
    _definition.id               SYMMETRY
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-22
    _description.text
;
     The CATEGORY of data items used to describe symmetry information
     used in crystallographic structure studies.
;
    _name.category_id            EXPTL
    _name.object_id              SYMMETRY
 
 
save_symmetry.cell_setting
    _definition.id             '_symmetry.cell_setting'
     loop_
    _alias.definition_id       '_symmetry.cell_setting'
                               '_symmetry_cell_setting'
                               '_space_group_crystal_system'
    _definition.update           2013-04-11
    _description.text
;
     Code for cell settings for this space-group symmetry.
;
    _name.category_id            symmetry
    _name.object_id              cell_setting
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state       triclinic
                                 monoclinic
                                 orthorhombic
                                 tetragonal
                                 rhombohedral
                                 trigonal
                                 hexagonal
                                 cubic
    _enumeration.default         triclinic
     loop_
    _method.purpose
    _method.expression
     Validation
;
    setting = _symmetry.cell_setting
    a   = _cell_length.a
    b   = _cell_length.b
    c   = _cell_length.c
    d   = 0.01
    alp = _cell_angle.alpha
    bet = _cell_angle.beta
    gam = _cell_angle.gamma
    warn_len = 'Possible mismatch between cell lengths and cell setting'
    warn_ang = 'Possible mismatch between cell angles and cell setting'
 
    If(setting == 'triclinic') {
      If( Abs(a-b)<d || Abs(a-c)<d || Abs(b-c)<d )          Alert('B', warn_len)
      If( Abs(alp-90)<d || Abs(bet-90)<d || Abs(gam-90)<d ) Alert('B', warn_ang)
    }
    Else If(setting == 'monoclinic') {
      If(( Abs(a-b)<d && Abs(a-c)<d ) ||
         ( Abs(a-b)<d && Abs(b-c)<d ) ||
         ( Abs(a-c)<d && Abs(b-c)<d ))                      Alert('B', warn_len)
      If( Abs(alp-90)<d && Abs(bet-90)<d && Abs(gam-90)<d ) Alert('B', warn_ang)
      If(( Abs(alp-90)>d && Abs(bet-90)>d ) ||
         ( Abs(alp-90)>d && Abs(gam-90)>d ) ||
         ( Abs(bet-90)>d && Abs(gam-90)>d ) )               Throw( warn_ang)
    }
    Else If(setting == 'orthorhombic') {
      If( Abs(a-b)<d || Abs(a-c)<d || Abs(b-c)<d )          Alert('B',warn_len)
      If( Abs(alp-90)>d || Abs(bet-90)>d || Abs(gam-90)>d ) Throw( warn_ang)
    }
    Else If(setting == 'tetragonal') {
      If( Abs(a-b)<d && Abs(a-c)<d && Abs(b-c)<d )          Alert('B',warn_len)
      If( Abs(a-b)>d && Abs(a-c)>d )                        Throw( warn_len)
      If( Abs(alp-90)>d || Abs(bet-90)>d || Abs(gam-90)>d ) Throw( warn_ang)
    }
    Else If(setting == 'trigonal' || setting == 'hexagonal') {
      If( Abs(a-b)<d && Abs(a-c)<d && Abs(b-c)<d )          Alert('B', warn_len)
      If( Abs(a-b)>d && Abs(a-c)>d )                        Throw( warn_len)
      If( Abs(alp-90)<d && Abs(bet-90)<d && Abs(gam-90)<d ) Throw( warn_ang)
      If( Abs(gam-120)>d || Abs(alp-90)>d || Abs(bet-90)>d) Throw( warn_ang)
    }
    Else If(setting == 'rhombohedral') {
      If( Abs(a-b)>d || Abs(a-c)>d || Abs(b-c)>d )          Throw( warn_len)
      If( Abs(alp-90)<d || Abs(bet-90)<d || Abs(gam-90)<d ) Alert('B', warn_ang)
      If( Abs(alp-bet)>d || Abs(alp-gam)>d || Abs(bet-gam)>d) Throw( warn_ang)
    }
    Else If(setting == 'cubic') {
      If( Abs(a-b)>d || Abs(a-c)>d || Abs(b-c)>d )          Throw( warn_len)
      If( Abs(alp-90)>d || Abs(bet-90)>d || Abs(gam-90)>d ) Throw( warn_ang)
    }
;
 
     save_
 
 
save_symmetry.Int_Tables_number
    _definition.id             '_symmetry.Int_Tables_number'
     loop_
    _alias.definition_id       '_symmetry.Int_Tables_number'
                               '_symmetry_Int_Tables_number'
    _definition.update           2012-11-22
    _description.text
;
     Space-group number from International Tables for Cryst., Vol. A.
;
    _name.category_id            symmetry
    _name.object_id              Int_Tables_number
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:230
     save_
 
 
save_symmetry.multiplicity
    _definition.id             '_symmetry.multiplicity'
     loop_
    _alias.definition_id       '_symmetry.multiplicity'
    _definition.update           2012-11-22
    _description.text
;
     Number of unique symmetry elements in the space group.
;
    _name.category_id            symmetry
    _name.object_id              multiplicity
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Count
    _enumeration.range           1:192
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     n =  0
 
     Loop  s  as  symmetry_equiv  n +=  1
 
      _symmetry.multiplicity  =   n
;
     save_
 
 
save_symmetry.space_group_name_Hall
    _definition.id             '_symmetry.space_group_name_Hall'
     loop_
    _alias.definition_id       '_symmetry.space_group_name_Hall'
                               '_symmetry_space_group_name_Hall'
    _definition.update           2012-11-22
    _description.text
;
     Space-group symbol as described by Hall. This symbol gives the
     space-group setting explicitly. Leave spaces between the separate
     components of the symbol.
     Ref: Hall, S. R. (1981). Acta Cryst. A37, 517-525.
;
    _name.category_id            symmetry
    _name.object_id              space_group_name_Hall
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'P 2ac  2n' '-R 3 2"'  'P 61 2 2 (0 0 -1)'
     save_
 
 
save_symmetry.space_group_name_H_M
    _definition.id             '_symmetry.space_group_name_H_M'
     loop_
    _alias.definition_id       '_symmetry.space_group_name_H_M'
                               '_symmetry_space_group_name_H-M'
                               '_symmetry.space_group_name_H-M'
    _definition.update           2013-04-07
    _description.text
;
     Hermann-Mauguin space-group symbol. Note that the H-M symbol does
     not necessarily contain complete information about the symmetry
     and the space-group origin. If used always supply the FULL symbol
     from International Tables for Crystallography, Vol. A (1987) and
     indicate the origin and the setting if it is not implicit. If
     there is any doubt that the equivalent positions can be uniquely
     deduced from this symbol specify the _symmetry_equiv.pos_as_xyz
     or *_Hall data items as well. Leave spaces between symbols
     referring to different axes.
;
    _name.category_id            symmetry
    _name.object_id              space_group_name_H_M
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'P 1 21/m 1'
                                'P 2/n 2/n 2/n (origin at -1)'
                                'R -3 2/m'
     save_
 
#-----------------------------------------------------------------------------
 
save_SYMMETRY_EQUIV
 
    _definition.id               SYMMETRY_EQUIV
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe symmetry equivalent sites
     in the crystal unit cell.
;
    _name.category_id            SYMMETRY
    _name.object_id              SYMMETRY_EQUIV
    _category.key_id           '_symmetry_equiv.key'
    _category.key_list        ['_symmetry_equiv.pos_site_id']
 
 
save_symmetry_equiv.key
    _definition.id             '_symmetry_equiv.key'
     loop_
    _alias.definition_id       '_symmetry_equiv.key'
    _definition.update           2012-11-22
    _description.text
;
     Value is a unique key to a set of SYMMETRY_EQUIV items
     in a looped list.
;
    _name.category_id            symmetry_equiv
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;         _type.contents = Type_Contents(symmetry_equiv.pos_site_id)
;
     Evaluation
;         _symmetry_equiv.key = _symmetry_equiv.pos_site_id
;
     save_
 
save_symmetry_equiv.pos_as_xyz
    _definition.id             '_symmetry_equiv.pos_as_xyz'
     loop_
    _alias.definition_id       '_symmetry_equiv.pos_as_xyz'
                               '_symmetry_equiv_pos_as_xyz'
    _definition.update           2012-11-22
    _description.text
;
     Symmetry equivalent position in the 'xyz' representation. Except
     for the space group P1, this data will be repeated in a loop.
     The format of the data item is as per International Tables for
     Crystallography, Vol. A. (1987). All equivalent positions should
     be entered, including those for lattice centring and a centre of
     symmetry, if present.
;
    _name.category_id            symmetry_equiv
    _name.object_id              pos_as_xyz
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   "-y+x,-y,1/3+z"
     save_
 
 
save_symmetry_equiv.pos_site_id
    _definition.id             '_symmetry_equiv.pos_site_id'
     loop_
    _alias.definition_id       '_symmetry_equiv.pos_site_id'
                               '_symmetry_equiv_pos_site_id'
                               '_symmetry_equiv.id'
    _definition.update           2012-12-30
    _description.text
;
     Index identifying each entry in the _symmetry_equiv.pos_as_xyz
     list. It is normally the sequence number of the entry in that
     list, and should be identified with the code 'n' in the geometry
     symmetry codes of the form 'n_klm'.
;
    _name.category_id            symmetry_equiv
    _name.object_id              pos_site_id
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:
     loop_
   _method.purpose
   _method.expression
    Evaluation
;
     _symmetry_equiv.pos_site_id = Current_Row(_symmetry_equiv) + 1
;
     save_
 
 
save_symmetry_equiv.R
    _definition.id             '_symmetry_equiv.R'
     loop_
    _alias.definition_id       '_symmetry_equiv.R'
    _definition.update           2012-11-22
    _description.text
;
     A matrix containing the symmetry rotation operations of a space group
 
                    |  r11  r12  r13  |
              R  =  |  r21  r22  r23  |
                    |  r31  r32  r33  |
;
    _name.category_id            symmetry_equiv
    _name.object_id              R
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
                       sm =  _symmetry_equiv.Seitz_matrix
 
        _symmetry_equiv.R =  [[sm[0,0],sm[0,1],sm[0,2]],
                              [sm[1,0],sm[1,1],sm[1,2]],
                              [sm[2,0],sm[2,1],sm[2,2]]]
;
     save_
 
 
save_symmetry_equiv.RT
    _definition.id             '_symmetry_equiv.RT'
     loop_
    _alias.definition_id       '_symmetry_equiv.RT'
    _definition.update           2012-11-22
    _description.text
;
     The TRANSPOSE of the symmetry rotation matrix representing the point
     group opertions of the space group
 
                     |  r11  r21  r31  |
              RT  =  |  r12  r22  r32  |
                     |  r13  r23  r33  |
;
    _name.category_id            symmetry_equiv
    _name.object_id              RT
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
        _symmetry_equiv.RT =  Transpose (_symmetry_equiv.R)
;
     save_
 
 
save_symmetry_equiv.Seitz_matrix
    _definition.id             '_symmetry_equiv.Seitz_matrix'
     loop_
    _alias.definition_id       '_symmetry_equiv.Seitz_matrix'
    _definition.update           2012-11-22
    _description.text
;
     A matrix containing the symmetry operations of a space group
     in 4x4 Seitz format.
 
                    |  r11  r12  r13  t1  |
       | R  T |     |  r21  r22  r23  t2  |
       | 0  1 |     |  r31  r32  r33  t3  |
                    |   0    0    0    1  |
;
    _name.category_id            symmetry_equiv
    _name.object_id              Seitz_matrix
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [4,4]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
   _symmetry_equiv.Seitz_matrix =  SeitzFromJones (_symmetry_equiv.pos_as_xyz)
;
     save_
 
 
save_symmetry_equiv.T
    _definition.id             '_symmetry_equiv.T'
     loop_
    _alias.definition_id       '_symmetry_equiv.T'
    _definition.update           2012-11-22
    _description.text
;
     A vector containing the symmetry translation operations of a space group.
;
    _name.category_id            symmetry_equiv
    _name.object_id              T
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
                       sm =  _symmetry_equiv.Seitz_matrix
 
        _symmetry_equiv.T =   [sm[0,3],sm[1,3],sm[2,3]]
;
     save_
 
     save_   #------- close the SYMMETRY_EQUIV category
 
     save_   #------- close the SYMMETRY category
 
     save_   #------- close the EXPTL category
 
     save_   #------- close the EXPERIMENTS category
 
     save_   #------- close the EXPERIMENTAL category
 
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
save_STRUCTURE
    _definition.id               STRUCTURE
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
    The DICTIONARY group encompassing the CORE STRUCTURE data items defined
    and used with in the Crystallographic Information Framework (CIF).
;
    _name.category_id            CIF_CORE
    _name.object_id              STRUCTURE
 
#===========================================================================
 
save_ATOM
 
    _definition.id               ATOM
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
     The CATEGORY of data items used to describe atomic information
     used in crystallographic structure studies.
;
    _name.category_id            STRUCTURE
    _name.object_id              ATOM
 
 
#===========================================================================
 
save_ATOM_SITE
 
    _definition.id               ATOM_SITE
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe atom site information
     used in crystallographic structure studies.
;
    _name.category_id            ATOM
    _name.object_id              ATOM_SITE
    _category.key_id           '_atom_site.key'
    _category.key_list        ['_atom_site.label']
 
 
save_atom_site.key
    _definition.id             '_atom_site.key'
     loop_
    _alias.definition_id       '_atom_site.key'
    _definition.update           2012-11-20
    _description.text
;
     Value is a unique key to a set of ATOM_SITE items
     in a looped list.
;
    _name.category_id            atom_site
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;              _type.contents = Type_Contents(atom_site.label)
;
     Evaluation
;              _atom_site.key = _atom_site.label
;
     save_
 
 
save_atom_site.adp_type
    _definition.id             '_atom_site.adp_type'
     loop_
    _alias.definition_id       '_atom_site.adp_type'
                               '_atom_site_adp_type'
                               '_atom_site_thermal_displace_type'
                               '_atom_site.thermal_displace_type'
    _definition.update           2012-11-20
    _description.text
;
     Code for type of atomic displacement parameters used for the site.
;
    _name.category_id            atom_site
    _name.object_id              adp_type
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail      Uani   'anisotropic Uij'
                                 Uiso   'isotropic U'
                                 Uovl   'overall U'
                                 Umpe   'multipole expansion U'
                                 Bani   'anisotropic Bij'
                                 Biso   'isotropic B'
                                 Bovl   'overall B'
    _enumeration.default         Uiso
     save_
 
 
save_atom_site.tensor_beta
    _definition.id             '_atom_site.tensor_beta'
     loop_
    _alias.definition_id       '_atom_site.tensor_beta'
    _definition.update           2013-04-28
    _description.text
;
     The symmetric anisotropic atomic displacement tensor beta[I,J]
     appears in a structure factor expression as:
 
     t = exp -[ beta11 h h + ............ 2 beta23 k l ]
 
     It is related to the adp matrices U(IJ) and B(IJ) as follows:
 
     t = exp -2pi**2 ( U11    h h a* a* + ...... 2 U23    k l b* c* )
     t = exp - 0.25  ( B11    h h a* a* + ...... 2 B23    k l b* c* )
;
    _name.category_id            atom_site
    _name.object_id              tensor_beta
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With  a  as  atom_site
 
     label = a.label
 
     If      (a.adp_type == 'uani')  {
         Loop b as atom_site_aniso     {
           If(label == b.label)           {
 
               UIJ = b.matrix_U
               Break
     } } }
 
     Else If (a.adp_type == 'bani')  {
         Loop b as atom_site_aniso     {
           If(label == b.label)           {
 
              UIJ = b.matrix_B / (8 * Pi**2)
              Break
     } } }
 
     Else                                    {
         If (a.adp_type == 'uiso')  U  =  a.U_iso_or_equiv
         Else                       U  =  a.B_iso_or_equiv / (8 * Pi**2)
 
             UIJ = U * _cell_reciprocal.convert_Uiso_to_Uij
     }
 
              CUB = _cell_reciprocal.convert_Uij_to_betaij
 
        _atom_site.tensor_beta =  CUB * UIJ * CUB
;
     save_
 
 
save_atom_site.attached_hydrogens
    _definition.id             '_atom_site.attached_hydrogens'
     loop_
    _alias.definition_id       '_atom_site.attached_hydrogens'
                               '_atom_site_attached_hydrogens'
    _definition.update           2012-11-20
    _description.text
;
     Number of hydrogen atoms attached to the atom at this site
     excluding any H atoms for which coordinates (measured or calculated)
     are given.
;
    _name.category_id            atom_site
    _name.object_id              attached_hydrogens
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           0:8
    _enumeration.default         0
     loop_
    _description_example.case
    _description_example.detail  2    'water oxygen'
                                 1    'hydroxyl oxygen'
                                 4    'ammonium nitrogen'
     save_
 
 
save_atom_site.B_equiv_geom_mean
    _definition.id             '_atom_site.B_equiv_geom_mean'
     loop_
    _alias.definition_id       '_atom_site.B_equiv_geom_mean'
                               '_atom_site_B_equiv_geom_mean'
    _definition.update           2012-11-20
    _description.text
;
     Equivalent isotropic atomic displacement parameter, B(equiv),
     in angstroms squared, calculated as the geometric mean of
     the anisotropic atomic displacement parameters.
 
                 B(equiv) = (B~i~ B~j~ B~k~)^1/3^
 
     B~n~  = the principal components of the orthogonalised B^ij^
 
     The IUCr Commission on Nomenclature recommends against the use
     of B for reporting atomic displacement parameters. U, being
     directly proportional to B, is preferred.
;
    _name.category_id            atom_site
    _name.object_id              B_equiv_geom_mean
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.B_equiv_geom_mean_su
    _definition.id             '_atom_site.B_equiv_geom_mean_su'
     loop_
    _alias.definition_id       '_atom_site.B_equiv_geom_mean_su'
                               '_atom_site_B_equiv_geom_mean_su'
                               '_atom_site.B_equiv_geom_mean_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty value for the
     Equivalent isotropic atomic displacement parameter, B(equiv),
     in angstroms squared, calculated as the geometric mean of
     the anisotropic atomic displacement parameters.
;
    _name.category_id            atom_site
    _name.object_id              B_equiv_geom_mean_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.B_iso_or_equiv
    _definition.id             '_atom_site.B_iso_or_equiv'
     loop_
    _alias.definition_id       '_atom_site.B_iso_or_equiv'
                               '_atom_site_B_iso_or_equiv'
    _definition.update           2012-11-20
    _description.text
;
     Isotropic atomic displacement parameter, or equivalent isotropic
     atomic displacement parameter, B(equiv), in angstroms squared,
     calculated from anisotropic temperature factor parameters.
 
         B(equiv) = (1/3) sum~i~[sum~j~(B^ij^ a*~i~ a*~j~ a~i~ a~j~)]
 
     a     = the real-space cell lengths
     a*    = the reciprocal-space cell lengths
     B^ij^ = 8 pi^2^ U^ij^
     Ref: Fischer, R. X. & Tillmanns, E. (1988). Acta Cryst. C44, 775-776.
 
     The IUCr Commission on Nomenclature recommends against the use
     of B for reporting atomic displacement parameters. U, being
     directly proportional to B, is preferred.
;
    _name.category_id            atom_site
    _name.object_id              B_iso_or_equiv
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.B_iso_or_equiv_su
    _definition.id             '_atom_site.B_iso_or_equiv_su'
     loop_
    _alias.definition_id       '_atom_site.B_iso_or_equiv_su'
                               '_atom_site_B_iso_or_equiv_su'
                               '_atom_site.B_iso_or_equiv_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty value for the
     Isotropic atomic displacement parameter, or equivalent isotropic
     atomic displacement parameter, B(equiv), in angstroms squared,
     calculated from anisotropic temperature factor parameters.
;
    _name.category_id            atom_site
    _name.object_id              B_iso_or_equiv_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.calc_attached_atom
    _definition.id             '_atom_site.calc_attached_atom'
     loop_
    _alias.definition_id       '_atom_site.calc_attached_atom'
                               '_atom_site_calc_attached_atom'
    _definition.update           2012-11-20
    _description.text
;
     The _atom_site.label of the atom site to which the 'geometry-
     calculated' atom site is attached.
;
    _name.category_id            atom_site
    _name.object_id              calc_attached_atom
    _name.linked_item_id       '_atom_site.label'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_atom_site.calc_flag
    _definition.id             '_atom_site.calc_flag'
     loop_
    _alias.definition_id       '_atom_site.calc_flag'
                               '_atom_site_calc_flag'
    _definition.update           2012-11-20
    _description.text
;
     A standard code to signal if the site coordinates have been
     determined from the intensities or calculated from the geometry
     of surrounding sites, or have been assigned dummy coordinates.
;
    _name.category_id            atom_site
    _name.object_id              calc_flag
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail   d    'determined from diffraction measurements'
                              calc 'calculated from molecular geometry'
                              c    'abbreviation for "calc"'
                              dum  'dummy site with meaningless coordinates'
    _enumeration.default      d
     save_
 
 
save_atom_site.Cartn_xyz
    _definition.id             '_atom_site.Cartn_xyz'
     loop_
    _alias.definition_id       '_atom_site.Cartn_xyz'
    _definition.update           2012-11-20
    _description.text
;
     Vector of Cartesian (orthogonal angstrom) atom site coordinates.
;
    _name.category_id            atom_site
    _name.object_id              Cartn_xyz
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With a  as  atom_site
 
    _atom_site.Cartn_xyz =   [a.Cartn_x, a.Cartn_y, a.Cartn_z]
;
     save_
 
 
save_atom_site.Cartn_x
    _definition.id             '_atom_site.Cartn_x'
     loop_
    _alias.definition_id       '_atom_site.Cartn_x'
                               '_atom_site_Cartn_x'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_coord'}]
    _name.category_id            atom_site
    _name.object_id              Cartn_x
     save_
 
 
save_atom_site.Cartn_y
    _definition.id             '_atom_site.Cartn_y'
     loop_
    _alias.definition_id       '_atom_site.Cartn_y'
                               '_atom_site_Cartn_y'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_coord'}]
    _name.category_id            atom_site
    _name.object_id              Cartn_y
     save_
 
 
save_atom_site.Cartn_z
    _definition.id             '_atom_site.Cartn_z'
     loop_
    _alias.definition_id       '_atom_site.Cartn_z'
                               '_atom_site_Cartn_z'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_coord'}]
    _name.category_id            atom_site
    _name.object_id              Cartn_z
     save_
 
 
save_atom_site.Cartn_x_su
    _definition.id             '_atom_site.Cartn_x_su'
     loop_
    _alias.definition_id       '_atom_site.Cartn_x_su'
                               '_atom_site_Cartn_x_su'
                               '_atom_site.Cartn_x_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_coord_su'}]
    _name.category_id            atom_site
    _name.object_id              Cartn_x_su
     save_
 
 
save_atom_site.Cartn_y_su
    _definition.id             '_atom_site.Cartn_y_su'
     loop_
    _alias.definition_id       '_atom_site.Cartn_y_su'
                               '_atom_site_Cartn_y_su'
                               '_atom_site.Cartn_y_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_coord_su'}]
    _name.category_id            atom_site
    _name.object_id              Cartn_y_su
     save_
 
 
save_atom_site.Cartn_z_su
    _definition.id             '_atom_site.Cartn_z_su'
     loop_
    _alias.definition_id       '_atom_site.Cartn_z_su'
                               '_atom_site_Cartn_z_su'
                               '_atom_site.Cartn_z_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_coord_su'}]
    _name.category_id            atom_site
    _name.object_id              Cartn_z_su
     save_
 
 
 
save_atom_site.chemical_conn_number
    _definition.id             '_atom_site.chemical_conn_number'
     loop_
    _alias.definition_id       '_atom_site.chemical_conn_number'
                               '_atom_site_chemical_conn_number'
    _definition.update           2012-11-20
    _description.text
;
     This number links an atom site to the chemical connectivity list.
     It must match a number specified by _chemical_conn_atom.number.
;
    _name.category_id            atom_site
    _name.object_id              chemical_conn_number
    _name.linked_item_id       '_chemical_conn_atom.number'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:
     save_
 
 
save_atom_site.constraints
    _definition.id             '_atom_site.constraints'
     loop_
    _alias.definition_id       '_atom_site.constraints'
                               '_atom_site_constraints'
    _definition.update           2012-11-20
    _description.text
;
     A description of the constraints applied to parameters at this
     site during refinement. See also _atom_site.refinement_flags
     and _refine_ls.number_constraints.
;
    _name.category_id            atom_site
    _name.object_id              constraints
    _type.purpose                Encode
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case    'pop=1.0-pop(Zn3)'
     save_
 
 
save_atom_site.description
    _definition.id             '_atom_site.description'
     loop_
    _alias.definition_id       '_atom_site.description'
                               '_atom_site_description'
                               '_atom_site.details'
    _definition.update           2012-11-20
    _description.text
;
     A description of special aspects of this site. See also
     _atom_site.refinement_flags.
;
    _name.category_id            atom_site
    _name.object_id              description
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'Ag/Si disordered'
     save_
 
 
save_atom_site.disorder_assembly
    _definition.id             '_atom_site.disorder_assembly'
     loop_
    _alias.definition_id       '_atom_site.disorder_assembly'
                               '_atom_site_disorder_assembly'
    _definition.update           2012-11-20
    _description.text
;
     A code which identifies a cluster of atoms that show long range
     positional disorder but are locally ordered. Within each such
     cluster of atoms, _atom_site.disorder_group is used to identify
     the sites that are simultaneously occupied. This field is only
     needed if there is more than one cluster of disordered atoms
     showing independent local order.
;
    _name.category_id            atom_site
    _name.object_id              disorder_assembly
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _description_example.case
    _description_example.detail
               A  'disordered methyl assembly with groups 1 and 2'
               B  'disordered sites related by a mirror'
               S  'disordered sites independent of symmetry'
     save_
 
 
save_atom_site.disorder_group
    _definition.id             '_atom_site.disorder_group'
     loop_
    _alias.definition_id       '_atom_site.disorder_group'
                               '_atom_site_disorder_group'
    _definition.update           2012-11-20
    _description.text
;
     A code that identifies a group of positionally disordered atom
     sites that are locally simultaneously occupied. Atoms that are
     positionally disordered over two or more sites (e.g. the H
     atoms of a methyl group that exists in two orientations) can
     be assigned to two or more groups. Sites belonging to the same
     group are simultaneously occupied, but those belonging to
     different groups are not. A minus prefix (e.g. "-1") is used to
     indicate sites disordered about a special position.
;
    _name.category_id            atom_site
    _name.object_id              disorder_group
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _description_example.case
    _description_example.detail
              '1' 'unique disordered site in group 1'
              '2' 'unique disordered site in group 2'
             '-1' 'symmetry-independent disordered site'
     save_
 
 
save_atom_site.fract_xyz
    _definition.id             '_atom_site.fract_xyz'
     loop_
    _alias.definition_id       '_atom_site.fract_xyz'
    _definition.update           2012-11-20
    _description.text
;
     Vector of atom site coordinates projected onto the crystal unit
     cell as fractions of the cell lengths.
;
    _name.category_id            atom_site
    _name.object_id              fract_xyz
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a  as  atom_site
 
     atom_site.fract_xyz =  [a.fract_x, a.fract_y, a.fract_z]
;
     save_
 
 
save_atom_site.fract_x
    _definition.id             '_atom_site.fract_x'
     loop_
    _alias.definition_id       '_atom_site.fract_x'
                               '_atom_site_fract_x'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_coord'}]
    _name.category_id            atom_site
    _name.object_id              fract_x
     save_
 
 
save_atom_site.fract_y
    _definition.id             '_atom_site.fract_y'
     loop_
    _alias.definition_id       '_atom_site.fract_y'
                               '_atom_site_fract_y'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_coord'}]
    _name.category_id            atom_site
    _name.object_id              fract_y
     save_
 
 
save_atom_site.fract_z
    _definition.id             '_atom_site.fract_z'
     loop_
    _alias.definition_id       '_atom_site.fract_z'
                               '_atom_site_fract_z'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_coord'}]
    _name.category_id            atom_site
    _name.object_id              fract_z
     save_
 
 
save_atom_site.fract_x_su
    _definition.id             '_atom_site.fract_x_su'
     loop_
    _alias.definition_id       '_atom_site.fract_x_su'
                               '_atom_site_fract_x_su'
                               '_atom_site.fract_x_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_coord_su'}]
    _name.category_id            atom_site
    _name.object_id              fract_x_su
     save_
 
 
save_atom_site.fract_y_su
    _definition.id             '_atom_site.fract_y_su'
     loop_
    _alias.definition_id       '_atom_site.fract_y_su'
                               '_atom_site_fract_y_su'
                               '_atom_site.fract_y_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_coord_su'}]
    _name.category_id            atom_site
    _name.object_id              fract_y_su
     save_
 
 
save_atom_site.fract_z_su
    _definition.id             '_atom_site.fract_z_su'
     loop_
    _alias.definition_id       '_atom_site.fract_z_su'
                               '_atom_site_fract_z_su'
                               '_atom_site.fract_z_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_coord_su'}]
    _name.category_id            atom_site
    _name.object_id              fract_z_su
     save_
 
 
save_atom_site.label
    _definition.id             '_atom_site.label'
     loop_
    _alias.definition_id       '_atom_site.label'
                               '_atom_site_label'
                               '_atom_site.id'
    _import.get         [{"file":'templ_attr.cif',"save":'atom_site_label'}]
    _name.category_id            atom_site
    _name.object_id              label
     save_
 
 
save_atom_site.label_component_0
    _definition.id             '_atom_site.label_component_0'
     loop_
    _alias.definition_id       '_atom_site.label_component_0'
                               '_atom_site_label_component_0'
    _import.get         [{"file":'templ_attr.cif',"save":'label_component'}]
    _name.category_id            atom_site
    _name.object_id              label_component_0
     save_
 
 
save_atom_site.label_component_1
    _definition.id             '_atom_site.label_component_1'
     loop_
    _alias.definition_id       '_atom_site.label_component_1'
                               '_atom_site_label_component_1'
    _import.get         [{"file":'templ_attr.cif',"save":'label_comp'}]
    _name.category_id            atom_site
    _name.object_id              label_component_1
     save_
 
 
save_atom_site.label_component_2
    _definition.id             '_atom_site.label_component_2'
     loop_
    _alias.definition_id       '_atom_site.label_component_2'
                               '_atom_site_label_component_2'
    _import.get         [{"file":'templ_attr.cif',"save":'label_comp'}]
    _name.category_id            atom_site
    _name.object_id              label_component_2
     save_
 
 
save_atom_site.label_component_3
    _definition.id             '_atom_site.label_component_3'
     loop_
    _alias.definition_id       '_atom_site.label_component_3'
                               '_atom_site_label_component_3'
    _import.get         [{"file":'templ_attr.cif',"save":'label_comp'}]
    _name.category_id            atom_site
    _name.object_id              label_component_3
     save_
 
 
save_atom_site.label_component_4
    _definition.id             '_atom_site.label_component_4'
     loop_
    _alias.definition_id       '_atom_site.label_component_4'
                               '_atom_site_label_component_4'
    _import.get         [{"file":'templ_attr.cif',"save":'label_comp'}]
    _name.category_id            atom_site
    _name.object_id              label_component_4
     save_
 
 
save_atom_site.label_component_5
    _definition.id             '_atom_site.label_component_5'
     loop_
    _alias.definition_id       '_atom_site.label_component_5'
                               '_atom_site_label_component_5'
    _import.get         [{"file":'templ_attr.cif',"save":'label_comp'}]
    _name.category_id            atom_site
    _name.object_id              label_component_5
     save_
 
 
save_atom_site.label_component_6
    _definition.id             '_atom_site.label_component_6'
     loop_
    _alias.definition_id       '_atom_site.label_component_6'
                               '_atom_site_label_component_6'
    _import.get         [{"file":'templ_attr.cif',"save":'label_comp'}]
    _name.category_id            atom_site
    _name.object_id              label_component_6
     save_
 
 
save_atom_site.occupancy
    _definition.id             '_atom_site.occupancy'
     loop_
    _alias.definition_id       '_atom_site.occupancy'
                               '_atom_site_occupancy'
    _definition.update           2012-11-20
    _description.text
;
     The fraction of the atom type present at this site.
     The sum of the occupancies of all the atom types at this site
     may not significantly exceed 1.0 unless it is a dummy site. The
     value must lie in the 99.97% Gaussian confidence interval
     -3u =< x =< 1 + 3u. The _enumeration.range of 0.0:1.0 is thus
     correctly interpreted as meaning (0.0 - 3u) =< x =< (1.0 + 3u).
;
    _name.category_id            atom_site
    _name.object_id              occupancy
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _enumeration.default         1.0
    _units.code                  none
     save_
 
 
save_atom_site.occupancy_su
    _definition.id             '_atom_site.occupancy_su'
     loop_
    _alias.definition_id       '_atom_site.occupancy_su'
                               '_atom_site_occupancy_su'
                               '_atom_site.occupancy_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty value for the
     The fraction of the atom type present at this site.
;
    _name.category_id            atom_site
    _name.object_id              occupancy_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _enumeration.default         0.0
    _units.code                  none
     save_
 
 
save_atom_site.refinement_flags
    _definition.id             '_atom_site.refinement_flags'
     loop_
    _alias.definition_id       '_atom_site.refinement_flags'
                               '_atom_site_refinement_flags'
    _definition.update           2013-03-08
    _description.text
;
     A concatenated series of single-letter codes which indicate the
     refinement restraints or constraints applied to this site.
;
    _name.category_id            atom_site
    _name.object_id              refinement_flags
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
                  'S'  'special position constraint on site'
                  'G'  'rigid group refinement of site'
                  'R'  'riding-atom site attached to non-riding atom'
                  'D'  'distance or angle restraint on site'
                  'T'  'thermal displacement constraints'
                  'U'  'Uiso or Uij restraint (rigid bond)'
                  'P'  'partial occupancy constraint'
                  '.'  'no refinement constraints'
    _enumeration.default '.'
     save_
 
 
save_atom_site.refinement_flags_adp
    _definition.id             '_atom_site.refinement_flags_adp'
     loop_
    _alias.definition_id       '_atom_site.refinement_flags_adp'
                               '_atom_site_refinement_flags_adp'
    _definition.update           2012-11-20
    _description.text
;
     A code which indicates the refinement restraints or constraints
     applied to the atomic displacement parameters of this site.
;
    _name.category_id            atom_site
    _name.object_id              refinement_flags_adp
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
    '.'  'no constraints on atomic displacement parameters'
    'T'  'special-position constraints on atomic displacement parameters'
    'U'  'Uiso or Uij restraint (rigid bond)'
    'TU' 'both constraints applied'
    _enumeration.default '.'
     save_
 
 
save_atom_site.refinement_flags_occupancy
    _definition.id             '_atom_site.refinement_flags_occupancy'
     loop_
    _alias.definition_id       '_atom_site.refinement_flags_occupancy'
                               '_atom_site_refinement_flags_occupancy'
    _definition.update           2012-11-20
    _description.text
;
     A code which indicates the refinement restraints or constraints
     applied to the occupancy of this site.
;
    _name.category_id            atom_site
    _name.object_id              refinement_flags_occupancy
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
    '.'  'no constraints on atomic displacement parameters'
    'T'  'special-position constraints on atomic displacement parameters'
    'U'  'Uiso or Uij restraint (rigid bond)'
    'TU' 'both constraints applied'
    _enumeration.default '.'
     save_
 
 
save_atom_site.refinement_flags_posn
    _definition.id             '_atom_site.refinement_flags_posn'
     loop_
    _alias.definition_id       '_atom_site.refinement_flags_posn'
                               '_atom_site_refinement_flags_posn'
    _definition.update           2012-11-20
    _description.text
;
     A code which indicates the refinement restraints or constraints
     applied to the positional coordinates of this site.
;
    _name.category_id            atom_site
    _name.object_id              refinement_flags_posn
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
       '.' 'no constraints on positional coordinates'
       'D' 'distance or angle restraint on positional coordinates'
       'G' 'rigid-group refinement of positional coordinates'
       'R' 'riding-atom site attached to non-riding atom'
       'S' 'special-position constraint on positional coordinates'
       'DG'   'combination of the above constraints'
       'DR'   'combination of the above constraints'
       'DS'   'combination of the above constraints'
       'GR'   'combination of the above constraints'
       'GS'   'combination of the above constraints'
       'RS'   'combination of the above constraints'
       'DGR'  'combination of the above constraints'
       'DGS'  'combination of the above constraints'
       'DRS'  'combination of the above constraints'
       'GRS'  'combination of the above constraints'
       'DGRS' 'combination of the above constraints'
    _enumeration.default '.'
     save_
 
 
save_atom_site.restraints
    _definition.id             '_atom_site.restraints'
     loop_
    _alias.definition_id       '_atom_site.restraints'
                               '_atom_site_restraints'
    _definition.update           2012-11-20
    _description.text
;
     A description of restraints applied to specific parameters at
     this site during refinement. See also _atom_site.refinement_flags
     and _refine_ls.number_restraints.
;
    _name.category_id            atom_site
    _name.object_id              restraints
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'restrained to planar ring'
     save_
 
 
save_atom_site.site_symmetry_multiplicity
    _definition.id             '_atom_site.site_symmetry_multiplicity'
     loop_
    _alias.definition_id       '_atom_site.site_symmetry_multiplicity'
                               '_atom_site_site_symmetry_multiplicity'
                               '_atom_site_symmetry_multiplicity'
                               '_atom_site.symmetry_multiplicity'
    _definition.update           2013-04-28
    _description.text
;
     The number of different sites that are generated by the
     application of the space-group symmetry to the coordinates
     given for this site. It is equal to the multiplicity given
     for this Wyckoff site in International Tables for Cryst.
     Vol. A (2002). It is equal to the multiplicity of the general
     position divided by the order of the site symmetry given in
     _atom_site.site_symmetry_order.
;
    _name.category_id            atom_site
    _name.object_id              site_symmetry_multiplicity
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:192
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With  a  as  atom_site
 
        mul  =   0
        xyz  =   a.fract_xyz
 
          Loop  s  as  symmetry_equiv  {
 
             sxyz  =   s.R * xyz + s.T
             diff  =   Mod( 99.5 + xyz - sxyz, 1.0) - 0.5
 
             If ( Norm ( diff ) < 0.1 ) mul +=  1
       }
    _atom_site.site_symmetry_multiplicity =  _symmetry.multiplicity / mul
;
     save_
 
 
save_atom_site.site_symmetry_order
    _definition.id             '_atom_site.site_symmetry_order'
     loop_
    _alias.definition_id       '_atom_site.site_symmetry_order'
                               '_atom_site_site_symmetry_order'
    _definition.update           2012-11-20
    _description.text
;
    The number of times application of the crystallographic symmetry
    to the coordinates for this site generates the same coordinates.
    That is:
            multiplicity of the general position
            ------------------------------------
            _atom_site.site_symmetry_multiplicity
;
    _name.category_id            atom_site
    _name.object_id              site_symmetry_order
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:48
     save_
 
 
save_atom_site.type_symbol
    _definition.id             '_atom_site.type_symbol'
     loop_
    _alias.definition_id       '_atom_site.type_symbol'
                               '_atom_site_type_symbol'
    _definition.update           2012-11-20
    _description.text
;
     A code to identify the atom specie(s) occupying this site.
     This code must match a corresponding _atom_type.symbol. The
     specification of this code is optional if component_0 of the
     _atom_site.label is used for this purpose. See _atom_type.symbol.
;
    _name.category_id            atom_site
    _name.object_id              type_symbol
    _name.linked_item_id       '_atom_type.symbol'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Code
     loop_
    _description_example.case    Cu   Cu2+    S    O1-
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
          _atom_site.type_symbol  =   AtomType ( _atom_site.label )
;
     save_
 
 
save_atom_site.U_equiv_geom_mean
    _definition.id             '_atom_site.U_equiv_geom_mean'
     loop_
    _alias.definition_id       '_atom_site.U_equiv_geom_mean'
                               '_atom_site_U_equiv_geom_mean'
    _definition.update           2012-11-20
    _description.text
;
     Equivalent isotropic atomic displacement parameter, U(equiv),
     in angstroms squared, calculated as the geometric mean of
     the anisotropic atomic displacement parameters.
 
                U(equiv) = (U~i~ U~j~ U~k~)^1/3^
 
     U~n~ = the principal components of the orthogonalised U^ij^
;
    _name.category_id            atom_site
    _name.object_id              U_equiv_geom_mean
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.U_equiv_geom_mean_su
    _definition.id             '_atom_site.U_equiv_geom_mean_su'
     loop_
    _alias.definition_id       '_atom_site.U_equiv_geom_mean_su'
                               '_atom_site_U_equiv_geom_mean_su'
                               '_atom_site.U_equiv_geom_mean_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard uncertainty values (esds) of the U(equiv).
;
    _name.category_id            atom_site
    _name.object_id              U_equiv_geom_mean_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.U_iso_or_equiv
    _definition.id             '_atom_site.U_iso_or_equiv'
     loop_
    _alias.definition_id       '_atom_site.U_iso_or_equiv'
                               '_atom_site_U_iso_or_equiv'
    _definition.update           2012-11-20
    _description.text
;
     Isotropic atomic displacement parameter, or equivalent isotropic
     atomic  displacement parameter, U(equiv), in angstroms squared,
     calculated from anisotropic atomic displacement  parameters.
 
        U(equiv) = (1/3) sum~i~[sum~j~(U^ij^ a*~i~ a*~j~ a~i~ a~j~)]
 
     a  = the real-space cell lengths
     a* = the reciprocal-space cell lengths
     Ref: Fischer, R. X. & Tillmanns, E. (1988). Acta Cryst. C44, 775-776.
;
    _name.category_id            atom_site
    _name.object_id              U_iso_or_equiv
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.U_iso_or_equiv_su
    _definition.id             '_atom_site.U_iso_or_equiv_su'
     loop_
    _alias.definition_id       '_atom_site.U_iso_or_equiv_su'
                               '_atom_site_U_iso_or_equiv_su'
                               '_atom_site.U_iso_or_equiv_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard uncertainty values (esds) of the U(iso) or U(equiv).
;
    _name.category_id            atom_site
    _name.object_id              U_iso_or_equiv
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstrom_squared
     save_
 
 
save_atom_site.Wyckoff_symbol
    _definition.id             '_atom_site.Wyckoff_symbol'
     loop_
    _alias.definition_id       '_atom_site.Wyckoff_symbol'
                               '_atom_site_Wyckoff_symbol'
    _definition.update           2012-11-20
    _description.text
;
     The Wyckoff symbol (letter) as listed in the space-group section
     of International Tables for Crystallography, Vol. A (1987).
;
    _name.category_id            atom_site
    _name.object_id              Wyckoff_symbol
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     save_
 
#----------------------------------------------------------------------------
 
 
save_ATOM_SITE_ANISO
 
    _definition.id               ATOM_SITE_ANISO
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe the anisotropic
     thermal parameters of the atomic sites in a crystal structure.
;
    _name.category_id            ATOM_SITE
    _name.object_id              ATOM_SITE_ANISO
    _category.key_id           '_atom_site_aniso.key'
    _category.key_list        ['_atom_site_aniso.label']
 
 
save_atom_site_aniso.key
    _definition.id             '_atom_site_aniso.key'
     loop_
    _alias.definition_id       '_atom_site_aniso.key'
    _definition.update           2012-11-20
    _description.text
;
     Value is a unique key to a set of ATOM_SITE_ANISO items
     in a looped list.
;
    _name.category_id            atom_site_aniso
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
    loop_
    _method.purpose
    _method.expression
     Definition
;              _type.contents = Type_Contents(atom_site_aniso.label)
;
     Evaluation
;              _atom_site_aniso.key = _atom_site_aniso.label
;
     save_
 
 
save_atom_site_aniso.label
    _definition.id             '_atom_site_aniso.label'
     loop_
    _alias.definition_id       '_atom_site_aniso.label'
                               '_atom_site_aniso_label'
                               '_atom_site_anisotrop.id'
    _definition.update           2013-01-23
    _description.text
;
     Anisotropic atomic displacement parameters are usually looped in
     a separate list. If this is the case, this code must match the
     _atom_site_label of the associated atom in the atom coordinate
     list and conform with the same rules described in _atom_site.label.
;
    _name.category_id            atom_site_aniso
    _name.object_id              label
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_atom_site_aniso.ratio
    _definition.id             '_atom_site_aniso.ratio'
     loop_
    _alias.definition_id       '_atom_site_aniso.ratio'
                               '_atom_site_aniso_ratio'
                               '_atom_site_anisotrop.ratio'
                               '_atom_site.aniso_ratio'
    _definition.update           2012-11-20
    _description.text
;
     Ratio of the maximum to minimum eigenvalues of the atomic
     displacement (thermal) ellipsoids.
;
    _name.category_id            atom_site_aniso
    _name.object_id              ratio
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           1.0:
    _units.code                  none
     save_
 
 
save_atom_site_aniso.type_symbol
    _definition.id             '_atom_site_aniso.type_symbol'
     loop_
    _alias.definition_id       '_atom_site_aniso.type_symbol'
                               '_atom_site_aniso_type_symbol'
                               '_atom_site_anisotrop.type_symbol'
    _definition.update           2012-11-20
    _description.text
;
     This _atom_type.symbol code links the anisotropic atom parameters to
     the atom type data associated with this site and must match one of
     the _atom_type.symbol codes in this list.
;
    _name.category_id            atom_site_aniso
    _name.object_id              type_symbol
    _name.linked_item_id       '_atom_type.symbol'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Code
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     _atom_site_aniso.type_symbol  =   AtomType ( _atom_site_aniso.label )
;
     save_
 
 
save_atom_site_aniso.matrix_B
    _definition.id             '_atom_site_aniso.matrix_B'
     loop_
    _alias.definition_id       '_atom_site_aniso.matrix_B'
    _definition.update           2012-11-20
    _description.text
;
     The symmetric anisotropic atomic displacement matrix B.
;
    _name.category_id            atom_site_aniso
    _name.object_id              matrix_B
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a as atom_site_aniso
 
      a.matrix_B =  [[ a.B_11, a.B_12, a.B_13 ],
                     [ a.B_12, a.B_22, a.B_23 ],
                     [ a.B_13, a.B_23, a.B_33 ]]
;
     save_
 
 
save_atom_site_aniso.B_11
    _definition.id             '_atom_site_aniso.B_11'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_11'
                               '_atom_site_aniso_B_11'
                               '_atom_site.aniso_B[1][1]'
                               '_atom_site_anisotrop.B[1][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_11
     save_
 
 
save_atom_site_aniso.B_12
    _definition.id             '_atom_site_aniso.B_12'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_12'
                               '_atom_site_aniso_B_12'
                               '_atom_site.aniso_B[1][2]'
                               '_atom_site_anisotrop.B[1][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_12
     save_
 
 
save_atom_site_aniso.B_13
    _definition.id             '_atom_site_aniso.B_13'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_13'
                               '_atom_site_aniso_B_13'
                               '_atom_site.aniso_B[1][3]'
                               '_atom_site_anisotrop.B[1][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_13
     save_
 
 
save_atom_site_aniso.B_22
    _definition.id             '_atom_site_aniso.B_22'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_22'
                               '_atom_site_aniso_B_22'
                               '_atom_site.aniso_B[2][2]'
                               '_atom_site_anisotrop.B[2][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_22
     save_
 
 
save_atom_site_aniso.B_23
    _definition.id             '_atom_site_aniso.B_23'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_23'
                               '_atom_site_aniso_B_23'
                               '_atom_site.aniso_B[2][3]'
                               '_atom_site_anisotrop.B[2][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_23
     save_
 
 
save_atom_site_aniso.B_33
    _definition.id             '_atom_site_aniso.B_33'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_33'
                               '_atom_site_aniso_B_33'
                               '_atom_site.aniso_B[3][3]'
                               '_atom_site_anisotrop.B[3][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_33
     save_
 
 
save_atom_site_aniso.B_11_su
    _definition.id             '_atom_site_aniso.B_11_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_11_su'
                               '_atom_site_aniso_B_11_su'
                               '_atom_site.aniso_B[1][1]_esd'
                               '_atom_site_anisotrop.B[1][1]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_11_su
     save_
 
 
save_atom_site_aniso.B_12_su
    _definition.id             '_atom_site_aniso.B_12_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_12_su'
                               '_atom_site_aniso_B_12_su'
                               '_atom_site.aniso_B[1][2]_esd'
                               '_atom_site_anisotrop.B[1][2]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_12_su
     save_
 
 
save_atom_site_aniso.B_13_su
    _definition.id             '_atom_site_aniso.B_13_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_13_su'
                               '_atom_site_aniso_B_13_su'
                               '_atom_site.aniso_B[1][3]_esd'
                               '_atom_site_anisotrop.B[1][3]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_13_su
     save_
 
 
save_atom_site_aniso.B_22_su
    _definition.id             '_atom_site_aniso.B_22_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_22_su'
                               '_atom_site_aniso_B_22_su'
                               '_atom_site.aniso_B[2][2]_esd'
                               '_atom_site_anisotrop.B[2][2]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_22_su
     save_
 
 
save_atom_site_aniso.B_23_su
    _definition.id             '_atom_site_aniso.B_23_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_23_su'
                               '_atom_site_aniso_B_23_su'
                               '_atom_site.aniso_B[2][3]_esd'
                               '_atom_site_anisotrop.B[2][3]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_23_su
     save_
 
 
save_atom_site_aniso.B_33_su
    _definition.id             '_atom_site_aniso.B_33_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.B_33_su'
                               '_atom_site_aniso_B_33_su'
                               '_atom_site.aniso_B[3][3]_esd'
                               '_atom_site_anisotrop.B[3][3]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_BIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              B_33_su
     save_
 
save_atom_site_aniso.matrix_U
    _definition.id             '_atom_site_aniso.matrix_U'
     loop_
    _alias.definition_id       '_atom_site_aniso.matrix_U'
    _definition.update           2012-11-20
    _description.text
;
     The symmetric anisotropic atomic displacement matrix U.
;
    _name.category_id            atom_site_aniso
    _name.object_id              matrix_U
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a as atom_site_aniso
 
        a.matrix_U =  [[ a.U_11, a.U_12, a.U_13 ],
                       [ a.U_12, a.U_22, a.U_23 ],
                       [ a.U_13, a.U_23, a.U_33 ]]
;
     save_
 
 
save_atom_site_aniso.U_11
    _definition.id             '_atom_site_aniso.U_11'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_11'
                               '_atom_site_aniso_U_11'
                               '_atom_site.aniso_U[1][1]'
                               '_atom_site_anisotrop.U[1][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_11
     save_
 
 
save_atom_site_aniso.U_12
    _definition.id             '_atom_site_aniso.U_12'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_12'
                               '_atom_site_aniso_U_12'
                               '_atom_site.aniso_U[1][2]'
                               '_atom_site_anisotrop.U[1][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_12
     save_
 
 
save_atom_site_aniso.U_13
    _definition.id             '_atom_site_aniso.U_13'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_13'
                               '_atom_site_aniso_U_13'
                               '_atom_site.aniso_U[1][3]'
                               '_atom_site_anisotrop.U[1][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_13
     save_
 
 
save_atom_site_aniso.U_22
    _definition.id             '_atom_site_aniso.U_22'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_22'
                               '_atom_site_aniso_U_22'
                               '_atom_site.aniso_U[2][2]'
                               '_atom_site_anisotrop.U[2][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_22
     save_
 
 
save_atom_site_aniso.U_23
    _definition.id             '_atom_site_aniso.U_23'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_23'
                               '_atom_site_aniso_U_23'
                               '_atom_site.aniso_U[2][3]'
                               '_atom_site_anisotrop.U[2][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_23
     save_
 
 
save_atom_site_aniso.U_33
    _definition.id             '_atom_site_aniso.U_33'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_33'
                               '_atom_site_aniso_U_33'
                               '_atom_site.aniso_U[3][3]'
                               '_atom_site_anisotrop.U[3][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_33
     save_
 
 
save_atom_site_aniso.U_11_su
    _definition.id             '_atom_site_aniso.U_11_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_11_su'
                               '_atom_site_aniso_U_11_su'
                               '_atom_site.aniso_U[1][1]_esd'
                               '_atom_site_anisotrop.U[1][1]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_11_su
     save_
 
 
save_atom_site_aniso.U_12_su
    _definition.id             '_atom_site_aniso.U_12_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_12_su'
                               '_atom_site_aniso_U_12_su'
                               '_atom_site.aniso_U[1][2]_esd'
                               '_atom_site_anisotrop.U[1][2]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_12_su
     save_
 
 
save_atom_site_aniso.U_13_su
    _definition.id             '_atom_site_aniso.U_13_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_13_su'
                               '_atom_site_aniso_U_13_su'
                               '_atom_site.aniso_U[1][3]_esd'
                               '_atom_site_anisotrop.U[1][3]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_13_su
     save_
 
 
save_atom_site_aniso.U_22_su
    _definition.id             '_atom_site_aniso.U_22_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_22_su'
                               '_atom_site_aniso_U_22_su'
                               '_atom_site.aniso_U[2][2]_esd'
                               '_atom_site_anisotrop.U[2][2]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_22_su
     save_
 
 
save_atom_site_aniso.U_23_su
    _definition.id             '_atom_site_aniso.U_23_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_23_su'
                               '_atom_site_aniso_U_23_su'
                               '_atom_site.aniso_U[2][3]_esd'
                               '_atom_site_anisotrop.U[2][3]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_23_su
     save_
 
 
save_atom_site_aniso.U_33_su
    _definition.id             '_atom_site_aniso.U_33_su'
     loop_
    _alias.definition_id       '_atom_site_aniso.U_33_su'
                               '_atom_site_aniso_U_33_su'
                               '_atom_site.aniso_U[3][3]_esd'
                               '_atom_site_anisotrop.U[3][3]_esd'
    _import.get         [{"file":'templ_attr.cif',"save":'aniso_UIJ_su'}]
    _name.category_id            atom_site_aniso
    _name.object_id              U_33_su
     save_
 
 
     save_    #------ close ATOM_SITE category
 
     save_    #------ close ATOM_SITE_ANISO category
 
#============================================================================
 
 
save_ATOM_SITES
 
    _definition.id               ATOM_SITES
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
     The CATEGORY of data items used to describe information which applies
     to all atom sites in a crystal structure.
;
    _name.category_id            ATOM
    _name.object_id              ATOM_SITES
 
 
save_atom_sites.solution_primary
    _definition.id             '_atom_sites.solution_primary'
     loop_
    _alias.definition_id       '_atom_sites.solution_primary'
                               '_atom_sites_solution_primary'
    _definition.update           2012-11-20
    _description.text
;
     Codes which identify the methods used to locate the initial
     atom sites. The *_primary code identifies how the first
     atom sites were determined; the *_secondary code identifies
     how the remaining non-hydrogen sites were located; and the
     *_hydrogens code identifies how the hydrogen sites were located.
 
     Ref: Sheldrick, G. M., Hauptman, H. A., Weeks, C. M.,
          Miller, R. and Us\'on, I. (2001). Ab initio phasing.
          In International Tables for Crystallography,
          Vol. F. Crystallography of biological macromolecules,
          edited by M. G. Rossmann and E. Arnold, ch. 16.1.
          Dordrecht: Kluwer Academic Publishers.
;
    _name.category_id            atom_sites
    _name.object_id              solution_primary
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
       difmap     'difference Fourier map'
       vecmap     'real-space vector search'
       heavy      'heavy-atom method'
       direct     'structure-invariant direct methods'
       geom       'inferred from neighbouring sites'
       disper     'anomalous-dispersion techniques'
       isomor     'isomorphous structure methods'
       notdet     'coordinates were not determined'
       dual       'dual-space method (Sheldrick et al., 2001)'
       iterative '''iterative e.g. charge flipping [Oszl\'anyi, G.
                  and S\"uto, A. (2004). Acta Cryst. A60, 134-141]'''
       other      'a method not included elsewhere in this list'
 
    _enumeration.default         direct
     save_
 
 
save_atom_sites.solution_secondary
    _definition.id             '_atom_sites.solution_secondary'
     loop_
    _alias.definition_id       '_atom_sites.solution_secondary'
                               '_atom_sites_solution_secondary'
    _definition.update           2012-11-20
    _description.text
;
     Codes which identify the methods used to locate the initial
     atom sites. The *_primary code identifies how the first
     atom sites were determined; the *_secondary code identifies
     how the remaining non-hydrogen sites were located; and the
     *_hydrogens code identifies how the hydrogen sites were located.
 
     Ref: Sheldrick, G. M., Hauptman, H. A., Weeks, C. M.,
          Miller, R. and Us\'on, I. (2001). Ab initio phasing.
          In International Tables for Crystallography,
          Vol. F. Crystallography of biological macromolecules,
          edited by M. G. Rossmann and E. Arnold, ch. 16.1.
          Dordrecht: Kluwer Academic Publishers.
;
    _name.category_id            atom_sites
    _name.object_id              solution_secondary
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
       difmap     'difference Fourier map'
       vecmap     'real-space vector search'
       heavy      'heavy-atom method'
       direct     'structure-invariant direct methods'
       geom       'inferred from neighbouring sites'
       disper     'anomalous-dispersion techniques'
       isomor     'isomorphous structure methods'
       notdet     'coordinates were not determined'
       dual       'dual-space method (Sheldrick et al., 2001)'
       iterative '''iterative e.g. charge flipping [Oszl\'anyi, G.
                  and S\"uto, A. (2004). Acta Cryst. A60, 134-141]'''
       other      'a method not included elsewhere in this list'
 
    _enumeration.default         difmap
     save_
 
 
save_atom_sites.solution_hydrogens
    _definition.id             '_atom_sites.solution_hydrogens'
     loop_
    _alias.definition_id       '_atom_sites.solution_hydrogens'
                               '_atom_sites_solution_hydrogens'
    _definition.update           2012-11-20
    _description.text
;
     Codes which identify the methods used to locate the initial
     atom sites. The *_primary code identifies how the first
     atom sites were determined; the *_secondary code identifies
     how the remaining non-hydrogen sites were located; and the
     *_hydrogens code identifies how the hydrogen sites were located.
 
     Ref: Sheldrick, G. M., Hauptman, H. A., Weeks, C. M.,
          Miller, R. and Us\'on, I. (2001). Ab initio phasing.
          In International Tables for Crystallography,
          Vol. F. Crystallography of biological macromolecules,
          edited by M. G. Rossmann and E. Arnold, ch. 16.1.
          Dordrecht: Kluwer Academic Publishers.
;
    _name.category_id            atom_sites
    _name.object_id              solution_hydrogens
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
       difmap     'difference Fourier map'
       vecmap     'real-space vector search'
       heavy      'heavy-atom method'
       direct     'structure-invariant direct methods'
       geom       'inferred from neighbouring sites'
       disper     'anomalous-dispersion techniques'
       isomor     'isomorphous structure methods'
       notdet     'coordinates were not determined'
       dual       'dual-space method (Sheldrick et al., 2001)'
       iterative '''iterative e.g. charge flipping [Oszl\'anyi, G.
                  and S\"uto, A. (2004). Acta Cryst. A60, 134-141]'''
       other      'a method not included elsewhere in this list'
 
    _enumeration.default         difmap
     save_
 
 
save_atom_sites.special_details
    _definition.id             '_atom_sites.special_details'
     loop_
    _alias.definition_id       '_atom_sites.special_details'
                               '_atom_sites_special_details'
    _definition.update           2012-11-20
    _description.text
;
    Information about atomic coordinates not coded elsewhere in the CIF.
;
    _name.category_id            atom_sites
    _name.object_id              special_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
#----------------------------------------------------------------------------
 
 
save_ATOM_SITES_CARTN_TRANSFORM
 
    _definition.id               ATOM_SITES_CARTN_TRANSFORM
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
     The CATEGORY of data items used to describe the matrix elements
     used to transform Cartesion coordinates into fractional coordinates
     of all atom sites in a crystal structure.
;
    _name.category_id            ATOM_SITES
    _name.object_id              ATOM_SITES_CARTN_TRANSFORM
 
 
save_atom_sites_Cartn_transform.axes
    _definition.id             '_atom_sites_Cartn_transform.axes'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.axes'
                               '_atom_sites_Cartn_transform_axes'
                               '_atom_sites.Cartn_transform_axes'
    _definition.update           2012-12-11
    _description.text
;
     Description of the relative alignment of the crystal cell axes to the
     Cartesian orthogonal axes as applied in the transformation matrix
     _atom_sites_Cartn_transform.matrix.
;
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              axes
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'a parallel to x; b in the plane of y & z'
     save_
 
 
save_atom_sites_Cartn_transform.matrix
    _definition.id             '_atom_sites_Cartn_transform.matrix'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.matrix'
    _definition.update           2012-12-11
    _description.text
;
     Matrix used to transform fractional coordinates in the ATOM_SITE
     category to Cartesian  coordinates. The axial alignments of this
     transformation are described in _atom_sites_Cartn_transform.axes.
     The 3 x 1 translation is defined in _atom_sites_Cartn_transform.vector.
 
       x'                   |11 12 13|     x                  | 1 |
     ( y' ) Cartesian   =   |21 22 23| * ( y ) fractional  + v| 2 |
       z'                   |31 32 33|     z                  | 3 |
 
     The default transformation matrix uses Rollet's axial
     assignments with cell vectors a,b,c aligned with orthogonal
     axes X,Y,Z so that c||Z and b in plane YZ.
;
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              matrix
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a as atom_sites_Cartn_transform
 
     _atom_sites_Cartn_transform.matrix = [[a.mat_11, a.mat_12, a.mat_13],
                                           [a.mat_21, a.mat_22, a.mat_23],
                                           [a.mat_31, a.mat_32, a.mat_33]]
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_11
    _definition.id             '_atom_sites_Cartn_transform.mat_11'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_11'
                               '_atom_sites_Cartn_tran_matrix_11'
                               '_atom_sites.Cartn_transf_matrix[1][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_11
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With l  as  cell_length
     With a  as  cell_angle
     With r  as  cell_reciprocal_angle
 
    _atom_sites_Cartn_transform.mat_11 =  l.a*Sind(a.beta)*Sind(r.gamma)
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_12
    _definition.id             '_atom_sites_Cartn_transform.mat_12'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_12'
                               '_atom_sites_Cartn_tran_matrix_12'
                               '_atom_sites.Cartn_transf_matrix[1][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_12
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _atom_sites_Cartn_transform.mat_12 =  0.
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_13
    _definition.id             '_atom_sites_Cartn_transform.mat_13'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_13'
                               '_atom_sites_Cartn_tran_matrix_13'
                               '_atom_sites.Cartn_transf_matrix[1][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_13
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _atom_sites_Cartn_transform.mat_13 =  0.
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_21
    _definition.id             '_atom_sites_Cartn_transform.mat_21'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_21'
                               '_atom_sites_Cartn_tran_matrix_21'
                               '_atom_sites.Cartn_transf_matrix[2][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_21
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With l  as  cell_length
     With a  as  cell_angle
     With r  as  cell_reciprocal_angle
 
    _atom_sites_Cartn_transform.mat_21 =  -l.a*Sind(a.beta)*Cosd(r.gamma)
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_22
    _definition.id             '_atom_sites_Cartn_transform.mat_22'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_22'
                               '_atom_sites_Cartn_tran_matrix_22'
                               '_atom_sites.Cartn_transf_matrix[2][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_22
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a  as  cell_angle
 
    _atom_sites_Cartn_transform.mat_22 =  _cell_length.b * Sind(a.alpha)
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_23
    _definition.id             '_atom_sites_Cartn_transform.mat_23'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_23'
                               '_atom_sites_Cartn_tran_matrix_23'
                               '_atom_sites.Cartn_transf_matrix[2][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_23
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _atom_sites_Cartn_transform.mat_23 =  0.
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_31
    _definition.id             '_atom_sites_Cartn_transform.mat_31'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_31'
                               '_atom_sites_Cartn_tran_matrix_31'
                               '_atom_sites.Cartn_transf_matrix[3][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_31
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a  as  cell_angle
 
    _atom_sites_Cartn_transform.mat_31 =  _cell_length.a * Cosd(a.beta)
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_32
    _definition.id             '_atom_sites_Cartn_transform.mat_32'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_32'
                               '_atom_sites_Cartn_tran_matrix_32'
                               '_atom_sites.Cartn_transf_matrix[3][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_32
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a  as  cell_angle
 
    _atom_sites_Cartn_transform.mat_32 =  _cell_length.b * Cosd(a.alpha)
;
     save_
 
 
save_atom_sites_Cartn_transform.mat_33
    _definition.id             '_atom_sites_Cartn_transform.mat_33'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.mat_33'
                               '_atom_sites_Cartn_tran_matrix_33'
                               '_atom_sites.Cartn_transf_matrix[3][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              mat_33
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
    _atom_sites_Cartn_transform.mat_33 =  _cell_length.c
;
     save_
 
 
save_atom_sites_Cartn_transform.vector
    _definition.id             '_atom_sites_Cartn_transform.vector'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.vector'
    _definition.update           2012-11-20
    _description.text
;
     The 3x1 translation is used with _atom_sites_Cartn_transform.matrix
     used to transform fractional coordinates to Cartesian  coordinates.
     The axial alignments of this transformation are described in
     _atom_sites_Cartn_transform.axes.
;
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              vector
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With t as atom_sites_Cartn_transform
 
    _atom_sites_Cartn_transform.vector =  [ t.vec_1, t.vec_2, t.vec_3 ]
;
     save_
 
 
save_atom_sites_Cartn_transform.vec_1
    _definition.id             '_atom_sites_Cartn_transform.vec_1'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.vec_1'
                               '_atom_sites_Cartn_tran_vector_1'
                               '_atom_sites.Cartn_transf_vector[1]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              vec_1
     save_
 
 
save_atom_sites_Cartn_transform.vec_2
    _definition.id             '_atom_sites_Cartn_transform.vec_2'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.vec_2'
                               '_atom_sites_Cartn_tran_vector_2'
                               '_atom_sites.Cartn_transf_vector[2]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              vec_2
     save_
 
 
save_atom_sites_Cartn_transform.vec_3
    _definition.id             '_atom_sites_Cartn_transform.vec_3'
     loop_
    _alias.definition_id       '_atom_sites_Cartn_transform.vec_3'
                               '_atom_sites_Cartn_tran_vector_3'
                               '_atom_sites.Cartn_transf_vector[3]'
    _import.get         [{"file":'templ_attr.cif',"save":'Cartn_matrix'}]
    _name.category_id            atom_sites_Cartn_transform
    _name.object_id              vec_3
     save_
 
     save_    #------ close ATOM_SITES_CARTN_TRANSFORM category
 
 
#----------------------------------------------------------------------------
 
 
save_ATOM_SITES_FRACT_TRANSFORM
 
    _definition.id               ATOM_SITES_FRACT_TRANSFORM
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-12-11
    _description.text
;
     The CATEGORY of data items used to describe the matrix elements
     used to transform Cartesion coordinates into fractional coordinates
     of all atom sites in a crystal structure.
;
    _name.category_id            ATOM_SITES
    _name.object_id              ATOM_SITES_FRACT_TRANSFORM
 
 
save_atom_sites_fract_transform.axes
    _definition.id             '_atom_sites_fract_transform.axes'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.axes'
                               '_atom_sites_fract_transform_axes'
                               '_atom_sites.fract_transform_axes'
    _definition.update           2012-12-11
    _description.text
;
     Description of the relative alignment of the crystal cell axes to the
     Cartesian orthogonal axes as applied in the transformation matrix
     _atom_sites_fract_transform.matrix.
;
    _name.category_id            atom_sites_fract_transform
    _name.object_id              axes
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'a parallel to x; b in the plane of y & z'
     save_
 
 
save_atom_sites_fract_transform.matrix
    _definition.id             '_atom_sites_fract_transform.matrix'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.matrix'
    _definition.update           2012-12-11
    _description.text
;
     Matrix used to transform fractional coordinates in the ATOM_SITE
     category to Cartesian  coordinates. The axial alignments of this
     transformation are described in _atom_sites_fract_transform.axes.
     The 3 x 1 translation is defined in _atom_sites_fract_transform.vector.
 
       x'                   |11 12 13|     x                  | 1 |
     ( y' )fractional = mat |21 22 23| * ( y ) Cartesian + vec| 2 |
       z'                   |31 32 33|     z                  | 3 |
 
     The default transformation matrix uses Rollet's axial
     assignments with cell vectors a,b,c aligned with orthogonal
     axes X,Y,Z so that c||Z and b in plane YZ.
;
    _name.category_id            atom_sites_fract_transform
    _name.object_id              matrix
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3,3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With a as atom_sites_fract_transform
 
     _atom_sites_fract_transform.matrix = [[a.mat_11, a.mat_12, a.mat_13],
                                           [a.mat_21, a.mat_22, a.mat_23],
                                           [a.mat_31, a.mat_32, a.mat_33]]
;
     save_
 
 
save_atom_sites_fract_transform.mat_11
    _definition.id             '_atom_sites_fract_transform.mat_11'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_11'
                               '_atom_sites_fract_tran_matrix_11'
                               '_atom_sites.fract_transf_matrix[1][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_11
     save_
 
 
save_atom_sites_fract_transform.mat_12
    _definition.id             '_atom_sites_fract_transform.mat_12'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_12'
                               '_atom_sites_fract_tran_matrix_12'
                               '_atom_sites.fract_transf_matrix[1][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_12
     save_
 
 
save_atom_sites_fract_transform.mat_13
    _definition.id             '_atom_sites_fract_transform.mat_13'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_13'
                               '_atom_sites_fract_tran_matrix_13'
                               '_atom_sites.fract_transf_matrix[1][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_13
     save_
 
 
save_atom_sites_fract_transform.mat_21
    _definition.id             '_atom_sites_fract_transform.mat_21'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_21'
                               '_atom_sites_fract_tran_matrix_21'
                               '_atom_sites.fract_transf_matrix[2][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_21
     save_
 
 
save_atom_sites_fract_transform.mat_22
    _definition.id             '_atom_sites_fract_transform.mat_22'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_22'
                               '_atom_sites_fract_tran_matrix_22'
                               '_atom_sites.fract_transf_matrix[2][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_22
     save_
 
 
save_atom_sites_fract_transform.mat_23
    _definition.id             '_atom_sites_fract_transform.mat_23'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_23'
                               '_atom_sites_fract_tran_matrix_23'
                               '_atom_sites.fract_transf_matrix[2][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_23
     save_
 
 
save_atom_sites_fract_transform.mat_31
    _definition.id             '_atom_sites_fract_transform.mat_31'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_31'
                               '_atom_sites_fract_tran_matrix_31'
                               '_atom_sites.fract_transf_matrix[3][1]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_31
     save_
 
 
save_atom_sites_fract_transform.mat_32
    _definition.id             '_atom_sites_fract_transform.mat_32'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_32'
                               '_atom_sites_fract_tran_matrix_32'
                               '_atom_sites.fract_transf_matrix[3][2]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_32
     save_
 
 
save_atom_sites_fract_transform.mat_33
    _definition.id             '_atom_sites_fract_transform.mat_33'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.mat_33'
                               '_atom_sites_fract_tran_matrix_33'
                               '_atom_sites.fract_transf_matrix[3][3]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              mat_33
     save_
 
 
save_atom_sites_fract_transform.vector
    _definition.id             '_atom_sites_fract_transform.vector'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.vector'
    _definition.update           2012-11-20
    _description.text
;
     The 3x1 translation is used with _atom_sites_fract_transform.matrix
     used to transform Cartesian coordinates to fractional  coordinates.
     The axial alignments of this transformation are described in
     _atom_sites_fract_transform.axes.
;
    _name.category_id            atom_sites_fract_transform
    _name.object_id              vector
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
    loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With t as atom_sites_fract_transform
 
    _atom_sites_fract_transform.vector =  [ t.vec_1, t.vec_2, t.vec_3 ]
;
     save_
 
 
save_atom_sites_fract_transform.vec_1
    _definition.id             '_atom_sites_fract_transform.vec_1'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.vec_1'
                               '_atom_sites_fract_tran_vector_1'
                               '_atom_sites.fract_transf_vector[1]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              vec_1
     save_
 
 
save_atom_sites_fract_transform.vec_2
    _definition.id             '_atom_sites_fract_transform.vec_2'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.vec_2'
                               '_atom_sites_fract_tran_vector_2'
                               '_atom_sites.fract_transf_vector[2]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              vec_2
     save_
 
 
save_atom_sites_fract_transform.vec_3
    _definition.id             '_atom_sites_fract_transform.vec_3'
     loop_
    _alias.definition_id       '_atom_sites_fract_transform.vec_3'
                               '_atom_sites_fract_tran_vector_3'
                               '_atom_sites.fract_transf_vector[3]'
    _import.get         [{"file":'templ_attr.cif',"save":'fract_matrix'}]
    _name.category_id            atom_sites_fract_transform
    _name.object_id              vec_3
     save_
 
     save_    #------ close ATOM_SITES_FRACT_TRANSFORM category
 
     save_    #------ close ATOM_SITES category
 
 
#============================================================================
 
save_ATOM_TYPE
 
    _definition.id               ATOM_TYPE
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe atomic type information
     used in crystallographic structure studies.
;
    _name.category_id            ATOM
    _name.object_id              ATOM_TYPE
    _category.key_id           '_atom_type.key'
    _category.key_list        ['_atom_type.symbol']
 
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     typelist  = List()
 
     Loop  a  as  atom_site  {
        type = AtomType ( a.label )
        If( type not in typelist )  typelist ++= type
      }
      For type in typelist {
                              atom_type(.symbol         = type,
                                        .number_in_cell = '?'   )
      }
;
 
 
save_atom_type.key
    _definition.id             '_atom_type.key'
     loop_
    _alias.definition_id       '_atom_type.key'
    _definition.update           2012-11-20
    _description.text
;
     Value is a unique key to a set of ATOM_TYPE items
     in a looped list.
;
    _name.category_id            atom_type
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
    loop_
    _method.purpose
    _method.expression
     Definition
;              _type.contents = Type_Contents(atom_type.symbol)
;
     Evaluation
;              _atom_type.key = _atom_type.symbol
;
     save_
 
 
save_atom_type.analytical_mass_percent
    _definition.id             '_atom_type.analytical_mass_percent'
     loop_
    _alias.definition_id       '_atom_type.analytical_mass_percent'
                               '_atom_type_analytical_mass_%'
                               '_atom_type.analytical_mass_%'
    _definition.update           2013-04-11
    _description.text
;
     Mass percentage of this atom type derived from chemical analysis.
;
    _name.category_id            atom_type
    _name.object_id              analytical_mass_percent
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:100.
    _units.code                  none
     save_
 
 
save_atom_type.atomic_mass
    _definition.id             '_atom_type.atomic_mass'
     loop_
    _alias.definition_id       '_atom_type.atomic_mass'
    _definition.update           2012-11-20
    _description.text
;
     Mass of this atom type.
;
    _name.category_id            atom_type
    _name.object_id              atomic_mass
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _import.get         [{"file":'templ_enum.cif',"save":'atomic_mass'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _units.code                  dalton
     save_
 
 
save_atom_type.atomic_number
    _definition.id             '_atom_type.atomic_number'
     loop_
    _alias.definition_id       '_atom_type.atomic_number'
    _definition.update           2012-11-20
    _description.text
;
     Atomic number of this atom type.
;
    _name.category_id            atom_type
    _name.object_id              atomic_number
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Index
    _import.get         [{"file":'templ_enum.cif',"save":'atomic_number'}]
    _enumeration.def_index_id  '_atom_type.symbol'
     save_
 
 
save_atom_type.description
    _definition.id             '_atom_type.description'
     loop_
    _alias.definition_id       '_atom_type.description'
                               '_atom_type_description'
    _definition.update           2012-11-20
    _description.text
;
     A description of the atom(s) designated by this atom type. In
     most cases this will be the element name and oxidation state of
     a single atom  species. For disordered or nonstoichiometric
     structures it will describe a combination of atom species.
;
    _name.category_id            atom_type
    _name.object_id              description
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case    deuterium     '0.34Fe+0.66Ni'
     save_
 
 
save_atom_type.display_colour
    _definition.id             '_atom_type.display_colour'
     loop_
    _alias.definition_id       '_atom_type.display_colour'
    _definition.update           2012-11-20
    _description.text
;
     The display colour assigned to this atom type. Note that the
     possible colours are enumerated in the display_colour list
     category of items.
;
    _name.category_id            atom_type
    _name.object_id              display_colour
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
    _import.get         [{"file":'templ_enum.cif',"save":'colour_rgb'},
                         {"file":'templ_enum.cif',"save":'colour_hue'}]
    _enumeration.def_index_id  '_atom_type.symbol'
     save_
 
 
save_atom_type.electron_count
    _definition.id             '_atom_type.electron_count'
     loop_
    _alias.definition_id       '_atom_type.electron_count'
    _definition.update           2012-11-20
    _description.text
;
     Number of electrons in this atom type.
;
    _name.category_id            atom_type
    _name.object_id              electron_count
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Index
    _import.get         [{"file":'templ_enum.cif',"save":'electron_count'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _enumeration.range           1:
     save_
 
 
save_atom_type.element_symbol
    _definition.id             '_atom_type.element_symbol'
     loop_
    _alias.definition_id       '_atom_type.element_symbol'
    _definition.update           2012-11-20
    _description.text
;
     Element symbol for of this atom type. The default value is extracted
     from the ion-to-element enumeration_default list using the index
     value of atom_type.symbol.
;
    _name.category_id            atom_type
    _name.object_id              element_symbol
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
    _import.get         [{"file":'templ_enum.cif',"save":'element_symbol'},
                         {"file":'templ_enum.cif',"save":'ion_to_element'}]
    _enumeration.def_index_id  '_atom_type.symbol'
     save_
 
 
save_atom_type.number_in_cell
    _definition.id             '_atom_type.number_in_cell'
     loop_
    _alias.definition_id       '_atom_type.number_in_cell'
                               '_atom_type_number_in_cell'
    _definition.update           2013-01-28
    _description.text
;
     Total number of atoms of this atom type in the unit cell.
;
    _name.category_id            atom_type
    _name.object_id              number_in_cell
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0:
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With t as atom_type
 
    cnt =  0.
 
    Loop a  as  atom_site  {
 
       if ( a.type_symbol == t.symbol ) {
 
          cnt +=  a.gt * a.site_symmetry_multiplicity
    }  }
    _atom_type.number_in_cell =  cnt
;
     save_
 
 
save_atom_type.oxidation_number
    _definition.id             '_atom_type.oxidation_number'
     loop_
    _alias.definition_id       '_atom_type.oxidation_number'
                               '_atom_type_oxidation_number'
    _definition.update           2012-11-20
    _description.text
;
     Formal oxidation state of this atom type in the structure.
;
    _name.category_id            atom_type
    _name.object_id              oxidation_number
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Integer
    _enumeration.range          -8:8
    _enumeration.default         0
     save_
 
 
save_atom_type.radius_bond
    _definition.id             '_atom_type.radius_bond'
     loop_
    _alias.definition_id       '_atom_type.radius_bond'
                               '_atom_type_radius_bond'
    _definition.update           2012-11-20
    _description.text
;
     The effective intra-molecular bonding radius of this atom type.
;
    _name.category_id            atom_type
    _name.object_id              radius_bond
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _import.get         [{"file":'templ_enum.cif',"save":'radius_bond'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _enumeration.range           0.0:5.0
    _units.code                  angstroms
     save_
 
 
save_atom_type.radius_contact
    _definition.id             '_atom_type.radius_contact'
     loop_
    _alias.definition_id       '_atom_type.radius_contact'
                               '_atom_type_radius_contact'
    _definition.update           2012-11-20
    _description.text
;
     The effective inter-molecular bonding radius of this atom type.
;
    _name.category_id            atom_type
    _name.object_id              radius_contact
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:5.0
    _units.code                  angstroms
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     _atom_type.radius_contact =  atom_type.radius_bond + 1.25
;
     save_
 
 
save_atom_type.symbol
    _definition.id             '_atom_type.symbol'
     loop_
    _alias.definition_id       '_atom_type.symbol'
                               '_atom_type_symbol'
    _definition.update           2012-12-21
    _description.text
;
     The identity of the atom specie(s) representing this atom type.
     Normally this code is the element symbol followed by the charge
     if there is one. The symbol may be composed of any character except
     an underline or a blank, with the proviso that digits designate an
     oxidation state and must be followed by a + or - character.
;
    _name.category_id            atom_type
    _name.object_id              symbol
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _description_example.case    Mg  Cu2+  dummy  FeNi
     save_
 
 
#============================================================================
 
 
save_ATOM_TYPE_SCAT
 
    _definition.id               ATOM_TYPE_SCAT
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to describe atomic scattering
     information used in crystallographic structure studies.
;
    _name.category_id            ATOM_TYPE
    _name.object_id              ATOM_TYPE_SCAT
    _category.key_id           '_atom_type_scat.key'
    _category.key_list        ['_atom_type_scat.symbol']
 
 
save_atom_type_scat.key
    _definition.id             '_atom_type_scat.key'
     loop_
    _alias.definition_id       '_atom_type_scat.key'
    _definition.update           2012-11-20
    _description.text
;
     Value is a unique key to a set of ATOM_TYPE_SCAT items in a
     looped list. This list may be joined with the ATOM_TYPE list.
;
    _name.category_id            atom_type_scat
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
    loop_
    _method.purpose
    _method.expression
     Definition
;              _type.contents = Type_Contents(atom_type_scat.symbol)
;
     Evaluation
;              _atom_type_scat.key = _atom_type_scat.symbol
;
     save_
 
 
save_atom_type_scat.Cromer_Mann_coeffs
    _definition.id             '_atom_type_scat.Cromer_Mann_coeffs'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_coeffs'
    _definition.update           2012-11-20
    _description.text
;
     The set of Cromer-Mann coefficients for generating X-ray scattering
     factors. [ a1, b1, a2, b2, a3, b3, a4, b4, c]
     Ref: International Tables for Crystallography, Vol. C
             (1991) Table 6.1.1.4
;
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_coeffs
    _type.purpose                Number
    _type.source                 Derived
    _type.container              List
    _type.contents               Real
    _type.dimension              [9]
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With t  as  atom_type_scat
 
      _atom_type_scat.Cromer_Mann_coeffs  =          [ t.Cromer_Mann_c,
                                     t.Cromer_Mann_a1, t.Cromer_Mann_b1,
                                     t.Cromer_Mann_a2, t.Cromer_Mann_b2,
                                     t.Cromer_Mann_a3, t.Cromer_Mann_b3,
                                     t.Cromer_Mann_a4, t.Cromer_Mann_b4 ]
;
     save_
 
 
save_atom_type_scat.Cromer_Mann_a1
    _definition.id             '_atom_type_scat.Cromer_Mann_a1'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_a1'
                               '_atom_type_scat_Cromer_Mann_a1'
                               '_atom_type.scat_Cromer_Mann_a1'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_a1'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_a1
     save_
 
 
save_atom_type_scat.Cromer_Mann_a2
    _definition.id             '_atom_type_scat.Cromer_Mann_a2'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_a2'
                               '_atom_type_scat_Cromer_Mann_a2'
                               '_atom_type.scat_Cromer_Mann_a2'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_a2'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_a2
     save_
 
 
save_atom_type_scat.Cromer_Mann_a3
    _definition.id             '_atom_type_scat.Cromer_Mann_a3'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_a3'
                               '_atom_type_scat_Cromer_Mann_a3'
                               '_atom_type.scat_Cromer_Mann_a3'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_a3'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_a3
     save_
 
 
save_atom_type_scat.Cromer_Mann_a4
    _definition.id             '_atom_type_scat.Cromer_Mann_a4'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_a4'
                               '_atom_type_scat_Cromer_Mann_a4'
                               '_atom_type.scat_Cromer_Mann_a4'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_a4'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_a4
     save_
 
 
save_atom_type_scat.Cromer_Mann_b1
    _definition.id             '_atom_type_scat.Cromer_Mann_b1'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_b1'
                               '_atom_type_scat_Cromer_Mann_b1'
                               '_atom_type.scat_Cromer_Mann_b1'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_b1'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_b1
     save_
 
 
save_atom_type_scat.Cromer_Mann_b2
    _definition.id             '_atom_type_scat.Cromer_Mann_b2'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_b2'
                               '_atom_type_scat_Cromer_Mann_b2'
                               '_atom_type.scat_Cromer_Mann_b2'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_b2'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_b2
     save_
 
 
save_atom_type_scat.Cromer_Mann_b3
    _definition.id             '_atom_type_scat.Cromer_Mann_b3'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_b3'
                               '_atom_type_scat_Cromer_Mann_b3'
                               '_atom_type.scat_Cromer_Mann_b3'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_b3'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_b3
     save_
 
 
save_atom_type_scat.Cromer_Mann_b4
    _definition.id             '_atom_type_scat.Cromer_Mann_b4'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_b4'
                               '_atom_type_scat_Cromer_Mann_b4'
                               '_atom_type.scat_Cromer_Mann_b4'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_b4'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_b4
     save_
 
 
save_atom_type_scat.Cromer_Mann_c
    _definition.id             '_atom_type_scat.Cromer_Mann_c'
     loop_
    _alias.definition_id       '_atom_type_scat.Cromer_Mann_c'
                               '_atom_type_scat_Cromer_Mann_c'
                               '_atom_type.scat_Cromer_Mann_c'
    _import.get         [{"file":'templ_attr.cif',"save":'Cromer_Mann_coeff'},
                         {"file":'templ_enum.cif',"save":'Cromer_Mann_c'}]
    _name.category_id            atom_type_scat
    _name.object_id              Cromer_Mann_c
     save_
 
 
save_atom_type_scat.dispersion
    _definition.id             '_atom_type_scat.dispersion'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion'
    _definition.update           2013-04-28
    _description.text
;
     The anomalous dispersion scattering factor in its complex form
     for this atom type and radiation by _diffrn_radiation_wavelength.value
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Complex
    _enumeration.default         0.0
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With s as atom_type_scat
 
             d = Complex( s.dispersion_real, s.dispersion_imag )
 
        if(_reflns.apply_dispersion_to_Fcalc == 'no')   d = 0.
 
                 _atom_type_scat.dispersion = d
;
     save_
 
 
save_atom_type_scat.dispersion_imag
    _definition.id             '_atom_type_scat.dispersion_imag'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_imag'
                               '_atom_type_scat_dispersion_imag'
                               '_atom_type.scat_dispersion_imag'
    _definition.update           2012-11-20
    _description.text
;
     The imaginary component of the anomalous dispersion scattering factors
     for this atom type and radiation by _diffrn_radiation_wavelength.value
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_imag
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.default         0.0
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With q as atom_type_scat
 
     If ( _diffrn_radiation.type[0:2] == 'Cu' ) a = q.dispersion_imag_cu
     If ( _diffrn_radiation.type[0:2] == 'Mo' ) a = q.dispersion_imag_mo
 
             _atom_type_scat.dispersion_imag = a
;
     save_
 
 
save_atom_type_scat.dispersion_imag_cu
    _definition.id             '_atom_type_scat.dispersion_imag_cu'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_imag_cu'
    _definition.update           2012-11-20
    _description.text
;
     The imaginary component of the anomalous dispersion scattering factors
     for this atom type and Cu K alpha radiation
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_imag_cu
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _import.get         [{"file":'templ_enum.cif',"save":'dispersion_imag_cu'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _units.code                  none
     save_
 
 
save_atom_type_scat.dispersion_imag_mo
    _definition.id             '_atom_type_scat.dispersion_imag_mo'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_imag_mo'
    _definition.update           2012-11-20
    _description.text
;
     The imaginary component of the anomalous dispersion scattering factors
     for this atom type and Mo K alpha radiation
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_imag_mo
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _import.get         [{"file":'templ_enum.cif',"save":'dispersion_imag_mo'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _units.code                  none
     save_
 
 
save_atom_type_scat.dispersion_real
    _definition.id             '_atom_type_scat.dispersion_real'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_real'
                               '_atom_type_scat_dispersion_real'
                               '_atom_type.scat_dispersion_real'
    _definition.update           2012-11-20
    _description.text
;
     The real component of the anomalous dispersion scattering factors
     for this atom type and radiation by _diffrn_radiation_wavelength.value
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_real
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
    With q as atom_type_scat
 
     If ( _diffrn_radiation.type[0:2] == 'Cu' ) a = q.dispersion_real_cu
     If ( _diffrn_radiation.type[0:2] == 'Mo' ) a = q.dispersion_real_mo
 
             _atom_type_scat.dispersion_real = a
;
    _enumeration.default         0.0
     save_
 
 
save_atom_type_scat.dispersion_real_cu
    _definition.id             '_atom_type_scat.dispersion_real_cu'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_real_cu'
    _definition.update           2012-11-20
    _description.text
;
     The real component of the anomalous dispersion scattering factors
     for this atom type and Cu K alpha radiation
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_real_cu
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _import.get         [{"file":'templ_enum.cif',"save":'dispersion_real_cu'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _units.code                  none
     save_
 
 
save_atom_type_scat.dispersion_real_mo
    _definition.id             '_atom_type_scat.dispersion_real_mo'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_real_mo'
    _definition.update           2012-11-20
    _description.text
;
     The real component of the anomalous dispersion scattering factors
     for this atom type and Mo K alpha radiation
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_real_mo
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _import.get         [{"file":'templ_enum.cif',"save":'dispersion_real_mo'}]
    _enumeration.def_index_id  '_atom_type.symbol'
    _units.code                  none
     save_
 
 
save_atom_type_scat.dispersion_source
    _definition.id             '_atom_type_scat.dispersion_source'
     loop_
    _alias.definition_id       '_atom_type_scat.dispersion_source'
                               '_atom_type_scat_dispersion_source'
                               '_atom_type.scat_dispersion_source'
    _definition.update           2012-11-20
    _description.text
;
     Reference to source of real and imaginary dispersion
     corrections for scattering factors used for this atom type.
;
    _name.category_id            atom_type_scat
    _name.object_id              dispersion_source
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'International Tables Vol. IV Table 2.3.1'
     save_
 
 
save_atom_type_scat.hi_ang_Fox_coeffs
    _definition.id             '_atom_type_scat.hi_ang_Fox_coeffs'
     loop_
    _alias.definition_id       '_atom_type_scat.hi_ang_Fox_coeffs'
    _definition.update           2012-11-30
    _description.text
;
     The set of Fox et al. coefficients for generating high angle
     X-ray scattering factors. [ c0, c1, c2, c3 ]
     Ref: International Tables for Crystallography, Vol. C
             (1991) Table 6.1.1.5
;
    _name.category_id            atom_type_scat
    _name.object_id              hi_ang_Fox_coeffs
    _type.purpose                Number
    _type.source                 Derived
    _type.container              List
    _type.contents               Real
    _type.dimension              [4]
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     With t  as  atom_type_scat
 
    _atom_type_scat.hi_ang_Fox_coeffs  =  \
     [t.hi_ang_Fox_c0,t.hi_ang_Fox_c1,t.hi_ang_Fox_c2,t.hi_ang_Fox_c3]
;
     save_
 

save_atom_type_scat.hi_ang_Fox_c0
    _definition.id             '_atom_type_scat.hi_ang_Fox_c0'
     loop_
    _alias.definition_id       '_atom_type_scat.hi_ang_Fox_c0'
    _import.get         [{"file":'templ_attr.cif',"save":'hi_ang_Fox_coeffs'},
                         {"file":'templ_enum.cif',"save":'hi_ang_Fox_c0'}]
    _name.category_id            atom_type_scat
    _name.object_id              hi_ang_Fox_c0
     save_


save_atom_type_scat.hi_ang_Fox_c1
    _definition.id             '_atom_type_scat.hi_ang_Fox_c1'
     loop_
    _alias.definition_id       '_atom_type_scat.hi_ang_Fox_c1'
    _import.get         [{"file":'templ_attr.cif',"save":'hi_ang_Fox_coeffs'},
                         {"file":'templ_enum.cif',"save":'hi_ang_Fox_c1'}]
    _name.category_id            atom_type_scat
    _name.object_id              hi_ang_Fox_c1
     save_


save_atom_type_scat.hi_ang_Fox_c2
    _definition.id             '_atom_type_scat.hi_ang_Fox_c2'
     loop_
    _alias.definition_id       '_atom_type_scat.hi_ang_Fox_c2'
    _import.get         [{"file":'templ_attr.cif',"save":'hi_ang_Fox_coeffs'},
                         {"file":'templ_enum.cif',"save":'hi_ang_Fox_c2'}]
    _name.category_id            atom_type_scat
    _name.object_id              hi_ang_Fox_c2
     save_


save_atom_type_scat.hi_ang_Fox_c3
    _definition.id             '_atom_type_scat.hi_ang_Fox_c3'
     loop_
    _alias.definition_id       '_atom_type_scat.hi_ang_Fox_c3'
    _import.get         [{"file":'templ_attr.cif',"save":'hi_ang_Fox_coeffs'},
                         {"file":'templ_enum.cif',"save":'hi_ang_Fox_c3'}]
    _name.category_id            atom_type_scat
    _name.object_id              hi_ang_Fox_c3
     save_

 
save_atom_type_scat.length_neutron
    _definition.id             '_atom_type_scat.length_neutron'
     loop_
    _alias.definition_id       '_atom_type_scat.length_neutron'
                               '_atom_type_scat_length_neutron'
                               '_atom_type.scat_length_neutron'
    _definition.update           2012-11-20
    _description.text
;
     The bound coherent scattering length for the atom type at the
     isotopic composition used for the diffraction experiment.
;
    _name.category_id            atom_type_scat
    _name.object_id              length_neutron
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Real
    _enumeration.default         0.0
    _units.code                  femtometres
     save_
 
 
save_atom_type_scat.source
    _definition.id             '_atom_type_scat.source'
     loop_
    _alias.definition_id       '_atom_type_scat.source'
                               '_atom_type_scat_source'
                               '_atom_type.scat_source'
    _definition.update           2012-11-20
    _description.text
;
     Reference to source of scattering factors used for this atom type.
;
    _name.category_id            atom_type_scat
    _name.object_id              source
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   'International Tables Vol. IV Table 2.4.6B'
     save_
 
 
save_atom_type_scat.symbol
    _definition.id             '_atom_type_scat.symbol'
     loop_
    _alias.definition_id       '_atom_type_scat.symbol'
                               '_atom_type_scat_symbol'
    _definition.update           2013-01-23
    _description.text
;
     The identity of the atom specie(s) representing this atom type.
     See _atom_type.symbol for further details.
;
    _name.category_id            atom_type_scat
    _name.object_id              symbol
    _name.linked_item_id       '_atom_type.symbol'
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     save_
 
 
save_atom_type_scat.versus_stol_list
    _definition.id             '_atom_type_scat.versus_stol_list'
     loop_
    _alias.definition_id       '_atom_type_scat.versus_stol_list'
                               '_atom_type_scat_versus_stol_list'
                               '_atom_type.scat_versus_stol_list'
    _definition.update           2013-04-17
    _description.text
;
     List of scattering factors as a function of sin theta on lambda.
     List has the form ['<stol value>':'<scatfac>', ....] in
     increments of 0.01, increasing from 0.0.
;
    _name.category_id            atom_type_scat
    _name.object_id              versus_stol_list
    _type.purpose                Number
    _type.source                 Assigned
    _type.container              List
    _type.contents              'List(Real,Real)'
    _type.dimension              []
    _units.code                  none
     save_
 
     save_    #------ close ATOM_TYPE_SCAT category
 
     save_    #------ close ATOM_TYPE category
 
     save_    #------ close ATOM category
 
#============================================================================
 
save_REFINE
 
    _definition.id               REFINE
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
     The CATEGORY of data items used to specify information about the
     refinement of the structural model.
;
    _name.category_id            STRUCTURE
    _name.object_id              REFINE
 
save_refine.special_details
    _definition.id             '_refine.special_details'
     loop_
    _alias.definition_id       '_refine.special_details'
                               '_refine_special_details'
                               '_refine.details'
    _definition.update           2012-11-20
    _description.text
;
     Details of the refinement not specified by other data items.
;
    _name.category_id            refine
    _name.object_id              special_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
#----------------------------------------------------------------------------
 
save_REFINE_DIFF
 
    _definition.id               REFINE_DIFF
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
     The CATEGORY of data items which specify the electron density limits
     in a difference Fourier map after the structure has been refined. The
     rms value is with respect to the arithmetic mean density, and is derived
     from summations over each grid point in the asymmetric unit of the cell.
;
    _name.category_id            REFINE
    _name.object_id              REFINE_DIFF
 
 
save_refine_diff.density_max
    _definition.id             '_refine_diff.density_max'
     loop_
    _alias.definition_id       '_refine_diff.density_max'
                               '_refine_diff_density_max'
                               '_refine.diff_density_max'
    _definition.update           2012-11-20
    _description.text
;
     Maximum density value in a difference Fourier map.
;
    _name.category_id            refine_diff
    _name.object_id              density_max
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           -100.:
     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_refine_diff.density_max_su
    _definition.id             '_refine_diff.density_max_su'
     loop_
    _alias.definition_id       '_refine_diff.density_max_su'
                               '_refine_diff_density_max_su'
                               '_refine.diff_density_max_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the
     Maximum density value in a difference Fourier map.
;
    _name.category_id            refine_diff
    _name.object_id              density_max_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    save_
 
 
save_refine_diff.density_min
    _definition.id             '_refine_diff.density_min'
     loop_
    _alias.definition_id       '_refine_diff.density_min'
                               '_refine_diff_density_min'
                               '_refine.diff_density_min'
    _definition.update           2012-11-20
    _description.text
;
     Miniumum density value in a difference Fourier map.
;
    _name.category_id            refine_diff
    _name.object_id              density_min
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           :100.
     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_refine_diff.density_min_su
    _definition.id             '_refine_diff.density_min_su'
     loop_
    _alias.definition_id       '_refine_diff.density_min_su'
                               '_refine_diff_density_min_su'
                               '_refine.diff_density_min_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the
     Miniumum density value in a difference Fourier map.
;
    _name.category_id            refine_diff
    _name.object_id              density_min_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    save_
 
 
save_refine_diff.density_rms
    _definition.id             '_refine_diff.density_rms'
     loop_
    _alias.definition_id       '_refine_diff.density_rms'
                               '_refine_diff_density_rms'
                               '_refine.diff_density_rms'
    _definition.update           2012-11-20
    _description.text
;
     Root mean square density value in a difference Fourier map.
     This value is measured with respect to the arithmetic mean
     density and is derived from summations over each grid point
     in the asymmetric unit of the cell. This quantity is useful
     for assessing the significance of *_min and *_max values,
     and also for defining suitable contour levels.
;
    _name.category_id            refine_diff
    _name.object_id              density_rms
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           -100.:100.
     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_refine_diff.density_rms_su
    _definition.id             '_refine_diff.density_rms_su'
     loop_
    _alias.definition_id       '_refine_diff.density_rms_su'
                               '_refine_diff_density_rms_su'
                               '_refine.diff_density_rms_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the
     Root mean square density value in a difference Fourier map.
;
    _name.category_id            refine_diff
    _name.object_id              density_rms_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    save_
 
     save_    #------ close REFINE_DIFF category
 
#----------------------------------------------------------------------------
 
save_REFINE_LS
 
    _definition.id               REFINE_LS
    _definition.scope            Category
    _definition.class            Set
    _definition.update           2012-11-20
    _description.text
;
     The CATEGORY of data items used to specify information about the
     refinement of the structural model.
;
    _name.category_id            REFINE
    _name.object_id              REFINE_LS
 
 
save_refine_ls.abs_structure_details
    _definition.id             '_refine_ls.abs_structure_details'
     loop_
    _alias.definition_id       '_refine_ls.abs_structure_details'
                               '_refine_ls_abs_structure_details'
                               '_refine.ls_abs_structure_details'
    _definition.update           2012-11-20
    _description.text
;
     Details on the absolute structure and how it was determined.
;
    _name.category_id            refine_ls
    _name.object_id              abs_structure_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_refine_ls.abs_structure_Flack
    _definition.id             '_refine_ls.abs_structure_Flack'
     loop_
    _alias.definition_id       '_refine_ls.abs_structure_Flack'
                               '_refine_ls_abs_structure_Flack'
                               '_refine.ls_abs_structure_Flack'
    _definition.update           2012-11-20
    _description.text
;
     The measure of absolute structure as defined by Flack (1983).
     For centrosymmetric structures, the only permitted value, if the
     data name is present, is 'inapplicable', represented by '.' .
     For noncentrosymmetric structures, the value must lie in the
     99.97% Gaussian confidence interval  -3u =< x =< 1 + 3u and a
     standard uncertainty (e.s.d.) u must be supplied. The
     _enumeration.range of 0.0:1.0 is correctly interpreted as
     meaning (0.0 - 3u) =< x =< (1.0 + 3u).
     Ref: Flack, H. D. (1983). Acta Cryst. A39, 876-881.
;
    _name.category_id            refine_ls
    _name.object_id              abs_structure_Flack
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:1.0
    _units.code                  none
     save_
 
 
save_refine_ls.abs_structure_Flack_su
    _definition.id             '_refine_ls.abs_structure_Flack_su'
     loop_
    _alias.definition_id       '_refine_ls.abs_structure_Flack_su'
                               '_refine_ls_abs_structure_Flack_su'
                               '_refine.ls_abs_structure_Flack_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the
     The measure of absolute structure as defined by Flack (1983).
;
    _name.category_id            refine_ls
    _name.object_id              abs_structure_Flack_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    save_
 
 
save_refine_ls.abs_structure_Rogers
    _definition.id             '_refine_ls.abs_structure_Rogers'
     loop_
    _alias.definition_id       '_refine_ls.abs_structure_Rogers'
                               '_refine_ls_abs_structure_Rogers'
                               '_refine.ls_abs_structure_Rogers'
    _definition.update           2012-11-20
    _description.text
;
     The measure of absolute structure as defined by Rogers (1981).
     The value must lie in the 99.97% Gaussian confidence interval
     -1 -3u =< \h =< 1 + 3u and a standard uncertainty (e.s.d.) u must
     be supplied. The _enumeration.range of -1.0:1.0 is correctly
     interpreted as meaning (-1.0 - 3u) =< \h =< (1.0 + 3u).
     Ref: Rogers, D. (1981). Acta Cryst. A37, 734-741.
;
    _name.category_id            refine_ls
    _name.object_id              abs_structure_Rogers
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           -1.0:1.0
    _units.code                  none
     save_
 
 
save_refine_ls.abs_structure_Rogers_su
    _definition.id             '_refine_ls.abs_structure_Rogers_su'
     loop_
    _alias.definition_id       '_refine_ls.abs_structure_Rogers_su'
                               '_refine_ls_abs_structure_Rogers_su'
                               '_refine.ls_abs_structure_Rogers_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the
     The measure of absolute structure as defined by Rogers (1981).
;
    _name.category_id            refine_ls
    _name.object_id              abs_structure_Rogers_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    save_
 
 
save_refine_ls.d_res_high
    _definition.id             '_refine_ls.d_res_high'
     loop_
    _alias.definition_id       '_refine_ls.d_res_high'
                               '_refine_ls_d_res_high'
                               '_refine.ls_d_res_high'
    _definition.update           2012-11-20
    _description.text
;
     Highest resolution for the reflections used in refinement.
     This corresponds to the smallest interpanar d value.
;
    _name.category_id            refine_ls
    _name.object_id              d_res_high
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstroms
     save_
 
 
save_refine_ls.d_res_low
    _definition.id             '_refine_ls.d_res_low'
     loop_
    _alias.definition_id       '_refine_ls.d_res_low'
                               '_refine_ls_d_res_low'
                               '_refine.ls_d_res_low'
    _definition.update           2012-11-20
    _description.text
;
     Lowest resolution for the reflections used in refinement.
     This corresponds to the largest interpanar d value.
;
    _name.category_id            refine_ls
    _name.object_id              d_res_low
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstroms
     save_
 
 
save_refine_ls.extinction_coef
    _definition.id             '_refine_ls.extinction_coef'
     loop_
    _alias.definition_id       '_refine_ls.extinction_coef'
                               '_refine_ls_extinction_coef'
                               '_refine.ls_extinction_coef'
    _definition.update           2012-11-20
    _description.text
;
     The extinction coefficient used to calculate the correction
     factor applied to the structure-factor data. The nature of the
     extinction coefficient is given in the definitions of
     _refine_ls.extinction_expression and _refine_ls.extinction_method.
     For the 'Zachariasen' method it is the r* value; for the
     'Becker-Coppens type 1 isotropic' method it is the 'g' value.
     For 'Becker-Coppens type 2 isotropic' corrections it is
     the 'rho' value. Note that the magnitude of these values is
     usually of the order of 10000.
     Ref:  Becker, P. J. & Coppens, P. (1974). Acta Cryst. A30,
           129-147, 148-153.
           Zachariasen, W. H. (1967). Acta Cryst. 23, 558-564.
           Larson, A. C. (1967). Acta Cryst. 23, 664-665.
;
    _name.category_id            refine_ls
    _name.object_id              extinction_coef
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  none
     loop_
    _description_example.case
    _description_example.detail
            3472(52)    'Zachariasen coefficient r* = 0.347(5)e+04'
     save_
 
 
save_refine_ls.extinction_coef_su
    _definition.id             '_refine_ls.extinction_coef_su'
     loop_
    _alias.definition_id       '_refine_ls.extinction_coef_su'
                               '_refine_ls_extinction_coef_su'
                               '_refine.ls_extinction_coef_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the extinction coefficient
;
    _name.category_id            refine_ls
    _name.object_id              extinction_coef_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.:
    _units.code                  none
    save_
 
 
save_refine_ls.extinction_expression
    _definition.id             '_refine_ls.extinction_expression'
     loop_
    _alias.definition_id       '_refine_ls.extinction_expression'
                               '_refine_ls_extinction_expression'
                               '_refine.ls_extinction_expression'
    _definition.update           2012-11-20
    _description.text
;
     Description of or reference to the extinction-correction equation
     used to apply the data item  _refine_ls.extinction_coef. This
     information should be sufficient to reproduce the extinction-
     correction factors applied to the structure factors.
;
    _name.category_id            refine_ls
    _name.object_id              extinction_expression
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case
    _description_example.detail   'Larson approach'
;      Larson, A. C. (1970). "Crystallographic Computing", edited by
              F. R. Ahmed. Eq. (22) p. 292.  Copenhagen: Munksgaard.
;
     save_
 
 
save_refine_ls.extinction_method
    _definition.id             '_refine_ls.extinction_method'
     loop_
    _alias.definition_id       '_refine_ls.extinction_method'
                               '_refine_ls_extinction_method'
                               '_refine.ls_extinction_method'
    _definition.update           2012-11-20
    _description.text
;
     Description of the extinction correction method applied with the
     data item _refine_ls.extinction_coef. This description should
     include information about the correction method, either 'Becker-
     Coppens' or 'Zachariasen'. The latter is sometimes referred to as
     the 'Larson' method even though it employs Zachariasen's formula.
 
     The Becker-Coppens procedure is referred to as 'type 1' when
     correcting secondary extinction dominated by the mosaic spread;
     as 'type 2' when secondary extinction is dominated by particle
     size and includes a primary extinction component; and as 'mixed'
     when there are types 1 and 2.
 
     For the Becker-Coppens method it is also necessary to set the
     mosaic distribution as either 'Gaussian' or 'Lorentzian'; and the
     nature of the extinction as 'isotropic' or 'anisotropic'. Note
     that if either the 'mixed' or 'anisotropic' corrections are applied
     the multiple coefficients cannot be contained in the
     _refine_ls.extinction_coef and must be listed in *.special_details.
 
     Ref:  Becker, P. J. & Coppens, P. (1974). Acta Cryst. A30, 129-153.
           Zachariasen, W. H. (1967). Acta Cryst. 23, 558-564.
           Larson, A. C. (1967). Acta Cryst. 23, 664-665.
;
    _name.category_id            refine_ls
    _name.object_id              extinction_method
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case   Zachariasen
                               'B-C type 2 Gaussian isotropic'
     save_
 
 
save_refine_ls.F_calc_details
    _definition.id             '_refine_ls.F_calc_details'
     loop_
    _alias.definition_id       '_refine_ls.F_calc_details'
                               '_refine_ls_F_calc_details'
    _definition.update           2013-01-21
    _description.text
;
     Details concerning the evaluation of the structure factors
     using the expression given in _refine_ls.F_calc_formula.
;
    _name.category_id            refine_ls
    _name.object_id              F_calc_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case 'Gaussian integration using 16 points'
                           ''' Bessel functions expansion up to 5th
                               order. estimated accuracy of Bessel
                               function  better than 0.001 electrons'''
     save_
 
 
save_refine_ls.F_calc_formula
    _definition.id             '_refine_ls.F_calc_formula'
     loop_
    _alias.definition_id       '_refine_ls.F_calc_formula'
                               '_refine_ls_F_calc_formula'
    _definition.update           2013-01-23
    _description.text
;
     Analytical expression used to calculate the structure factors.
;
    _name.category_id            refine_ls
    _name.object_id              F_calc_formula
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     save_
 
 
save_refine_ls.F_calc_precision
    _definition.id             '_refine_ls.F_calc_precision'
     loop_
    _alias.definition_id       '_refine_ls.F_calc_precision'
                               '_refine_ls_F_calc_precision'
    _definition.update           2013-01-21
    _description.text
;
     Estimate of the precision resulting from the numerical
     approximations made during the evaluation of the structure
     factors using the expression _refine_ls.F_calc_formula
     following the method outlined in _refine_ls.F_calc_details.
;
    _name.category_id            refine_ls
    _name.object_id              F_calc_precision
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.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_refine_ls.goodness_of_fit_all
    _definition.id             '_refine_ls.goodness_of_fit_all'
     loop_
    _alias.definition_id       '_refine_ls.goodness_of_fit_all'
                               '_refine_ls_goodness_of_fit_all'
                               '_refine.ls_goodness_of_fit_all'
    _definition.update           2012-11-20
    _description.text
;
     Least-squares goodness-of-fit parameter S for all reflections after
     the final cycle of refinement. Ideally, account should be taken of
     parameters restrained in the least squares.
 
              {  sum { w [ Y(meas) - Y(calc) ]^2^ }  }^1/2^
          S = { ------------------------------------ }
              {            Nref - Nparam             }
 
          Y(meas) = the measured coefficients
                    (see _refine_ls.structure_factor_coef)
          Y(calc) = the calculated coefficients
                    (see _refine_ls.structure_factor_coef)
          w       = the least-squares reflection weight
                    [1/(u^2^)]
          u       = standard uncertainty
          Nref   = the number of reflections used in the refinement
          Nparam = the number of refined parameters
          and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              goodness_of_fit_all
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.goodness_of_fit_all_su
    _definition.id             '_refine_ls.goodness_of_fit_all_su'
     loop_
    _alias.definition_id       '_refine_ls.goodness_of_fit_all_su'
                               '_refine_ls_goodness_of_fit_all_su'
                               '_refine.ls_goodness_of_fit_all_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the Least-squares goodness-of-fit
     parameter S for all reflections after the final cycle of refinement.
;
    _name.category_id            refine_ls
    _name.object_id              goodness_of_fit_all_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.goodness_of_fit_gt
    _definition.id             '_refine_ls.goodness_of_fit_gt'
     loop_
    _alias.definition_id       '_refine_ls.goodness_of_fit_gt'
                               '_refine_ls_goodness_of_fit_gt'
                               '_refine_ls_goodness_of_fit_obs'
                               '_refine.ls_goodness_of_fit_obs'
                               '_refine.ls_goodness_of_fit_gt'
    _definition.update           2012-11-20
    _description.text
;
     Least-squares goodness-of-fit parameter S for significantly
     intense reflections, (i.e. 'observed' reflections with values
     greater-than the threshold set in _reflns.threshold_expression),
     after the final cycle. Ideally, account should be taken of
     parameters restrained in the least-squares refinement.
 
              {  sum { w [ Y(meas_gt) - Y(calc) ]^2^ }  }^1/2^
          S = { --------------------------------------- }
              {           Nref - Nparam                 }
 
          Y(meas_gt)  = the 'observed' coefficients
                    (see _refine_ls.structure_factor_coef)
          Y(calc)     = the calculated coefficients
                    (see _refine_ls.structure_factor_coef)
          w       = the least-squares reflection weight
                    [1/(u^2^)]
          u       = standard uncertainty
          Nref   = the number of reflections used in the refinement
          Nparam = the number of refined parameters
          and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              goodness_of_fit_gt
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.goodness_of_fit_gt_su
    _definition.id             '_refine_ls.goodness_of_fit_gt_su'
     loop_
    _alias.definition_id       '_refine_ls.goodness_of_fit_gt_su'
                               '_refine_ls_goodness_of_fit_gt_su'
                               '_refine.ls_goodness_of_fit_gt_esd'
                               '_refine.ls_goodness_of_fit_obs_esd'
    _definition.update           2012-11-20
    _description.text
;
     Standard Uncertainty of the Least-squares goodness-of-fit
     parameter S for gt reflections after the final cycle of refinement.
;
    _name.category_id            refine_ls
    _name.object_id              goodness_of_fit_gt_su
    _type.purpose                SU
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.goodness_of_fit_ref
    _definition.id             '_refine_ls.goodness_of_fit_ref'
     loop_
    _alias.definition_id       '_refine_ls.goodness_of_fit_ref'
                               '_refine_ls_goodness_of_fit_ref'
                               '_refine.ls_goodness_of_fit_ref'
    _definition.update           2012-11-20
    _description.text
;
     Least-squares goodness-of-fit parameter S for those reflections
     included in the final cycle of refinement. Account should be
     taken of restrained parameters.
 
              {  sum { w [ Y(meas) - Y(calc) ]^2^ }  }^1/2^
          S = { ------------------------------------ }
              {            Nref - Nparam             }
 
          Y(meas) = the measured coefficients
                    (see _refine_ls.structure_factor_coef)
          Y(calc) = the calculated coefficients
                    (see _refine_ls.structure_factor_coef)
          w       = the least-squares reflection weight
                    [1/(u^2^)]
          u       = standard uncertainty
          Nref   = the number of reflections used in the refinement
          Nparam = the number of refined parameters
          and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              goodness_of_fit_ref
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.hydrogen_treatment
    _definition.id             '_refine_ls.hydrogen_treatment'
     loop_
    _alias.definition_id       '_refine_ls.hydrogen_treatment'
                               '_refine_ls_hydrogen_treatment'
                               '_refine.ls_hydrogen_treatment'
    _definition.update           2012-11-20
    _description.text
;
     Code identifying how hydrogen atoms were treated in the refinement.
;
    _name.category_id            refine_ls
    _name.object_id              hydrogen_treatment
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail
      refall  'refined all H-atom parameters'
      refxyz  'refined H-atom coordinates only'
      refU    'refined H-atom U's only'
      noref   'no refinement of H-atom parameters'
      constr  'H-atom parameters constrained'
      hetero
            '''H-atom parameters constrained for H on C, all
               H-atom parameters refined for H on heteroatoms'''
      heteroxyz
            '''H-atom parameters constrained for H on C, refined
               H-atom coordinates only for H on heteroatoms'''
      heteroU
            '''H-atom parameters constrained for H on C, refined
               H-atom U's only for H on heteroatoms'''
      heteronoref
            '''H-atom parameters constrained for H on C, no
               refinement of H-atom parameters for H on heteroatoms'''
      hetero-mixed
            '''H-atom parameters constrained for H on C and some
               heteroatoms, all H-atom parameters refined
               for H on remaining heteroatoms'''
      heteroxyz-mixed
            '''H-atom parameters constrained for H on C and some
               heteroatoms, refined H-atom coordinates only
               for H on remaining heteroatoms'''
      heteroU-mixed
            '''H-atom parameters constrained for H on C and some
               heteroatoms, refined H-atom U's only for H on
               remaining heteroatoms'''
      heteronoref-mixed
            '''H-atom parameters constrained for H on C and some
               heteroatoms, no refinement of H-atom parameters
               for H on remaining heteroatoms'''
      mixed   'some constrained, some independent'
      undef   'H-atom parameters not defined'
    _enumeration.default         undef
     save_
 
 
save_refine_ls.matrix_type
    _definition.id             '_refine_ls.matrix_type'
     loop_
    _alias.definition_id       '_refine_ls.matrix_type'
                               '_refine_ls_matrix_type'
                               '_refine.ls_matrix_type'
    _definition.update           2012-11-20
    _description.text
;
     Code identifying the matrix type used for least-squares derivatives.
;
    _name.category_id            refine_ls
    _name.object_id              matrix_type
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail      full       'full'
                                 fullcycle  'full with fixed elements per cycle'
                                 atomblock  'block diagonal per atom'
                                 userblock  'user-defined blocks'
                                 diagonal   'diagonal elements only'
                                 sparse     'selected elements only'
    _enumeration.default         full
     save_
 
 
save_refine_ls.number_constraints
    _definition.id             '_refine_ls.number_constraints'
     loop_
    _alias.definition_id       '_refine_ls.number_constraints'
                               '_refine_ls_number_constraints'
                               '_refine.ls_number_constraints'
    _definition.update           2012-11-20
    _description.text
;
     Number of constrained (non-refined or dependent) parameters
     in the least-squares process. These may be due to symmetry or any
     other constraint process (e.g. rigid-body refinement). See also
     _atom_site.constraints and _atom_site.refinement_flags. A general
     description of constraints may appear in _refine.special_details.
;
    _name.category_id            refine_ls
    _name.object_id              number_constraints
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           0:
    _enumeration.default         0
     save_
 
 
save_refine_ls.number_parameters
    _definition.id             '_refine_ls.number_parameters'
     loop_
    _alias.definition_id       '_refine_ls.number_parameters'
                               '_refine_ls_number_parameters'
                               '_refine.ls_number_parameters'
    _definition.update           2012-11-20
    _description.text
;
     Number of parameters refined in the least-squares process. If
     possible this number should include the restrained parameters.
     The restrained parameters are distinct from the constrained
     parameters (where one or more parameters are linearly dependent
     on the refined value of another).  Least-squares restraints
     often depend on geometry or energy considerations and this
     makes their direct contribution to this number, and to the
     goodness-of-fit calculation, difficult to assess.
;
    _name.category_id            refine_ls
    _name.object_id              number_parameters
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           0:
     save_
 
 
save_refine_ls.number_reflns
    _definition.id             '_refine_ls.number_reflns'
     loop_
    _alias.definition_id       '_refine_ls.number_reflns'
                               '_refine_ls_number_reflns'
                               '_refine.ls_number_reflns_all'
    _definition.update           2012-11-20
    _description.text
;
     Number of unique reflections used in the least-squares refinement.
;
    _name.category_id            refine_ls
    _name.object_id              number_reflns
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           1:
     save_
 
 
save_refine_ls.number_reflns_gt
    _definition.id             '_refine_ls.number_reflns_gt'
     loop_
    _alias.definition_id       '_refine_ls.number_reflns_gt'
                               '_refine_ls_number_reflns_gt'
                               '_refine.ls_number_reflns_obs'
    _definition.update           2012-11-20
    _description.text
;
     The number of reflections that satisfy the resolution limits
     established by _refine.ls_d_res_high and _refine.ls_d_res_low
     and the observation limit established by
     _reflns.observed_criterion.
;
    _name.category_id            refine_ls
    _name.object_id              number_reflns_gt
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           1:
     save_
 
 
save_refine_ls.number_restraints
    _definition.id             '_refine_ls.number_restraints'
     loop_
    _alias.definition_id       '_refine_ls.number_restraints'
                               '_refine_ls_number_restraints'
                               '_refine.ls_number_restraints'
    _definition.update           2012-11-20
    _description.text
;
     Number of restrained parameters in the least-squares refinement. These
     parameters do not directly dependent on another refined parameter. Often
     restrained parameters involve geometry or energy dependencies. See also
     _atom_site.constraints and _atom_site.refinement_flags. A description
     of refinement constraints may appear in _refine.special_details.
;
    _name.category_id            refine_ls
    _name.object_id              number_restraints
    _type.purpose                Number
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Count
    _enumeration.range           0:
     save_
 
 
save_refine_ls.R_factor_all
    _definition.id             '_refine_ls.R_factor_all'
     loop_
    _alias.definition_id       '_refine_ls.R_factor_all'
                               '_refine_ls_R_factor_all'
                               '_refine.ls_R_factor_all'
    _definition.update           2014-04-17
    _description.text
;
     Residual factor for all reflections satisfying the resolution limits
     specified by _refine_ls.d_res_high and _refine_ls.d_res_low. This is
     the conventional R factor. See also wR factor definitions.
 
                   sum | F(meas) - F(calc) |
               R = ------------------------
                         sum | F(meas) |
 
               F(meas) = the measured structure-factor amplitudes
               F(calc) = the calculated structure-factor amplitudes
               and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              R_factor_all
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     loop_
    _method.purpose
    _method.expression
                                Evaluation
;
      sumFdiff  =   0.
      sumFmeas  =   0.
      Loop r  as  refln  {
                    sumFdiff  +=   Abs(r.F_calc - r.F_meas)
                    sumFmeas  +=   Abs(r.F_meas)
                         }
          _refine_ls.R_factor_all  =   sumFdiff / sumFmeas
;
     save_
 
 
save_refine_ls.R_factor_gt
    _definition.id             '_refine_ls.R_factor_gt'
     loop_
    _alias.definition_id       '_refine_ls.R_factor_gt'
                               '_refine_ls_R_factor_obs'
                               '_refine_ls_R_factor_gt'
                               '_refine.ls_R_factor_obs'
                               '_refine.ls_R_factor_gt'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor for the reflections judged significantly intense
     (see _reflns.number_gt and _reflns.threshold_expression) and included
     in the refinement. The reflections also satisfy the resolution limits
     specified by _refine_ls.d_res_high and _refine_ls.d_res_low. This is
     the conventional R factor.
 
                   sum | F(meas_gt) - F(calc) |
               R = -----------------------------
                         sum | F(meas_gt) |
 
               F(meas_gt) = the 'observed' structure-factor amplitudes
               F(calc)    = the calculated structure-factor amplitudes
               and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              R_factor_gt
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.R_Fsqd_factor
    _definition.id             '_refine_ls.R_Fsqd_factor'
     loop_
    _alias.definition_id       '_refine_ls.R_Fsqd_factor'
                               '_refine_ls_R_Fsqd_factor'
                               '_refine.ls_R_Fsqd_factor_obs'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor R(Fsqd), calculated on the squared amplitudes of the
     measured and calculated structure factors, for significantly intense
     reflections (satisfying _reflns.threshold_expression) and included in
     the refinement. The reflections also satisfy the resolution limits
     specified by _refine_ls.d_res_high and _refine_ls.d_res_low.
 
                          sum | F(meas_gt)^2^ - F(calc)^2^ |
               R(Fsqd) = ------------------------------------
                                  sum F(meas_gt)^2^
 
               F(meas_gt)^2^ = squares of the 'observed' structure-factor
               F(calc)^2^    = squares of the calculated structure-factor
               and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              R_Fsqd_factor
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.R_I_factor
    _definition.id             '_refine_ls.R_I_factor'
     loop_
    _alias.definition_id       '_refine_ls.R_I_factor'
                               '_refine_ls_R_I_factor'
                               '_refine.ls_R_I_factor_obs'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor R(I) for significantly intense reflections (satisfying
     _reflns.threshold_expression) and included in the refinement. This is
     most often calculated in Rietveld refinements of powder data, where it
     is referred to as R~B~ or R~Bragg~.
 
                       sum | I(meas_gt) - I(calc) |
               R(I) =  -----------------------------
                              sum | I(meas_gt) |
 
               I(meas_gt) = the net 'observed' intensities
               I(calc)    = the net calculated intensities
               and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              R_I_factor
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.restrained_S_all
    _definition.id             '_refine_ls.restrained_S_all'
     loop_
    _alias.definition_id       '_refine_ls.restrained_S_all'
                               '_refine_ls_restrained_S_all'
                               '_refine.ls_restrained_S_all'
    _definition.update           2012-11-20
    _description.text
;
     Least-squares goodness-of-fit parameter S' for all reflections after
     the final cycle of least squares. This parameter explicitly includes
     the restraints applied in the least-squares process. See also
     _refine_ls.goodness_of_fit_all definition.
 
            {sum { w [ Y(meas) - Y(calc) ]^2^ }                  }^1/2^
            {         + sum~r~ { w~r~ [ P(calc) - P(targ) ]^2^ } }
       S' = { -------------------------------------------------- }
            {            N~ref~ + N~restr~ - N~param~            }
 
               Y(meas)  = the measured coefficients
                          (see _refine_ls.structure_factor_coef)
               Y(calc)  = the calculated coefficients
                          (see _refine_ls.structure_factor_coef)
               w        = the least-squares reflection weight
                          [1/square of standard uncertainty (e.s.d.)]
               P(calc)  = the calculated restraint values
               P(targ)  = the target restraint values
               w~r~     = the restraint weight
 
               N~ref~   = the number of reflections used in the refinement
                        (see _refine_ls.number_reflns)
               N~restr~ = the number of restraints
                        (see _refine_ls.number_restraints)
               N~param~ = the number of refined parameters
                        (see _refine_ls.number_parameters)
 
               sum     is taken over the specified reflections
               sum~r~  is taken over the restraints
;
    _name.category_id            refine_ls
    _name.object_id              restrained_S_all
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.restrained_S_gt
    _definition.id             '_refine_ls.restrained_S_gt'
     loop_
    _alias.definition_id       '_refine_ls.restrained_S_gt'
                               '_refine_ls_restrained_S_obs'
                               '_refine_ls_restrained_S_gt'
                               '_refine.ls_restrained_S_obs'
    _definition.update           2012-11-20
    _description.text
;
     Least-squares goodness-of-fit parameter S' for significantly intense
     reflections (satisfying _reflns.threshold_expression) after the final
     cycle of least squares. This parameter explicitly includes the restraints
     applied. The expression for S' is given in _refine_ls.restrained_S_all.
 
            {sum { w [ Y(meas_gt) - Y(calc) ]^2^ }               }^1/2^
            {         + sum~r~ { w~r~ [ P(calc) - P(targ) ]^2^ } }
       S' = { -------------------------------------------------- }
            {            N~ref~ + N~restr~ - N~param~            }
 
               Y(meas_gt) = the 'observed' coefficients
                          (see _refine_ls.structure_factor_coef)
               Y(calc)    = the calculated coefficients
                          (see _refine_ls.structure_factor_coef)
               w        = the least-squares reflection weight
                          [1/square of standard uncertainty (e.s.d.)]
               P(calc)  = the calculated restraint values
               P(targ)  = the target restraint values
               w~r~     = the restraint weight
 
               N~ref~   = the number of reflections used in the refinement
                        (see _refine_ls.number_reflns)
               N~restr~ = the number of restraints
                        (see _refine_ls.number_restraints)
               N~param~ = the number of refined parameters
                        (see _refine_ls.number_parameters)
 
               sum     is taken over the specified reflections
               sum~r~  is taken over the restraints
;
    _name.category_id            refine_ls
    _name.object_id              restrained_S_gt
    _type.purpose                Measurand
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.shift_over_su_max
    _definition.id             '_refine_ls.shift_over_su_max'
     loop_
    _alias.definition_id       '_refine_ls.shift_over_su_max'
                               '_refine_ls_shift_over_su_max'
                               '_refine.ls_shift_over_esd_max'
                               '_refine.ls_shift_over_su_max'
                               '_refine_ls_shift/su_max'
                               '_refine_ls_shift/esd_max'
    _definition.update           2012-11-20
    _description.text
;
     The largest ratio of the final least-squares parameter shift
     to the final standard uncertainty (s.u., formerly described
     as estimated standard deviation, e.s.d.).
;
    _name.category_id            refine_ls
    _name.object_id              shift_over_su_max
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.shift_over_su_max_lt
    _definition.id             '_refine_ls.shift_over_su_max_lt'
     loop_
    _alias.definition_id       '_refine_ls.shift_over_su_max_lt'
                               '_refine_ls_shift/su_max_lt'
                               '_refine.ls_shift_over_su_max_lt'
    _definition.update           2012-12-11
    _description.text
;
     Upper limit for the largest ratio of the final l-s parameter
     shift divided by the final standard uncertainty. This item is
     used when the largest value of the shift divided by the final
     standard uncertainty is too small to measure.
;
    _name.category_id            refine_ls
    _name.object_id              shift_over_su_max_lt
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.shift_over_su_mean
    _definition.id             '_refine_ls.shift_over_su_mean'
     loop_
    _alias.definition_id       '_refine_ls.shift_over_su_mean'
                               '_refine_ls_shift_over_su_mean'
                               '_refine.ls_shift_over_esd_mean'
                               '_refine.ls_shift_over_su_mean'
                               '_refine_ls_shift/su_mean'
                               '_refine_ls_shift/esd_mean'
    _definition.update           2012-11-20
    _description.text
;
     The average ratio of the final least-squares parameter shift
     to the final standard uncertainty (s.u., formerly described
     as estimated standard deviation, e.s.d.).
;
    _name.category_id            refine_ls
    _name.object_id              shift_over_su_mean
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.shift_over_su_mean_lt
    _definition.id             '_refine_ls.shift_over_su_mean_lt'
     loop_
    _alias.definition_id       '_refine_ls.shift_over_su_mean_lt'
                               '_refine_ls_shift/su_mean_lt'
                               '_refine.ls_shift_over_su_mean_lt'
    _definition.update           2012-12-11
    _description.text
;
     Upper limit for the average ratio of the final l-s parameter
     shift divided by the final standard uncertainty. This item is
     used when the average value of the shift divided by the final
     standard uncertainty is too small to measure.
;
    _name.category_id            refine_ls
    _name.object_id              shift_over_su_mean_lt
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.structure_factor_coef
    _definition.id             '_refine_ls.structure_factor_coef'
     loop_
    _alias.definition_id       '_refine_ls.structure_factor_coef'
                               '_refine_ls_structure_factor_coef'
                               '_refine.ls_structure_factor_coef'
    _definition.update           2012-11-20
    _description.text
;
     Structure-factor coefficient used in the least-squares process.
;
    _name.category_id            refine_ls
    _name.object_id              structure_factor_coef
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail      F      'structure factor magnitude'
                                 Fsqd   'structure factor squared'
                                 Inet   'net intensity'
    _enumeration.default         F
     save_
 
 
save_refine_ls.weighting_details
    _definition.id             '_refine_ls.weighting_details'
     loop_
    _alias.definition_id       '_refine_ls.weighting_details'
                               '_refine_ls_weighting_details'
                               '_refine.ls_weighting_details'
    _definition.update           2012-11-20
    _description.text
;
     Description of special aspects of the weighting scheme used in the
     least-squares refinement. Used to describe the weighting when the
     value of _refine_ls.weighting_scheme is specified as 'calc'.
;
    _name.category_id            refine_ls
    _name.object_id              weighting_details
    _type.purpose                Describe
    _type.source                 Recorded
    _type.container              Single
    _type.contents               Text
     loop_
    _description_example.case
;
        Sigdel model of Konnert-Hendrickson:
         Sigdel = Afsig +  Bfsig*(sin(\q)/\l - 1/6)
         Afsig  = 22.0, Bfsig = 150.0 at the beginning of refinement.
         Afsig  = 16.0, Bfsig =  60.0 at the end of refinement.
;
     save_
 
 
save_refine_ls.weighting_scheme
    _definition.id             '_refine_ls.weighting_scheme'
     loop_
    _alias.definition_id       '_refine_ls.weighting_scheme'
                               '_refine_ls_weighting_scheme'
                               '_refine.ls_weighting_scheme'
    _definition.update           2012-11-20
    _description.text
;
     General description of the weighting scheme used in the least-squares.
     An enumerated code should be contained in this description.
;
    _name.category_id            refine_ls
    _name.object_id              weighting_scheme
    _type.purpose                State
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _enumeration_set.state
    _enumeration_set.detail      sigma    "based on measured s.u.'s"
                                 unit     'unit or no weights applied'
                                 calc     'calculated weights applied'
    _enumeration.default         sigma
     save_
 
 
save_refine_ls.wR_factor_all
    _definition.id             '_refine_ls.wR_factor_all'
     loop_
    _alias.definition_id       '_refine_ls.wR_factor_all'
                               '_refine_ls_wR_factor_all'
                               '_refine.ls_wR_factor_all'
    _definition.update           2012-11-20
    _description.text
;
     Weighted residual factors for all reflections satisfying the resolution
     limits specified by _refine_ls.d_res_high and _refine_ls.d_res_low.
     See also the _refine_ls.R_factor_all definition.
 
            ( sum w [ Y(meas) - Y(calc) ]^2^ )^1/2^
       wR = ( ------------------------------ )
            (         sum w Y(meas)^2^       )
 
       Y(meas) = the measured   amplitude _refine_ls.structure_factor_coef
       Y(calc) = the calculated amplitude _refine_ls.structure_factor_coef
       w       = the least-squares weight
       and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              wR_factor_all
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.wR_factor_gt
    _definition.id             '_refine_ls.wR_factor_gt'
     loop_
    _alias.definition_id       '_refine_ls.wR_factor_gt'
                               '_refine_ls_wR_factor_obs'
                               '_refine.ls_wR_factor_obs'
                               '_refine_ls_wR_factor_gt'
    _definition.update           2012-11-20
    _description.text
;
     Weighted residual factors for significantly intense reflections
     (satisfying @reflns_threshold_expression) included in the refinement.
     The reflections must also satisfy the resolution limits established by
     _refine_ls.d_res_high and _refine_ls.d_res_low.
 
            ( sum w [ Y(meas_gt) - Y(calc) ]^2^  )^1/2^
       wR = ( ---------------------------------- )
            (         sum w Y(meas_gt)^2^        )
 
     Y(meas_gt) = the 'observed' amplitude _refine_ls.structure_factor_coef
     Y(calc)    = the calculated amplitude _refine_ls.structure_factor_coef
       w       = the least-squares weight
       and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              wR_factor_gt
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls.wR_factor_ref
    _definition.id             '_refine_ls.wR_factor_ref'
     loop_
    _alias.definition_id       '_refine_ls.wR_factor_ref'
                               '_refine_ls_wR_factor_ref'
    _definition.update           2012-11-20
    _description.text
;
     Weighted residual factors for reflections included in the refinement
     which satisfy the limits specified by _refine_ls.d_res_high and
     _refine_ls.d_res_low.
 
            ( sum w [ Y(meas) - Y(calc) ]^2^ )^1/2^
       wR = ( ------------------------------ )
            (         sum w Y(meas)^2^       )
 
       Y(meas) = the measured   amplitude _refine_ls.structure_factor_coef
       Y(calc) = the calculated amplitude _refine_ls.structure_factor_coef
       w       = the least-squares weight
       and the sum is taken over the specified reflections
;
    _name.category_id            refine_ls
    _name.object_id              wR_factor_ref
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
#----------------------------------------------------------------------------
 
save_REFINE_LS_CLASS
 
    _definition.id               REFINE_LS_CLASS
    _definition.scope            Category
    _definition.class            Loop
    _definition.update           2013-09-08
    _description.text
;
     The CATEGORY of data items used to specify information about the
     refinement of the structural model.
;
    _name.category_id            REFINE_LS
    _name.object_id              CLASS
    _category.key_id           '_refine_ls_class.key'
    _category.key_list        ['_refine_ls_class.code']
 
 
save_refine_ls_class.key
    _definition.id             '_refine_ls_class.key'
     loop_
    _alias.definition_id       '_refine_ls_class.key'
    _definition.update           2012-11-20
    _description.text
;
     Value is a unique key to a set of REFINE_LS_CLASS items
     in a looped list.
;
    _name.category_id            refine_ls_class
    _name.object_id              key
    _type.purpose                Key
    _type.source                 Related
    _type.container              Single
    _type.contents               Implied
     loop_
    _method.purpose
    _method.expression
     Definition
;              _type.contents = Type_Contents(refine_ls_class.code)
;
     Evaluation
;              _refine_ls_class.key = _refine_ls_class.code
;
     save_
 
 
save_refine_ls_class.code
    _definition.id             '_refine_ls_class.code'
     loop_
    _alias.definition_id       '_refine_ls_class.code'
                               '_refine_ls_class_code'
    _definition.update           2012-11-20
    _description.text
;
     Code identifying a certain reflection class.
;
    _name.category_id            refine_ls_class
    _name.object_id              code
    _name.linked_item_id       '_reflns_class.code'
    _type.purpose                Link
    _type.source                 Related
    _type.container              Single
    _type.contents               Code
     loop_
    _description_example.case   '1'  'm1'   's2'
     save_
 
 
save_refine_ls_class.d_res_high
    _definition.id             '_refine_ls_class.d_res_high'
     loop_
    _alias.definition_id       '_refine_ls_class.d_res_high'
                               '_refine_ls_class_d_res_high'
    _definition.update           2012-11-20
    _description.text
;
     Highest resolution for the reflections in this class.
     This corresponds to the smallest interpanar d value.
;
    _name.category_id            refine_ls_class
    _name.object_id              d_res_high
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstroms
     save_
 
 
save_refine_ls_class.d_res_low
    _definition.id             '_refine_ls_class.d_res_low'
     loop_
    _alias.definition_id       '_refine_ls_class.d_res_low'
                               '_refine_ls_class_d_res_low'
    _definition.update           2012-11-20
    _description.text
;
     Lowest resolution for the reflections in this class.
     This corresponds to the largest interpanar d value.
;
    _name.category_id            refine_ls_class
    _name.object_id              d_res_low
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  angstroms
     save_
 
 
save_refine_ls_class.R_factor_all
    _definition.id             '_refine_ls_class.R_factor_all'
     loop_
    _alias.definition_id       '_refine_ls_class.R_factor_all'
                               '_refine_ls_class_R_factor_all'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor for reflections in this class included in the
     refinement.  See _refine_ls.R_factor_all definition for details.
;
    _name.category_id            refine_ls_class
    _name.object_id              R_factor_all
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls_class.R_factor_gt
    _definition.id             '_refine_ls_class.R_factor_gt'
     loop_
    _alias.definition_id       '_refine_ls_class.R_factor_gt'
                               '_refine_ls_class_R_factor_gt'
                               '_refine_ls_class_R_factor_obs'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor for the reflections in this class judged
     significantly intense (see _reflns.threshold_expression) and
     included in refinement. See _refine_ls.R_factor_gt for details.
;
    _name.category_id            refine_ls_class
    _name.object_id              R_factor_gt
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls_class.R_Fsqd_factor
    _definition.id             '_refine_ls_class.R_Fsqd_factor'
     loop_
    _alias.definition_id       '_refine_ls_class.R_Fsqd_factor'
                               '_refine_ls_class_R_Fsqd_factor'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor R(F^2^) for reflections in this class judged
     significantly intense (see _reflns.threshold_expression) and
     included in refinement. See _refine_ls.R_Fsqd_factor for details.
;
    _name.category_id            refine_ls_class
    _name.object_id              R_Fsqd_factor
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls_class.R_I_factor
    _definition.id             '_refine_ls_class.R_I_factor'
     loop_
    _alias.definition_id       '_refine_ls_class.R_I_factor'
                               '_refine_ls_class_R_I_factor'
    _definition.update           2012-11-20
    _description.text
;
     Residual factor R(I) for reflections in this class judged
     significantly intense (see _reflns.threshold_expression) and
     included in refinement. See _refine_ls.R_I_factor for details.
;
    _name.category_id            refine_ls_class
    _name.object_id              R_I_factor
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
 
save_refine_ls_class.wR_factor_all
    _definition.id             '_refine_ls_class.wR_factor_all'
     loop_
    _alias.definition_id       '_refine_ls_class.wR_factor_all'
                               '_refine_ls_class_wR_factor_all'
    _definition.update           2012-11-20
    _description.text
;
     Weight residual for all reflections in this class judged
     significantly intense (see _reflns.threshold_expression) and
     included in refinement. See _refine_ls.wR_factor_all for details.
;
    _name.category_id            refine_ls_class
    _name.object_id              wR_factor_all
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Real
    _enumeration.range           0.0:
    _units.code                  none
     save_
 
     save_    #------ close REFINE_LS_CLASS category
 
     save_    #------ close REFINE_LS category
 
     save_    #------ close REFINE category
 
     save_    #------ close STRUCTURE category
 
 
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 
save_FUNCTION
    _definition.id               FUNCTION
    _definition.scope            Category
    _definition.class            Functions
    _definition.update           2012-12-18
    _description.text
;
    The crystallographic functions the invoked in the definition
    methods of CORE STRUCTURE data items defined and used with in
    the Crystallographic Information Framework (CIF).
;
    _name.category_id            CIF_CORE
    _name.object_id              FUNCTION
 
#============================================================================
 
 
save_function.AtomType
    _definition.id              '_function.AtomType'
    _definition.update           2013-04-17
    _description.text
;
     The function
                   r  =  AtomType( s )
 
     returns an atom type symbol (element name) from the atom site label.
;
    _name.category_id            function
    _name.object_id              AtomType
    _type.purpose                Encode
    _type.source                 Assigned
    _type.container              Single
    _type.contents               Code
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function AtomType( s :[Single, Code])  {  # atom label
 
        m = Len(s)
        n = 1
        If (m > 1 and s[1] not in '0123456789') n = 2
        If (m > 2 and s[2]     in '+-'        ) n = 3
        If (m > 3 and s[3]     in '+-'        ) n = 4
 
                 AtomType =  s[0:n]
     }
;
    save_
 
 
save_function.Closest
    _definition.id              '_function.Closest'
    _definition.update           2012-10-16
    _description.text
;
     The function
                   u, d  =  Closest( v, u )
 
     returns the real coordinate vector U which is the closest cell-
     translated occurence of the vector V to the vector W.  D is the
     cell translation vector required to move V to U.
;
    _name.category_id            function
    _name.object_id              Closest
    _type.purpose                Number
    _type.source                 Derived
    _type.container              List
    _type.contents              'Matrix(Real,Real,Real)'
    _type.dimension              [2]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function Closest( v :[Matrix, Real],   # coord vector to be cell translated
                       w :[Matrix, Real]) { # target vector
 
            d  =  v - w
            t  =  Int( Mod( 99.5 + d, 1.0 ) - d )
 
            Closest = List ( v+t, t )
     }
;
    save_
 
 
save_function.SeitzFromJones
    _definition.id              '_function.SeitzFromJones'
    _definition.update           2013-04-24
    _description.text
;
     The function
                   s  =  SeitzFromJones( j )
 
     returns a 4x4 Seitz matrix from the Jones faithful representation of
     the equivalent position which is a character string e.g. 1/2+x,-x,z.
;
    _name.category_id            function
    _name.object_id              SeitzFromJones
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [4,4]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function SeitzFromJones( j :[Single, Text])  { # Jones symmetry notation
 
      joneschrs = "123456xyz/,+- "
      s         = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,1]]
      axis      = 0
      sign      = 1
      inum      = 0
 
      do i=0,Len(j)-1    {
          c = j[i]
          If (c not in joneschrs) print 'illegal char in symmetry xyz'
 
          If      (c == ' ') Next
          If      (c == ',') {
                             axis     += 1
                             inum      = 0
                             sign      = 1
          }
          Else If (c == '+') sign      = +1
          Else If (c == '-') sign      = -1
          Else If (c == 'x') s[axis,0] = sign
          Else If (c == 'y') s[axis,1] = sign
          Else If (c == 'z') s[axis,2] = sign
          Else   {
               If (inum == 0)   m  = AtoI(c)
               If (inum == 1 and c != '/') print 'illegal num in symmetry xyz'
               If (inum == 2)   {
                                n  = AtoI(c)
                     If(n == 5) print 'illegal translation in symmetry xyz'
                     s[axis,3] = Mod(10.+ Float(sign*m)/Float(n), 1.)
                     sign      = 1
               }
               inum += 1
       }  }
                          SeitzFromJones = s
    }
;
    save_
 
 
save_function.SymEquiv
    _definition.id              '_function.SymEquiv'
    _definition.update           2014-04-17
    _description.text
;
     The function
                     xyz' =  SymEquiv( symop, xyz )
 
     returns a fractional coordinate vector xyz' which is input vector
     xyz transformed by the input symop 'n_pqr' applied to the symmetry
     equivalent matrix extracted from the category symmetry_equiv.
;
    _name.category_id            function
    _name.object_id              SymEquiv
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Real
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function SymEquiv( c :[Single, Symop],    # symop string n_pqr
                        x :[Matrix, Real]   ){  # fract coordinate vector
 
             s = symmetry_equiv [ SymKey( c ) ]
             SymEquiv = s.R * x + s.T + SymLat( c )
     }
;
    save_
 
 
save_function.SymKey
    _definition.id              '_function.SymKey'
    _definition.update           2012-12-17
    _description.text
;
     The function
                   m  =  SymKey( s )
 
     returns an integer index to the Seitz matrices from the character
     string of the form 'n_pqr'.
;
    _name.category_id            function
    _name.object_id              SymKey
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Single
    _type.contents               Index
    _enumeration.range           1:192
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function SymKey( s :[Single, Symop])  {  # symop string
 
            If (s == '.')   n = 1
            Else            n = AtoI(s[0])
 
                 SymKey =  n       # index from 1
     }
;
    save_
 
 
save_function.SymLat
    _definition.id              '_function.SymLat'
    _definition.update           2013-03-10
    _description.text
;
     The function
                   v  =  SymLat( s )
 
     returns a vector of the cell translations applied to the coordinates
     from the character string of the form 'n_pqr'. i.e. p-5, q-5, r-5.
;
    _name.category_id            function
    _name.object_id              SymLat
    _type.purpose                Number
    _type.source                 Derived
    _type.container              Matrix
    _type.contents               Integer
    _type.dimension              [3]
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function SymLat( s :[Single, Symop])  {  # symop string
 
##########  If (s[1] == ' ')  v = [ 5, 5, 5 ]
            If (s[0] == ' ')  v = [ 5, 5, 5 ]
            Else              v = [ AtoI(s[2]), AtoI(s[3]), AtoI(s[4]) ]
 
                  SymLat  =  v - 5
     }
;
    save_
 
 
save_function.Symop
    _definition.id              '_function.Symop'
    _definition.update           2006-06-30
    _description.text
;
     The function
                   s  =  Symop( n, t )
 
     returns a character string of the form 'n_pqr' where n is the
     symmetry equivalent site number and [p,q,r] is the cell translation
     vector PLUS [5,5,5].
;
    _name.category_id            function
    _name.object_id              Symop
    _type.purpose                Composite
    _type.source                 Derived
    _type.container              Single
    _type.contents               Symop
     loop_
    _method.purpose
    _method.expression
     Evaluation
;
     Function Symop( n  :[Single, Integer],   # symmetry equivalent site number
                     t  :[List  , Integer]) { # cell translation vector
 
            d  =  t + 5
         Symop =  `n` + '_' + `d[0]` + `d[1]` + `d[2]`
     }
;
    save_
 
    save_   #----------- close of FUNCTION category
 
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
    save_   #----------- close of CIF_CORE category
 
#----- eof ----- eof ----- eof ----- eof ----- eof ----- eof ----- eof ----- eof
