Skip to content

Commit

Permalink
ENH #262
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Oct 15, 2023
1 parent dd2cf5a commit 01ea390
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 18 deletions.
140 changes: 123 additions & 17 deletions docs/source/geometry_tables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,27 @@ the number of axes (circles) and the names of each. This table is
sorted first by the number of circles, and then the geometry name (as
used here in *hklpy*).

======== ==================================================== =======================================================================
#circles geometry real_axes
======== ==================================================== =======================================================================
4 :ref:`E4CH <E4CH_table>` ``omega``, ``chi``, ``phi``, ``tth``
4 :ref:`E4CV <E4CV_table>` ``omega``, ``chi``, ``phi``, ``tth``
4 :ref:`K4CV <K4CV_table>` ``komega``, ``kappa``, ``kphi``, ``tth``
4 :ref:`SoleilMars <SoleilMars_table>` ``omega``, ``chi``, ``phi``, ``tth``
4 :ref:`SoleilSixsMed1p2 <SoleilSixsMed1p2_table>` ``pitch``, ``mu``, ``gamma``, ``delta``
4 :ref:`Zaxis <Zaxis_table>` ``mu``, ``omega``, ``delta``, ``gamma``
5 :ref:`SoleilSixsMed2p2 <SoleilSixsMed2p2_table>` ``beta``, ``mu``, ``omega``, ``gamma``, ``delta``
6 :ref:`E6C <E6C_table>` ``mu``, ``omega``, ``chi``, ``phi``, ``gamma``, ``delta``
6 :ref:`K6C <K6C_table>` ``mu``, ``komega``, ``kappa``, ``kphi``, ``gamma``, ``delta``
6 :ref:`Petra3_p09_eh2 <Petra3_p09_eh2_table>` ``mu``, ``omega``, ``chi``, ``phi``, ``delta``, ``gamma``
6 :ref:`SoleilSiriusKappa <SoleilSiriusKappa_table>` ``mu``, ``komega``, ``kappa``, ``kphi``, ``delta``, ``gamma``
6 :ref:`SoleilSiriusTurret <SoleilSiriusTurret_table>` ``basepitch``, ``thetah``, ``alphay``, ``alphax``, ``delta``, ``gamma``
6 :ref:`SoleilSixsMed2p3 <SoleilSixsMed2p3_table>` ``beta``, ``mu``, ``omega``, ``gamma``, ``delta``, ``eta_a``
======== ==================================================== =======================================================================
======== ============================================================== ========================================================================
#circles geometry real_axes
======== ============================================================== ========================================================================
4 :ref:`E4CH <E4CH_table>` ``omega``, ``chi``, ``phi``, ``tth``
4 :ref:`E4CV <E4CV_table>` ``omega``, ``chi``, ``phi``, ``tth``
4 :ref:`K4CV <K4CV_table>` ``komega``, ``kappa``, ``kphi``, ``tth``
4 :ref:`Petra3_p23_4c <Petra3_p23_4c_table>` ``omega_t``, ``mu``, ``gamma``, ``delta``
4 :ref:`SoleilMars <SoleilMars_table>` ``omega``, ``chi``, ``phi``, ``tth``
4 :ref:`SoleilSixsMed1p2 <SoleilSixsMed1p2_table>` ``pitch``, ``mu``, ``gamma``, ``delta``
4 :ref:`Zaxis <Zaxis_table>` ``mu``, ``omega``, ``delta``, ``gamma``
5 :ref:`SoleilSixsMed2p2 <SoleilSixsMed2p2_table>` ``beta``, ``mu``, ``omega``, ``gamma``, ``delta``
5 :ref:`SoleilSixsMed2p3v2 <SoleilSixsMed2p3v2_table>` ``mu``, ``omega``, ``gamma``, ``delta``, ``eta_a``
6 :ref:`E6C <E6C_table>` ``mu``, ``omega``, ``chi``, ``phi``, ``gamma``, ``delta``
6 :ref:`K6C <K6C_table>` ``mu``, ``komega``, ``kappa``, ``kphi``, ``gamma``, ``delta``
6 :ref:`Petra3_p09_eh2 <Petra3_p09_eh2_table>` ``mu``, ``omega``, ``chi``, ``phi``, ``delta``, ``gamma``
6 :ref:`SoleilNanoscopiumRobot <SoleilNanoscopiumRobot_table>` ``rz``, ``rs``, ``rx``, ``r``, ``delta``, ``gamma``
6 :ref:`SoleilSiriusKappa <SoleilSiriusKappa_table>` ``mu``, ``komega``, ``kappa``, ``kphi``, ``delta``, ``gamma``
6 :ref:`SoleilSiriusTurret <SoleilSiriusTurret_table>` ``basepitch``, ``thetah``, ``alphay``, ``alphax``, ``delta``, ``gamma``
6 :ref:`SoleilSixsMed2p3 <SoleilSixsMed2p3_table>` ``beta``, ``mu``, ``omega``, ``gamma``, ``delta``, ``eta_a``
7 :ref:`Petra3_p23_6c <Petra3_p23_6c_table>` ``omega_t``, ``mu``, ``omega``, ``chi``, ``phi``, ``gamma``, ``delta``
======== ============================================================== ========================================================================

Tables for each geometry
------------------------
Expand Down Expand Up @@ -206,6 +210,63 @@ hkl ``h``, ``k``, ``l`` lifting detector chi
hkl ``h``, ``k``, ``l`` lifting detector phi
====== =================== =================================== ==========

.. index:: Petra3_p23_4c, geometry; Petra3_p23_4c

.. _Petra3_p23_4c_table:

Geometry: `Petra3_p23_4c`
++++++++++++++++++++++++++

real axes: ``omega_t``, ``mu``, ``gamma``, ``delta``

=========== =========================== =================================== ==========
engine pseudo_axes mode parameters
=========== =========================== =================================== ==========
hkl ``h``, ``k``, ``l`` bisector vertical
hkl ``h``, ``k``, ``l`` lifting detector omega_t
hkl ``h``, ``k``, ``l`` lifting detector mu
hkl ``h``, ``k``, ``l`` bisector horizontal
hkl ``h``, ``k``, ``l`` psi constant h2, k2, l2, psi
q2 ``q``, ``alpha`` q2
qper_qpar ``qper``, ``qpar`` qper_qpar x, y, z
tth2 ``tth``, ``alpha`` tth2
incidence ``incidence``, ``azimuth`` incidence x, y, z
emergence ``emergence``, ``azimuth`` emergence x, y, z
=========== =========================== =================================== ==========

.. index:: Petra3_p23_6c, geometry; Petra3_p23_6c

.. _Petra3_p23_6c_table:

Geometry: `Petra3_p23_6c`
++++++++++++++++++++++++++

real axes: ``omega_t``, ``mu``, ``omega``, ``chi``, ``phi``, ``gamma``, ``delta``

=========== =========================== =================================== ==========
engine pseudo_axes mode parameters
=========== =========================== =================================== ==========
hkl ``h``, ``k``, ``l`` bisector vertical
hkl ``h``, ``k``, ``l`` constant omega vertical
hkl ``h``, ``k``, ``l`` constant chi vertical
hkl ``h``, ``k``, ``l`` constant phi vertical
hkl ``h``, ``k``, ``l`` lifting detector phi
hkl ``h``, ``k``, ``l`` lifting detector omega
hkl ``h``, ``k``, ``l`` lifting detector mu
hkl ``h``, ``k``, ``l`` double diffraction vertical h2, k2, l2
hkl ``h``, ``k``, ``l`` bisector horizontal
hkl ``h``, ``k``, ``l`` double diffraction horizontal h2, k2, l2
hkl ``h``, ``k``, ``l`` psi constant vertical h2, k2, l2, psi
hkl ``h``, ``k``, ``l`` psi constant horizontal h2, k2, l2, psi
hkl ``h``, ``k``, ``l`` constant mu horizontal
psi ``psi`` psi vertical h2, k2, l2
q2 ``q``, ``alpha`` q2
qper_qpar ``qper``, ``qpar`` qper_qpar x, y, z
tth2 ``tth``, ``alpha`` tth2
incidence ``incidence``, ``azimuth`` incidence x, y, z
emergence ``emergence``, ``azimuth`` emergence x, y, z
=========== =========================== =================================== ==========

.. index:: SoleilMars, geometry; SoleilMars

.. _SoleilMars_table:
Expand All @@ -229,6 +290,23 @@ q ``q`` q
incidence ``incidence``, ``azimuth`` incidence ``x``, ``y``, ``z``
========= ========================== ================== ===============================

.. index:: SoleilNanoscopiumRobot, geometry; SoleilNanoscopiumRobot

.. _SoleilNanoscopiumRobot_table:

Geometry: `SoleilNanoscopiumRobot`
++++++++++++++++++++++++++++++++++

real axes: ``rz``, ``rs``, ``rx``, ``r``, ``delta``, ``gamma``

========= ========================== =================== ==========
engine pseudo_axes mode parameters
========= ========================== =================== ==========
hkl ``h``, ``k``, ``l`` lifting detector rz
hkl ``h``, ``k``, ``l`` lifting detector rs
hkl ``h``, ``k``, ``l`` lifting detector rx
========= ========================== =================== ==========

.. index:: SoleilSiriusKappa, geometry; SoleilSiriusKappa

.. _SoleilSiriusKappa_table:
Expand Down Expand Up @@ -336,6 +414,34 @@ Geometry: `SoleilSixsMed2p3`

real axes: ``beta``, ``mu``, ``omega``, ``gamma``, ``delta``, ``eta_a``

.. note:: Compare with :ref:`SoleilSixsMed2p3v2_table` which does not have ``beta``.

========= ========================== =============== ==================================
engine pseudo_axes mode parameters
========= ========================== =============== ==================================
hkl ``h``, ``k``, ``l`` mu_fixed
hkl ``h``, ``k``, ``l`` gamma_fixed
hkl ``h``, ``k``, ``l`` emergence_fixed ``x``, ``y``, ``z``, ``emergence``
q2 ``q``, ``alpha`` q2
qper_qpar ``qper``, ``qpar`` qper_qpar ``x``, ``y``, ``z``
tth2 ``tth``, ``alpha`` tth2
incidence ``incidence``, ``azimuth`` incidence ``x``, ``y``, ``z``
emergence ``emergence``, ``azimuth`` emergence ``x``, ``y``, ``z``
========= ========================== =============== ==================================

.. index:: SoleilSixsMed2p3v2, geometry; SoleilSixsMed2p3v2

.. _SoleilSixsMed2p3v2_table:

Geometry: `SoleilSixsMed2p3v2`
++++++++++++++++++++++++++++++

real axes: ``mu``, ``omega``, ``gamma``, ``delta``, ``eta_a``

global parameter: `eta_a_rotation`, rotation of the detector (zaxis-like)

.. note:: Compare with :ref:`SoleilSixsMed2p3_table` which has an additional ``beta`` rotation.

========= ========================== =============== ==================================
engine pseudo_axes mode parameters
========= ========================== =============== ==================================
Expand Down
4 changes: 4 additions & 0 deletions hkl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,21 @@
K4CV,
K6C,
Petra3_p09_eh2,
Petra3_p23_4c,
Petra3_p23_6c,
SimMixin,
SimulatedE4CV,
SimulatedE6C,
SimulatedK4CV,
SimulatedK6C,
SoleilMars,
SoleilNanoscopiumRobot,
SoleilSiriusKappa,
SoleilSiriusTurret,
SoleilSixsMed1p2,
SoleilSixsMed2p2,
SoleilSixsMed2p3,
SoleilSixsMed2p3v2,
Zaxis,
)

Expand Down
37 changes: 37 additions & 0 deletions hkl/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
~CalcK4CV
~CalcK6C
~CalcPetra3_p09_eh2
~CalcPetra3_p23_4c
~CalcPetra3_p23_6c
~CalcSoleilMars
~CalcSoleilNanoscopiumRobot
~CalcSoleilSiriusKappa
~CalcSoleilSiriusTurret
~CalcSoleilSixsMed1p2
~CalcSoleilSixsMed2p2
~CalcSoleilSixsMed2p3
~CalcSoleilSixsMed2p3v2
~CalcZaxis
"""
Expand All @@ -48,8 +52,11 @@
CalcK4CV
CalcK6C
CalcPetra3_p09_eh2
CalcPetra3_p23_4c
CalcPetra3_p23_6c
CalcRecip
CalcSoleilMars
CalcSoleilNanoscopiumRobot
CalcSoleilSiriusKappa
CalcSoleilSiriusTurret
CalcSoleilSixsMed1p2
Expand Down Expand Up @@ -745,13 +752,34 @@ def __init__(self, **kwargs):
super().__init__("PETRA3 P09 EH2", **kwargs)


class CalcPetra3_p23_4c(CalcRecip):
"""Geometry: PETRA3 P23 4C"""

def __init__(self, **kwargs):
super().__init__("PETRA3 P23 4C", **kwargs)


class CalcPetra3_p23_6c(CalcRecip):
"""Geometry: PETRA3 P23 6C"""

def __init__(self, **kwargs):
super().__init__("PETRA3 P23 6C", **kwargs)


class CalcSoleilMars(CalcRecip):
"""Geometry: SOLEIL MARS"""

def __init__(self, **kwargs):
super().__init__("SOLEIL MARS", **kwargs)


class CalcSoleilNanoscopiumRobot(CalcRecip):
"""Geometry: SOLEIL NANOSCOPIUM ROBOT"""

def __init__(self, **kwargs):
super().__init__("SOLEIL NANOSCOPIUM ROBOT", **kwargs)


class CalcSoleilSiriusKappa(CalcRecip):
"""Geometry: SOLEIL SIRIUS KAPPA"""

Expand Down Expand Up @@ -781,10 +809,19 @@ def __init__(self, **kwargs):


class CalcSoleilSixsMed2p3(CalcRecip):
"""Geometry: SOLEIL SIXS MED2+3"""

def __init__(self, **kwargs):
super().__init__("SOLEIL SIXS MED2+3", **kwargs)


class CalcSoleilSixsMed2p3v2(CalcRecip):
"""Geometry: SOLEIL SIXS MED2+3 v2"""

def __init__(self, **kwargs):
super().__init__("SOLEIL SIXS MED2+3 v2", **kwargs)


class CalcZaxis(CalcRecip):
"""Geometry: ZAXIS"""

Expand Down
5 changes: 5 additions & 0 deletions hkl/diffract.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,17 @@ class (using `calc_kw`) to instantiate a new one.
:class:`~hkl.geometries.K6C`
:class:`~hkl.geometries.Med2p3`
:class:`~hkl.geometries.Petra3_p09_eh2`
:class:`~hkl.geometries.Petra3_p23_4c`
:class:`~hkl.geometries.Petra3_p23_6c`
:class:`~hkl.geometries.SoleilMars`
:class:`~hkl.geometries.SoleilNanoscopiumRobot`
:class:`~hkl.geometries.SoleilSiriusKappa`
:class:`~hkl.geometries.SoleilSiriusTurret`
:class:`~hkl.geometries.SoleilSixs`
:class:`~hkl.geometries.SoleilSixsMed1p2`
:class:`~hkl.geometries.SoleilSixsMed2p2`
:class:`~hkl.geometries.SoleilSixsMed2p3`
:class:`~hkl.geometries.SoleilSixsMed2p3v2`
:class:`~hkl.geometries.Zaxis`
"""

Expand Down
34 changes: 33 additions & 1 deletion hkl/geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@
.. autosummary::
~Petra3_p09_eh2
~Petra3_p23_4c
~Petra3_p23_6c
~SoleilMars
~SoleilNanoscopiumRobot
~SoleilSiriusKappa
~SoleilSiriusTurret
~SoleilSixsMed1p2
~SoleilSixsMed2p2
~SoleilSixsMed2p3
~SoleilSixsMed2p3v2
"""

Expand All @@ -54,17 +58,21 @@
K4CV
K6C
Petra3_p09_eh2
Petra3_p23_4c
Petra3_p23_6c
SimMixin
SimulatedE4CV
SimulatedE6C
SimulatedK4CV
SimulatedK6C
SoleilMars
SoleilNanoscopiumRobot
SoleilSiriusKappa
SoleilSiriusTurret
SoleilSixsMed1p2
SoleilSixsMed2p2
SoleilSixsMed2p3
SoleilSixsMed2p3v2
Zaxis
""".split()
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -101,17 +109,35 @@ class K6C(Diffractometer):


class Petra3_p09_eh2(Diffractometer):
"""Used at Petra3"""
"""6-circle Used at Petra3 P09"""

calc_class = calc.CalcPetra3_p09_eh2


class Petra3_p23_4c(Diffractometer):
"""4-circle Used at Petra3 P23"""

calc_class = calc.CalcPetra3_p23_4c


class Petra3_p23_6c(Diffractometer):
"""7-circle Used at Petra3 P23"""

calc_class = calc.CalcPetra3_p23_6c


class SoleilMars(Diffractometer):
"""Used at Soleil"""

calc_class = calc.CalcSoleilMars


class SoleilNanoscopiumRobot(Diffractometer):
"""Used at Soleil"""

calc_class = calc.CalcSoleilNanoscopiumRobot


class SoleilSiriusKappa(Diffractometer):
"""Used at Soleil"""

Expand Down Expand Up @@ -142,6 +168,12 @@ class SoleilSixsMed2p3(Diffractometer):
calc_class = calc.CalcSoleilSixsMed2p3


class SoleilSixsMed2p3v2(Diffractometer):
"""Used at Soleil"""

calc_class = calc.CalcSoleilSixsMed2p3v2


class Zaxis(Diffractometer):
"""Z-axis geometry"""

Expand Down
Loading

0 comments on commit 01ea390

Please sign in to comment.