\(\renewcommand\AA{\unicode{x212B}}\)

SaveINS v1

Summary

Saves .ins input file for SHELX single-crystal refinement.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

Workspace

Mandatory

The name of the workspace from which to extract the information required for the .ins file. Note the workspace must have an oriented lattice/UB and a sample materialset (see SetSample for details).

Filename

Input

string

Mandatory

File with the data from a phonon calculation.

Spacegroup

Input

string

Spacegroup Hermann–Mauguin symbol - if not specified then the spacegroup will be taken from the CrystalStructure stored in the workspace. If a spacegroup is provided it will be used in preference to the spacegroup in the CrystalStructre.

UseNaturalIsotopicAbundances

Input

boolean

True

If True the scattering lengths will not be explicitly output and SHELX will use the weighted mean values for natural isotopic abundances. If False the scattering lengths stored in the sample material will be output - in this case mantid will set the covalent radii to be 0, the user will need to edit the file before performing a refinement in SHELX.

Description

Function to save a .ins file - one of the input files required for the SHELX crystallographic code. The file contains information about the sample (spacegroup, lattice parameters and atoms present) and the format of the reflections file.

The InputWorkspace must have a UB set (from which the lattice parameters are retrieved) and a sample material (from which the atoms and number of formula units are taken). The spacegroup can be taken given as an input argument to the function, or from the crystal structure if one has been set on the workspace.

By default it is assumed that atoms have a ratio of isotopes seen in nature, however if UseNaturalIsotopicAbundances=False the scattering cross-sections defined for the isotopes specified in the sample material will be used. In this case there are other atomic properties that are output, one of these is the covalent radius (which SHELX uses for the purposes of outputting bonds/geometry information) which is set to be 1 Angstrom (if UseNaturalIsotopicAbundances=True SHELX will look up the covalent radii of atoms itself).

Usage

Example:

from mantid.simpleapi import *

ws = CreateSampleWorkspace(OutputWorkspace='ws', NumBanks=1, BankPixelWidth=1, BinWidth=20000)  # 1 bin
SetUB(Workspace=ws, a=7.6508, b=13.2431, c=11.6243, alpha=90, beta=104.1183, gamma=90)
ndensity = 4 / ws.sample().getOrientedLattice().volume()  # number density with 4 formula units per u.c
SetSample(InputWorkspace=self.ws, Material={'ChemicalFormula': 'C12 H9 N3 O2 S1',
          'SampleNumberDensity': ndensity})
SaveINS(InputWorkspace=self.ws, Filename='SHELX.ins', Spacegroup='P 1 21/n 1', UseNaturalIsotopicAbundances=True)

Categories: AlgorithmIndex | DataHandling\Text | Crystal\DataHandling

Source

Python: SaveINS.py