CFML_Reflections

This module provides types and procedures to construct and operate with list of Bragg reflections.

Dictionaries

refl_type

Base dictionary for representing a Bragg reflection.

Keys and types:

  • h (ndarray, dim=(:), int32): Miller index.

  • imag (integer): 0: nuclear, 1: magnetic, 2: nuclear + magnetic.

  • mult (integer): multiplicity.

  • pcoeff (integer): pointer to the harmonic q_coeff.

  • s (float): sin(theta) / lambda.

srefl_type

Extension of refl_type, adds the structure factor.

Keys and types:

  • a (float): real part of the structure factor.

  • b (float): imaginary part of the structure factor.

  • fc (float): calculated structure factor.

  • fo (float): observed structure factor.

  • iph (integer): index of the crystallographic phase.

  • phase (float): phase of the structure factor, in degrees.

  • sfo (float): sigma of fo.

  • w (float): weight factor.

mrefl_type

Extension of srefl_type, describes a magnetic reflection.

Keys and types:

  • miv (ndarray, dim=(3), complex): magnetic interaction vector.

  • mivo (float): observed modulus of the magnetic interaction vector.

  • msf (ndarray, dim=(3), complex): magnetic structure factor.

  • mivo (float): sigma of observed modulus of the magnetic interaction vector.

reflist_type

List of reflections.

Keys and types:

Functions

generate_reflections(cell, slmin, slmax, spg, **kwargs)

Generates a list of reflections from a given cell and space group in the range defined by slmin and slmax. Object cell is created by calling (set_crystal_cell). Object spg is created by calling (set_spacegroup_from_dbase).

Parameters:
  • cell (dict (cell_g_type)) – the crystal cell.

  • slmin (float.) – Minimum value of sin(theta) / lambda.

  • slmax (float.) – Maximum value of sin(theta) / lambda.

  • spg (dict (spg_type or superspacegroup_type)) – the space group.

  • kwargs['friedel'] (bool) – if True, apply Friedel’s law. Defaul value: True.

  • kwargs['hlim'] (ndarray, dim=(3,2), type=np.int32) – h,k,l limits.

  • kwargs['mag_only'] (bool) – if True, only magnetic reflections are generated. Default value: False.

  • kwargs['order'] (bool) – if True, reflections ordered by increasing sin(theta) / lambda. Default value: False.

  • kwargs['seqindx'] (ndarray, dim=(3), type=np.int32) – sequence in which index changes in the reflection list. [3,2,1] indicates l changes first, then k, finally h.

  • kwargs['unique'] (bool) – if given, unique reflections are generated.

  • kwargs['ref_typ'] (str.) – type of the returned dictionary. It can be refl or srefl or mrefl. Default value: ‘refl’.

Returns:

reflection list.

Return type:

dict (refl_type or srefl_type or mrefl_type)

>>> from pycrysfml import cfml_metrics
>>> from pycrysfml import cfml_gspacegroups
>>> from pycrysfml import cfml_reflections
>>> import numpy as np
>>> vcell = np.array([4.0,5.0,6.0],dtype=np.float32)
>>> vang = np.array([90.0,90.0,90.0],dtype=np.float32)
>>> cell = cfml_metrics.set_cell(vcell,vang)
>>> sg = cfml_gspacegroups.set_spacegroup_from_dbase("P222","shubn")
>>> ref = cfml_reflections.generate_reflections(cell,0.0,0.6,sg,order=True)
>>> ref['nref']
868
>>> ref['ref'][0]
{'fortran_type': 'refl_type', 'h': array([ 0,  0, -1], dtype=int32), 'mult': 2, 's': 0.0833333358168602, 'imag': 0, 'pcoeff': 0}