{ "cells": [ { "cell_type": "markdown", "id": "89ae8342-d7e0-465e-885e-3e56082f8575", "metadata": {}, "source": [ "# **hkl_soleil** E4CV with EPICS motors\n", " \n", "Following the **hkl_soleil** [E4CV](hkl_soleil-e4cv.ipynb) example, show how to\n", "setup the same diffractometer with EPICS motor PVs. For reference, Simulated\n", "motors are used with this setup:\n", "\n", "```python\n", "fourc = hklpy2.creator(name=\"fourc\", geometry=\"E4CV\", solver=\"hkl_soleil\")\n", "```\n", "\n", "To define EPICS PVs for each real axis, supply a Python dictionary. They keys\n", "are the motor names, values are the EPICS PV. (If supplying a prefix to the\n", "``creator``, don't include it with each motor PV.)." ] }, { "cell_type": "code", "execution_count": 3, "id": "b6f15454-7d0d-418a-bef4-89be51a26cf1", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "Hklpy2Diffractometer(prefix='gp:', name='fourc', settle_time=0.0, timeout=None, egu='', limits=(0, 0), source='computed', read_attrs=['h', 'h.readback', 'h.setpoint', 'k', 'k.readback', 'k.setpoint', 'l', 'l.readback', 'l.setpoint', 'omega', 'omega.user_readback', 'omega.user_setpoint', 'chi', 'chi.user_readback', 'chi.user_setpoint', 'phi', 'phi.user_readback', 'phi.user_setpoint', 'tth', 'tth.user_readback', 'tth.user_setpoint'], configuration_attrs=['geometry', 'solver', 'wavelength', 'h', 'k', 'l', 'omega', 'omega.user_offset', 'omega.user_offset_dir', 'omega.velocity', 'omega.acceleration', 'omega.motor_egu', 'chi', 'chi.user_offset', 'chi.user_offset_dir', 'chi.velocity', 'chi.acceleration', 'chi.motor_egu', 'phi', 'phi.user_offset', 'phi.user_offset_dir', 'phi.velocity', 'phi.acceleration', 'phi.motor_egu', 'tth', 'tth.user_offset', 'tth.user_offset_dir', 'tth.velocity', 'tth.acceleration', 'tth.motor_egu'], concurrent=True)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import hklpy2\n", "\n", "\n", "fourc = hklpy2.creator(\n", " prefix=\"gp:\",\n", " name=\"fourc\",\n", " geometry=\"E4CV\",\n", " solver=\"hkl_soleil\",\n", " reals=dict(\n", " omega=\"m30\",\n", " chi=\"m31\",\n", " phi=\"m32\",\n", " tth=\"m29\",\n", " )\n", ")\n", "fourc" ] }, { "cell_type": "code", "execution_count": 4, "id": "321bed6a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Brief 'where' report:\n", "h=0, k=0, l=0\n", "wavelength=1.0\n", "omega=0, chi=0, phi=0, tth=0\n" ] } ], "source": [ "print(\"Brief 'where' report:\")\n", "fourc.wh()\n" ] }, { "cell_type": "code", "execution_count": 5, "id": "cf49df56", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Full 'where' report:\n", "diffractometer='fourc'\n", "HklSolver(name='hkl_soleil', version='5.1.2', geometry='E4CV', engine_name='hkl', mode='bissector')\n", "Sample(name='sample', lattice=Lattice(a=1, system='cubic'))\n", "Orienting reflections: []\n", "U=[[1, 0, 0], [0, 1, 0], [0, 0, 1]]\n", "UB=[[6.283185307179586, 0.0, 0.0], [0.0, 6.283185307179586, 0.0], [0.0, 0.0, 6.283185307179586]]\n", "constraint: -180.0 <= omega <= 180.0\n", "constraint: -180.0 <= chi <= 180.0\n", "constraint: -180.0 <= phi <= 180.0\n", "constraint: -180.0 <= tth <= 180.0\n", "h=0, k=0, l=0\n", "wavelength=1.0\n", "omega=0, chi=0, phi=0, tth=0\n" ] } ], "source": [ "print(\"Full 'where' report:\")\n", "fourc.wh(full=True)" ] }, { "cell_type": "markdown", "id": "0c4860b0", "metadata": {}, "source": [ "Continue with the **hkl_soleil** E4CV {ref}`example.e4cv.add-sample` example to\n", "investigate this diffractometer." ] } ], "metadata": { "kernelspec": { "display_name": "hklpy2", "language": "python", "name": "python3" }, "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.13.2" } }, "nbformat": 4, "nbformat_minor": 5 }