{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# NSLS-II TARDIS Configuration\n", "\n", "This notebook documents some calculations using a simulation of\n", "the Tardis diffractometer (an `E6C` variation) at NSLS-II. The\n", "connections with the EPICS motors have been replaced with \n", "simulated motors for this example.\n", "\n", "Using the [E6C](https://people.debian.org/~picca/hkl/hkl.html#orge5e0490)\n", "geometry from [*libhkl*](https://people.debian.org/~picca/hkl/hkl.html),\n", "@cmazzoli found that, in this geometry, with the \"lifting_detector_mu\"\n", "mode, the following mapping applies:\n", " \n", "| libhkl | TARDIS |\n", "| :---: | :---: |\n", "| mu | theta |\n", "| gamma | delta |\n", "| delta | gamma |\n", "| phi | None |\n", "| chi | None |\n", "| omega | None |\n", "\n", "* The diffractometer geometry with angle and axis definitions are depicted below\n", "\n", "\n", "\n", "* *libhkl* documentation of the [E6C (Eulerian 6-circle) geometry](https://people.debian.org/~picca/hkl/hkl.html#orge5e0490)\n", "\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "###### " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Begin by instantiating a calculation engine of the appropriate geometry, and configuring its mode as __lifting_detector_mu__ . We must reach into the `hkl.calc` module to import `CalcE6C`." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Available modes: tardis_calc.engine.modes = ['bissector_vertical', 'constant_omega_vertical', 'constant_chi_vertical', 'constant_phi_vertical', 'lifting_detector_phi', 'lifting_detector_omega', 'lifting_detector_mu', 'double_diffraction_vertical', 'bissector_horizontal', 'double_diffraction_horizontal', 'psi_constant_vertical', 'psi_constant_horizontal', 'constant_mu_horizontal']\n", "tardis_calc.physical_axes = OrderedDict([('mu', 0.0), ('omega', 0.0), ('chi', 0.0), ('phi', 0.0), ('gamma', 0.0), ('delta', 0.0)])\n", "tardis_calc.pseudo_axes = OrderedDict([('h', 0.0), ('k', 0.0), ('l', 0.0)])\n" ] } ], "source": [ "from hkl.calc import CalcE6C\n", "\n", "tardis_calc = CalcE6C()\n", "\n", "# what modes are available?\n", "print(f\"Available modes: {tardis_calc.engine.modes = }\")\n", "print(f\"{tardis_calc.physical_axes = }\")\n", "print(f\"{tardis_calc.pseudo_axes = }\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "tardis_calc.engine.mode = 'lifting_detector_mu'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, seed the calculation engine with a parameterized sample and wavelength (or energy).\n", "\n", "**NOTE**: length units are in Angstrom, angles are in degrees, and energy is in keV." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "sample = HklSample(name='sample1', lattice=LatticeTuple(a=9.069, b=9.069, c=10.39, alpha=90.0, beta=90.0, gamma=119.99999999999999), ux=Parameter(name='None (internally: ux)', limits=(min=-180.0, max=180.0), value=0.0, fit=True, inverted=False, units='Degree'), uy=Parameter(name='None (internally: uy)', limits=(min=-180.0, max=180.0), value=0.0, fit=True, inverted=False, units='Degree'), uz=Parameter(name='None (internally: uz)', limits=(min=-180.0, max=180.0), value=0.0, fit=True, inverted=False, units='Degree'), U=array([[1., 0., 0.],\n", " [0., 1., 0.],\n", " [0., 0., 1.]]), UB=array([[ 7.99999720e-01, 3.99999860e-01, -6.41365809e-17],\n", " [ 0.00000000e+00, 6.92820080e-01, -6.41365809e-17],\n", " [ 0.00000000e+00, 0.00000000e+00, 6.04733908e-01]]), reflections=[])\n" ] } ], "source": [ "from hkl import Lattice\n", "\n", "# lattice cell lengths are in Angstrom, angles are in degrees\n", "lattice = Lattice(a=9.069, b=9.069, c=10.390, alpha=90.0, beta=90.0, gamma=120.0)\n", "sample = tardis_calc.new_sample('sample1', lattice=lattice)\n", "\n", "print(f\"{sample = }\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Energy: tardis_calc.energy = 7.691422871251505 keV\n" ] } ], "source": [ "tardis_calc.wavelength = 1.61198 # in Angstrom\n", "\n", "# just to check\n", "print(f\"Energy: {tardis_calc.energy = } keV\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, apply constraints appropriate for TARDIS' geometry. This includes setting limits on the acceptable ranges of motion, initial (and constant!) values, and whether or not a particular axis should be factored into the fitting function that produces the forward and inverse solutions.\n", "\n", "Since we are working with a `hkl.calc.CalcRecip` object, we do not have access to the convenience of the `apply_constraints()` method provided by the `hkl.diffract.Diffractometer` class. We have to set the constraints the hard way. These are the same steps implemented within `apply_constraints()`.\n", "\n", "**NOTE**: physical motors should be checked that limits are in place prior to initiating any motion. Note also that none of the calculations below are associated with any physical motors, and that there is no connection between \"limit\" values used in the calculation, and soft-limit values that may be present in a control system for physical motors." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "# Theta\n", "mu = tardis_calc['mu']\n", "mu.limits = (-181, 181)\n", "mu.value = 0\n", "\n", "# we don't have it. Fix to 0\n", "phi = tardis_calc['phi']\n", "phi.limits = (0, 0)\n", "phi.value = 0\n", "\n", "# we don't have it. Fix to 0\n", "chi = tardis_calc['chi']\n", "chi.limits = (0, 0)\n", "chi.value = 0\n", "\n", "# we don't have it!! Fix to 0\n", "omega = tardis_calc['omega']\n", "omega.limits = (0, 0)\n", "omega.value = 0\n", "\n", "# NOTE: Tardis detector stage names are swapped from canonical names!\n", "# delta\n", "gamma = tardis_calc['gamma']\n", "gamma.limits = (-5, 180)\n", "gamma.value = 0\n", "\n", "# gamma\n", "delta = tardis_calc['delta']\n", "delta.limits = (-5, 180)\n", "delta.value = 0" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can take a look at the UB matrix, but thus far, it won't be very interesting" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false }, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis_calc.sample.UB = array([[ 7.99999720e-01, 3.99999860e-01, -6.41365809e-17],\n", " [ 0.00000000e+00, 6.92820080e-01, -6.41365809e-17],\n", " [ 0.00000000e+00, 0.00000000e+00, 6.04733908e-01]])\n" ] } ], "source": [ "print(f\"{tardis_calc.sample.UB = }\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Add two, known reflections and the motor positions associated with those hkl values.\n", "Here, we are using values from @cmazolli's ESRF notes:\n", "\n", "```\n", "(3,3,0): del = 64.449, gam = -0.871, th = 25.285\n", "(5,2,0): del = 79.712, gam = -1.374, th = 46.816\n", "```\n", "\n", "**NOTE**: the translation of gamma==delta, delta==gamma, and mu==theta is being used" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "r1 = tardis_calc.sample.add_reflection(3, 3, 0, \n", " position=tardis_calc.Position(gamma=64.449, mu=25.285, chi=0.0, phi=0.0, omega=0.0, delta=-0.871))\n", "\n", "r2 = tardis_calc.sample.add_reflection(5, 2, 0,\n", " position=tardis_calc.Position(gamma=79.712, mu=46.816, chi=0.0, phi=0.0, omega=0.0, delta=-1.374))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis_calc.sample.reflections = [(h=3.0, k=3.0, l=0.0), (h=5.0, k=2.0, l=0.0)]\n" ] } ], "source": [ "print(f\"{tardis_calc.sample.reflections = }\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now a UB matrix can be computed." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "array([[ 0.31323551, -0.4807593 , 0.01113654],\n", " [ 0.73590724, 0.63942704, 0.01003773],\n", " [-0.01798898, -0.00176066, 0.60454803]])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis_calc.sample.compute_UB(r1, r2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Compare some libhkl-generated results with those from @cmazolli's notes:\n", "\n", "```python\n", "# Experimentally found reflections @ Lambda = 1.61198 A\n", "# (4, 4, 0) = [90.628, 38.373, 0, 0, 0, -1.156]\n", "# (4, 1, 0) = [56.100, 40.220, 0, 0, 0, -1.091]\n", "# @ Lambda = 1.60911\n", "# (6, 0, 0) = [75.900, 61.000, 0, 0, 0, -1.637]\n", "# @ Lambda = 1.60954\n", "# (3, 2, 0) = [53.090, 26.144, 0, 0, 0, -.933]\n", "# (5, 4, 0) = [106.415, 49.900, 0, 0, 0, -1.535]\n", "# (4, 5, 0) = [106.403, 42.586, 0, 0, 0, -1.183]\n", "```" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis_calc.forward((4,4,0)) = (PosCalcE6C(mu=38.37622128052063, omega=0.0, chi=0.0, phi=0.0, gamma=90.63030469353308, delta=-1.1613181970939916),)\n" ] } ], "source": [ "print(f\"{tardis_calc.forward((4,4,0)) = }\")" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis_calc.forward((4,1,0)) = (PosCalcE6C(mu=40.219919777570965, omega=0.0, chi=0.0, phi=0.0, gamma=56.09704093977083, delta=-1.0836608655032929),)\n" ] } ], "source": [ "print(f\"{tardis_calc.forward((4,1,0)) = }\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Change wavelength here to 1.60911 Angstrom.\n", "Note the difference below in `delta` (TARDIS' gamma axis)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis_calc.forward((6,0,0)) = (PosCalcE6C(mu=60.99346591074179, omega=0.0, chi=0.0, phi=0.0, gamma=75.84521749189145, delta=-1.5839501607961701),)\n" ] } ], "source": [ "# change wavelength (Angstrom)\n", "tardis_calc.wavelength = 1.60911\n", "print(f\"{tardis_calc.forward((6,0,0)) = }\")" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis_calc.forward((3,2,0)) = (PosCalcE6C(mu=26.173823521308144, omega=0.0, chi=0.0, phi=0.0, gamma=53.05207622287554, delta=-0.8437995840438257),)\n", "tardis_calc.forward((5,4,0)) = (PosCalcE6C(mu=49.892322604056034, omega=0.0, chi=0.0, phi=0.0, gamma=106.32053081067252, delta=-1.423656049079967),)\n", "tardis_calc.forward((4,5,0)) = (PosCalcE6C(mu=42.54926633295045, omega=0.0, chi=0.0, phi=0.0, gamma=106.31894239326303, delta=-1.1854071532601609),)\n" ] } ], "source": [ "tardis_calc.wavelength = 1.60954\n", "print(f\"{tardis_calc.forward((3,2,0)) = }\")\n", "print(f\"{tardis_calc.forward((5,4,0)) = }\")\n", "print(f\"{tardis_calc.forward((4,5,0)) = }\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# HKL PseudoPositioner Use\n", "\n", "Let's explore the idea of an hkl 'motor'" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.calc.physical_axis_names = ['theta', 'omega', 'chi', 'phi', 'delta', 'gamma']\n" ] } ], "source": [ "from ophyd import Component as Cpt\n", "from ophyd import (PseudoSingle, EpicsMotor)\n", "from hkl import SimulatedE6C\n", "\n", "# FIXME: hack to get around what should have been done at init of tardis_calc instance\n", "tardis_calc._lock_engine = True\n", "\n", "class Tardis(SimulatedE6C): ...\n", "\n", "# class Tardis(E6C):\n", "# h = Cpt(PseudoSingle, '')\n", "# k = Cpt(PseudoSingle, '')\n", "# l = Cpt(PseudoSingle, '')\n", " \n", "# theta = Cpt(EpicsMotor, 'XF:31IDA-OP{Tbl-Ax:X1}Mtr')\n", "# omega = Cpt(EpicsMotor, 'XF:31IDA-OP{Tbl-Ax:X2}Mtr')\n", "# chi = Cpt(EpicsMotor, 'XF:31IDA-OP{Tbl-Ax:X3}Mtr')\n", "# phi = Cpt(EpicsMotor, 'XF:31IDA-OP{Tbl-Ax:X4}Mtr')\n", "# delta = Cpt(EpicsMotor, 'XF:31IDA-OP{Tbl-Ax:X5}Mtr')\n", "# gamma = Cpt(EpicsMotor, 'XF:31IDA-OP{Tbl-Ax:X6}Mtr')\n", " \n", "# re-map Tardis' axis names onto what an E6C expects\n", "name_map = {\n", " # tardis: E6C\n", " 'mu': 'theta',\n", " 'omega': 'omega',\n", " 'chi': 'chi',\n", " 'phi': 'phi',\n", " 'gamma': 'delta',\n", " 'delta': 'gamma',\n", " }\n", "\n", "tardis = Tardis(\n", " '', # no prefix\n", " name='tardis', # local name\n", " calc_inst=tardis_calc, # the calc engine setup above\n", " # energy=tardis_calc.energy, # FIXME: unexpected keyword argument\n", ")\n", "tardis.calc.physical_axis_names = name_map\n", "print(f\"{tardis.calc.physical_axis_names = }\")" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.real_position = TardisRealPos(mu=0, omega=0, chi=0, phi=0, gamma=0, delta=0)\n" ] } ], "source": [ "print(f\"{tardis.real_position = }\")" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.connected = True\n" ] } ], "source": [ "print(f\"{tardis.connected = }\")" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Energy: tardis.energy.get() = 8.0 keV\n" ] } ], "source": [ "print(f\"Energy: {tardis.energy.get() = } keV\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Move to (101) reflection" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "tags": [] }, "outputs": [ { "data": { "text/plain": [ "MoveStatus(done=False, pos=tardis, elapsed=0.0, success=False, settle_time=0.0)" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis.move((1,0,1), wait=False)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "status = _" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "status.done = True\n" ] } ], "source": [ "print(f\"{status.done = }\")" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.real_position = TardisRealPos(mu=32.61342481972243, omega=0.0, chi=0.0, phi=0.0, gamma=12.011255441335317, delta=8.64179902840924)\n" ] } ], "source": [ "print(f\"{tardis.real_position = }\")" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.position = TardisPseudoPos(h=1.0000000000000002, k=-5.667215834780817e-16, l=1.0)\n" ] } ], "source": [ "print(f\"{tardis.position = }\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Move to (102) reflection" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "MoveStatus(done=True, pos=tardis, elapsed=0.0, success=True, settle_time=0.0)" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis.move((1,0,2))" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "OrderedDict([('tardis_h',\n", " {'source': 'PY:tardis_h.position',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_h_setpoint',\n", " {'source': 'PY:tardis_h.target',\n", " 'dtype': 'integer',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''})])" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis.h.describe()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "OrderedDict([('tardis_h', {'value': 1.0, 'timestamp': 1700539353.9169118}),\n", " ('tardis_h_setpoint',\n", " {'value': 1, 'timestamp': 1700539353.9169252})])" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis.h.read()" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "OrderedDict([('tardis_h',\n", " {'source': 'PY:tardis_h.position',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_h_setpoint',\n", " {'source': 'PY:tardis_h.target',\n", " 'dtype': 'integer',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_k',\n", " {'source': 'PY:tardis_k.position',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_k_setpoint',\n", " {'source': 'PY:tardis_k.target',\n", " 'dtype': 'integer',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_l',\n", " {'source': 'PY:tardis_l.position',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_l_setpoint',\n", " {'source': 'PY:tardis_l.target',\n", " 'dtype': 'integer',\n", " 'shape': [],\n", " 'upper_ctrl_limit': 0,\n", " 'lower_ctrl_limit': 0,\n", " 'units': ''}),\n", " ('tardis_mu',\n", " {'source': 'computed',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'units': '',\n", " 'lower_ctrl_limit': -180,\n", " 'upper_ctrl_limit': 180}),\n", " ('tardis_omega',\n", " {'source': 'computed',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'units': '',\n", " 'lower_ctrl_limit': -180,\n", " 'upper_ctrl_limit': 180}),\n", " ('tardis_chi',\n", " {'source': 'computed',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'units': '',\n", " 'lower_ctrl_limit': -180,\n", " 'upper_ctrl_limit': 180}),\n", " ('tardis_phi',\n", " {'source': 'computed',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'units': '',\n", " 'lower_ctrl_limit': -180,\n", " 'upper_ctrl_limit': 180}),\n", " ('tardis_gamma',\n", " {'source': 'computed',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'units': '',\n", " 'lower_ctrl_limit': -180,\n", " 'upper_ctrl_limit': 180}),\n", " ('tardis_delta',\n", " {'source': 'computed',\n", " 'dtype': 'number',\n", " 'shape': [],\n", " 'units': '',\n", " 'lower_ctrl_limit': -180,\n", " 'upper_ctrl_limit': 180})])" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis.describe()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "OrderedDict([('tardis_h', {'value': 1.0, 'timestamp': 1700539353.9169118}),\n", " ('tardis_h_setpoint',\n", " {'value': 1, 'timestamp': 1700539353.9169252}),\n", " ('tardis_k',\n", " {'value': -1.0351079150284598e-17,\n", " 'timestamp': 1700539353.9170356}),\n", " ('tardis_k_setpoint',\n", " {'value': 0, 'timestamp': 1700539353.917049}),\n", " ('tardis_l',\n", " {'value': 1.9999999999999998, 'timestamp': 1700539353.9170997}),\n", " ('tardis_l_setpoint',\n", " {'value': 2, 'timestamp': 1700539353.9171119}),\n", " ('tardis_mu',\n", " {'value': 42.936333275662705, 'timestamp': 1700539353.9886892}),\n", " ('tardis_omega', {'value': 0.0, 'timestamp': 1700539353.9886923}),\n", " ('tardis_chi', {'value': 0.0, 'timestamp': 1700539353.9886947}),\n", " ('tardis_phi', {'value': 0.0, 'timestamp': 1700539353.9886968}),\n", " ('tardis_gamma',\n", " {'value': 12.143148125839154, 'timestamp': 1700539353.9886992}),\n", " ('tardis_delta',\n", " {'value': 17.765469685728892, 'timestamp': 1700539353.9887023})])" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tardis.read()" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.position = TardisPseudoPos(h=1.0, k=-1.0351079150284598e-17, l=1.9999999999999998)\n" ] } ], "source": [ "print(f\"{tardis.position = }\")" ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tardis.real_position = TardisRealPos(mu=42.936333275662705, omega=0.0, chi=0.0, phi=0.0, gamma=12.143148125839154, delta=17.765469685728892)\n" ] } ], "source": [ "print(f\"{tardis.real_position = }\")" ] } ], "metadata": { "interpreter": { "hash": "cd09a60d4ca96784847e6d28c64916bc86a437fe6be574606d07ffca69ac8887" }, "kernelspec": { "display_name": "Python 3.9.12 ('training_2022')", "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.11.6" } }, "nbformat": 4, "nbformat_minor": 4 }