{ "cells": [ { "cell_type": "markdown", "id": "7824f861", "metadata": {}, "source": [ "# Tensor scattering simulation examples\n" ] }, { "cell_type": "markdown", "id": "4b05f5ce", "metadata": {}, "source": [ "### Run standard test (no CIF file)" ] }, { "cell_type": "code", "execution_count": null, "id": "5818469c", "metadata": {}, "outputs": [], "source": [ "run 'TensorScatteringClass'" ] }, { "cell_type": "markdown", "id": "abb13819", "metadata": {}, "source": [ "### Example simulation (needs CIF file)" ] }, { "cell_type": "code", "execution_count": null, "id": "48bc8712", "metadata": {}, "outputs": [], "source": [ "import TensorScatteringClass as ten\n", "import numpy as np\n", "#cifpath = '/home/spc93/spc_cifs/'\n", "cifpath = ''\n", "ciffile=cifpath+'MnF2.cif'\n", "en = MnK = 6.539\n", "t=ten.TensorScatteringClass(CIFfile=ciffile, Site='Mn1');\n", "\n", "#non-resonant magnetic scattering and resonant scattering \n", "\n", "hkln = hkln=np.array([1,0,0])\n", "for ref in [[0,0,3], [0,3,0], [0,2,3], [0,3,2]]:\n", " ref = np.array(ref)\n", " t.PlotIntensityInPolarizationChannels('NonResMag', lam=12.4/en, hkl = ref, hkln = hkln, lk=np.array([0,0,0]), sk=np.array([0,0,1]), sigmapi='sigma'); print('=== tth: %.2f deg' % (t.theta * 2 *180./np.pi))\n", " t.PlotIntensityInPolarizationChannels('E1E1', lam=12.4/en, hkl = ref, hkln = hkln, K=2, Time=1, Parity=1, mk=None, lk=None, sk=None, sigmapi='sigma'); print('=== tth: %.2f deg' % (t.theta * 2 *180./np.pi))\n", " t.print_tensors()" ] }, { "cell_type": "code", "execution_count": null, "id": "1d43a09c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "606d1561", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3.7 [DLS Conda]", "language": "python", "name": "conda-env-DLS_Conda-python3.7-kernel.json" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 5 }