Giter VIP home page Giter VIP logo

diffcalc's Introduction

Diffcalc - A Diffraction Condition Calculator for Diffractometer Control

Diffcalc is a python/jython based diffraction condition calculator used for controlling diffractometers within reciprocal lattice space. It performs the same task as the fourc, sixc, twoc, kappa, psic and surf macros from SPEC.

There is a user guide and developer guide, both at diffcalc.readthedocs.io

IMPORTANT: Python 3 version of diffcalc calculator code is available as diffcalc-core project https://github.com/DiamondLightSource/diffcalc-core/

Build Status Documentation Status

Software compatibility

  • Written in Python using numpy
  • Works in Jython using Jama
  • Runs directly in OpenGDA<http://www.opengda.org>
  • Runs in in Python or IPython using minimal OpenGda emulation (included)
  • Contact us for help running in your environment

Diffractometer compatibility

Diffcalc’s standard calculation engine is an implementation of [You1999] and [Busing1967]. Diffcalc works with any diffractometer which is a subset of:

4s + 2d six-circle diffractometer, from H.You (1999)

Diffcalc can be configured to work with any diffractometer geometry which is a subset of this. For example, a five-circle diffractometer might be missing the nu circle above.

Note that the first versions of Diffcalc were based on [Vlieg1993] and [Vlieg1998] and a ‘Vlieg’ engine is still available. There is also an engine based on [Willmott2011]. The ‘You’ engine is more generic and the plan is to remove the old ‘Vlieg’ engine once beamlines have been migrated.

Installation

Check it out:

$ git clone https://github.com/DiamondLightSource/diffcalc.git
Cloning into 'diffcalc'...

At Diamond Diffcalc may be installed within an OpenGDA deployment and is available via the 'module' system from bash.

Starting

Start diffcalc in ipython using a sixcircle dummy diffractometer:

$ cd diffcalc
$ ./diffcalc.py --help
...

$ ./diffcalc.py sixcircle

Running: "ipython --no-banner --HistoryManager.hist_file=/tmp/ipython_hist_zrb13439.sqlite -i -m diffcmd.start sixcircle False"

---------------------------------- DIFFCALC -----------------------------------
Startup script: '/Users/zrb13439/git/diffcalc/startup/sixcircle.py'
Loading ub calculation: 'test'
------------------------------------ Help -------------------------------------
Quick:  https://github.com/DiamondLightSource/diffcalc/blob/master/README.rst
Manual: https://diffcalc.readthedocs.io
Type:   > help ub
        > help hkl
-------------------------------------------------------------------------------
In [1]:

Within Diamond use:

$ module load diffcalc
$ diffcalc --help
...
$ diffcalc sixcircle

Trying it out

Type demo.all() to see it working and then move try the following quick start guide:

>>> demo.all()
...

Getting help

To view help with orientation and then moving in hkl space:

>>> help ub
...
>>> help hkl
...

Configuring a UB calculation

See the full user manual<https://diffcalc.readthedocs.io> for many more options and an explanation of what this all means.

To load the last used UB-calculation:

>>> lastub
Loading ub calculation: 'mono-Si'

To load a previous UB-calculation:

>>> listub
UB calculations in: /Users/walton/.diffcalc/i16

0) mono-Si            15 Feb 2017 (22:32)
1) i16-32             13 Feb 2017 (18:32)

>>> loadub 0

To create a new UB-calculation:

>>> newub 'example'
>>> setlat '1Acube' 1 1 1 90 90 90

Find U matrix from two reflections:

>>> pos wl 1
wl:        1.0000
>>> c2th [0 0 1]
59.99999999999999

>>> pos sixc [0 60 0 30 90 0]
sixc:     mu:  0.0000 delta:  60.0000 gam:  0.0000 eta:  30.0000 chi:  90.0000 phi:  0.0000 
>>> addref [0 0 1]

>>> pos sixc [0 90 0 45 45 90]
sixc:     mu:  0.0000 delta:  90.0000 gam:  0.0000 eta:  45.0000 chi:  45.0000 phi:  90.0000 
>>> addref [0 1 1]
Calculating UB matrix.

Check that it looks good:

>>> checkub

     ENERGY     H     K     L    H_COMP   K_COMP   L_COMP     TAG
 1  12.3984  0.00  0.00  1.00    0.0000   0.0000   1.0000        
 2  12.3984  0.00  1.00  1.00    0.0000   1.0000   1.0000        

To see the resulting UB-calculation:

>>> ub
UBCALC

   name:       example

   n_phi:      0.00000   0.00000   1.00000 <- set
   n_hkl:     -0.00000   0.00000   1.00000
   miscut:     None

CRYSTAL

   name:        1Acube

   a, b, c:    1.00000   1.00000   1.00000
              90.00000  90.00000  90.00000

   B matrix:   6.28319   0.00000   0.00000
               0.00000   6.28319   0.00000
               0.00000   0.00000   6.28319

UB MATRIX

   U matrix:   1.00000   0.00000   0.00000
               0.00000   1.00000   0.00000
               0.00000   0.00000   1.00000

   U angle:    0

   UB matrix:  6.28319   0.00000   0.00000
               0.00000   6.28319   0.00000
               0.00000   0.00000   6.28319

REFLECTIONS

     ENERGY     H     K     L        MU    DELTA      GAM      ETA      CHI      PHI  TAG
   1 12.398  0.00  0.00  1.00    0.0000  60.0000   0.0000  30.0000  90.0000   0.0000  
   2 12.398  0.00  1.00  1.00    0.0000  90.0000   0.0000  45.0000  45.0000  90.0000  

Setting the reference vector

See the full user manual<https://diffcalc.readthedocs.io> for many more options and an explanation of what this all means.

By default the reference vector is set parallel to the phi axis. That is, along the z-axis of the phi coordinate frame.

The ub command shows the current reference vector, along with any inferred miscut, at the top its report (or it can be shown by calling setnphi or setnhkl' with no args):

>>> ub
...
n_phi:      0.00000   0.00000   1.00000 <- set
n_hkl:     -0.00000   0.00000   1.00000
miscut:     None
...

Constraining solutions for moving in hkl space

See the full user manual<https://diffcalc.readthedocs.io> for many more options and an explanation of what this all means.

To get help and see current constraints:

>>> help con
...

>>> con
    DET        REF        SAMP
    ------     ------     ------
    delta  --> a_eq_b --> mu
--> gam        alpha      eta
    qaz        beta       chi
    naz        psi        phi
                          mu_is_gam

    gam  : 0.0000
    a_eq_b
    mu   : 0.0000

    Type 'help con' for instructions

Three constraints can be given: zero or one from the DET and REF columns and the remainder from the SAMP column. Not all combinations are currently available. Use help con to see a summary if you run into troubles.

To configure four-circle vertical scattering:

>>> con gam 0 mu 0 a_eq_b
    gam  : 0.0000
    a_eq_b
    mu   : 0.0000

Moving in hkl space

Simulate moving to a reflection:

>>> sim hkl [0 1 1]
sixc would move to:
     mu :    0.0000
  delta :   90.0000
    gam :    0.0000
    eta :   45.0000
    chi :   45.0000
    phi :   90.0000

  alpha :   30.0000
   beta :   30.0000
    naz :   35.2644
    psi :   90.0000
    qaz :   90.0000
    tau :   45.0000
  theta :   45.0000

Move to reflection:

>>> pos hkl [0 1 1]
hkl:      h: 0.00000 k: 1.00000 l: 1.00000 

>>> pos sixc
sixc:     mu:  0.0000 delta:  90.0000 gam:  0.0000 eta:  45.0000 chi:  45.0000 phi:  90.0000 

Scanning in hkl space

Scan an hkl axis (and read back settings):

>>> scan l 0 1 .2 sixc
      l       mu     delta      gam       eta      chi       phi
-------  -------  --------  -------  --------  -------  --------
0.00000   0.0000   60.0000   0.0000   30.0000   0.0000   90.0000
0.20000   0.0000   61.3146   0.0000   30.6573   11.3099   90.0000
0.40000   0.0000   65.1654   0.0000   32.5827   21.8014   90.0000
0.60000   0.0000   71.3371   0.0000   35.6685   30.9638   90.0000
0.80000   0.0000   79.6302   0.0000   39.8151   38.6598   90.0000
1.00000   0.0000   90.0000   0.0000   45.0000   45.0000   90.0000

Scan a constraint (and read back virtual angles and eta):

>>> con psi
    gam  : 0.0000
!   psi  : ---
    mu   : 0.0000
>>> scan psi 70 110 10 hklverbose [0 1 1] eta
     psi       eta        h        k        l     theta       qaz     alpha       naz       tau       psi      beta
--------  --------  -------  -------  -------  --------  --------  --------  --------  --------  --------  --------
70.00000   26.1183  0.00000  1.00000  1.00000  45.00000  90.00000  19.20748  45.28089  45.00000  70.00000  42.14507
80.00000   35.1489  -0.00000  1.00000  1.00000  45.00000  90.00000  24.40450  40.12074  45.00000  80.00000  35.93196
90.00000   45.0000  0.00000  1.00000  1.00000  45.00000  90.00000  30.00000  35.26439  45.00000  90.00000  30.00000
100.00000   54.8511  -0.00000  1.00000  1.00000  45.00000  90.00000  35.93196  30.68206  45.00000  100.00000  24.40450
110.00000   63.8817  -0.00000  1.00000  1.00000  45.00000  90.00000  42.14507  26.34100  45.00000  110.00000  19.20748

Orientation Commands

STATE
-- newub {'name'} start a new ub calculation name
-- loadub 'name' | num load an existing ub calculation
-- lastub load the last used ub calculation
-- listub list the ub calculations available to load
-- rmub 'name'|num remove existing ub calculation
-- saveubas 'name' save the ub calculation with a new name
LATTICE
-- setlat interactively enter lattice parameters (Angstroms and Deg)
-- setlat name a assumes cubic
-- setlat name a b assumes tetragonal
-- setlat name a b c assumes ortho
-- setlat name a b c gamma assumes mon/hex with gam not equal to 90
-- setlat name a b c alpha beta gamma arbitrary
-- c2th [h k l] calculate two-theta angle for reflection
-- hklangle [h1 k1 l1] [h2 k2 l2] calculate angle between [h1 k1 l1] and [h2 k2 l2] crystal planes
REFERENCE (SURFACE)
-- setnphi {[x y z]} sets or displays n_phi reference
-- setnhkl {[h k l]} sets or displays n_hkl reference
REFLECTIONS
-- showref shows full reflection list
-- addref add reflection interactively
-- addref [h k l] {'tag'} add reflection with current position and energy
-- addref [h k l] (p1, .., pN) energy {'tag'} add arbitrary reflection
-- editref num interactively edit a reflection
-- delref num deletes a reflection (numbered from 1)
-- clearref deletes all the reflections
-- swapref swaps first two reflections used for calculating U matrix
-- swapref num1 num2 swaps two reflections (numbered from 1)
CRYSTAL ORIENTATIONS
-- showorient shows full list of crystal orientations
-- addorient add crystal orientation interactively
-- addorient [h k l] [x y z] {'tag'} add crystal orientation in laboratory frame
-- editorient num interactively edit a crystal orientation
-- delorient num deletes a crystal orientation (numbered from 1)
-- clearorient deletes all the crystal orientations
-- swaporient swaps first two crystal orientations used for calculating U matrix
-- swaporient num1 num2 swaps two crystal orientations (numbered from 1)
UB MATRIX
-- checkub show calculated and entered hkl values for reflections
-- setu {[[..][..][..]]} manually set u matrix
-- setub {[[..][..][..]]} manually set ub matrix
-- calcub (re)calculate u matrix from ref1 and ref2
-- trialub (re)calculate u matrix from ref1 only (check carefully)
-- refineub {[h k l]} {pos} refine unit cell dimensions and U matrix to match diffractometer angles for a given hkl value
-- addmiscut angle {[x y z]} apply miscut to U matrix using a specified miscut angle in degrees and a rotation axis (default: [0 1 0])
-- setmiscut angle {[x y z]} manually set U matrix using a specified miscut angle in degrees and a rotation axis (default: [0 1 0])

Motion Commands

CONSTRAINTS
-- con list available constraints and values
-- con <name> {val} constrains and optionally sets one constraint
-- con <name> {val} <name> {val} <name> {val} clears and then fully constrains
-- uncon <name> remove constraint
HKL
-- allhkl [h k l] print all hkl solutions ignoring limits
HARDWARE
-- hardware show diffcalc limits and cuts
-- setcut {name {val}} sets cut angle
-- setmin {axis {val}} set lower limits used by auto sector code (None to clear)
-- setmax {name {val}} sets upper limits used by auto sector code (None to clear)
MOTION
-- sim hkl scn simulates moving scannable (not all)
-- sixc show Eularian position
-- pos sixc [mu, delta, gam, eta, chi, phi] move to Eularian position(None holds an axis still)
-- sim sixc [mu, delta, gam, eta, chi, phi] simulate move to Eulerian positionsixc
-- hkl show hkl position
-- pos hkl [h k l] move to hkl position
-- pos {h | k | l} val move h, k or l to val
-- sim hkl [h k l] simulate move to hkl position

References

Busing1967

W. R. Busing and H. A. Levy. Angle calculations for 3- and 4-circle X-ray and neutron diffractometers. Acta Cryst. (1967). 22, 457-464. (pdf link).

Vlieg1993

Martin Lohmeier and Elias Vlieg. Angle calculations for a six-circle surface x-ray diffractometer. J. Appl. Cryst. (1993). 26, 706-716. (pdf link).

Vlieg1998

Elias Vlieg. A (2+3)-type surface diffractometer: mergence of the z-axis and (2+2)-type geometries. J. Appl. Cryst. (1998). 31, 198-203. (pdf link).

Willmott2011
    1. Schlepütz, S. O. Mariager, S. A. Pauli, R. Feidenhans'l and

P. R. Willmott. Angle calculations for a (2+3)-type diffractometer: focus on area detectors. J. Appl. Cryst. (2011). 44, 73-83. (pdf link).

You1999
  1. You. Angle calculations for a '4S+2D' six-circle diffractometer.

J. Appl. Cryst. (1999). 32, 614-623. (pdf link).

diffcalc's People

Contributors

anthonyhulldiamond avatar c-mita avatar dg-at-diamond avatar dominicoram avatar fajinyuan avatar isikhar avatar jamesmudd avatar joeshannon avatar keithralphs avatar mark-booth avatar robwalton avatar tpoliaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diffcalc's Issues

I21 'sa' scannable failed with 'No Child named:formatPositionFields when running in GDA

>>> sa
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py", line 132, in __repr__
    formatted_values = self.formatPositionFields(pos)
  File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/diffcalc/gdasupport/minigda/scannable.py", line 408, in __getattr__
    raise AttributeError("No child named:" + name)
AttributeError: No child named:formatPositionFields

Move mock and test out of top level

Diffcalc exposes both mock and test at the top level, both of which could cause issues when trying to use diffcalc within a large codebase.

In particular this has caused an issue in GDA where doing import mock from other Jython files uses the diffcalc version rather than the mock package we have installed in site-packages.

For the mock package can we just list it as a dependency in the setup.py and remove it from the codebase entirely?

Replace AssertionError raised for a particular unreachable reflection with something useful to users

>>>ub
UBCALC

   name:      mt8877-1

CRYSTAL

   name:          GaAs

   a, b, c:    5.65325   5.65325   5.65325
              90.00000  90.00000  90.00000

   B matrix:   1.11143  -0.00000  -0.00000
               0.00000   1.11143  -0.00000
               0.00000   0.00000   1.11143

UB MATRIX

   U matrix:  -0.71022   0.70390   0.01071
              -0.39941  -0.41543   0.81725
               0.57971   0.57615   0.57618

   UB matrix: -0.78935   0.78234   0.01191
              -0.44391  -0.46172   0.90831
               0.64431   0.64034   0.64039

REFLECTIONS

     ENERGY     H     K     L       PHI      CHI      ETA       MU    DELTA      GAM  TAG
   1 10.000  1.00  1.00  1.00   90.0000  89.9200  10.8220  -0.0000  21.9350  -0.0000  
   2 10.000  0.00  0.00  2.00   88.6700  35.4098  13.1400   0.0000  25.3376   0.0000  



>>>con qaz 90 alpha 5 mu 0
    qaz: 90.0000
    alpha: 5.0000
    mu: 0.0000

>>>sim hkl [1 1 1]
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/util.py", line 346, in wrapper
    return call_command(f, args)
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/util.py", line 356, in call_command
    return f(*args)
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/util.py", line 356, in call_command
    return f(*args)
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/diffcalc_.py", line 267, in sim
    print scn.simulateMoveTo(hkl)
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/diffcalc_.py", line 267, in sim
    print scn.simulateMoveTo(hkl)
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/gdasupport/scannable/hkl.py", line 103, in simulateMoveTo
    (pos, params) = self._diffcalc.hkl_to_angles(hkl[0], hkl[1], hkl[2])
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/diffcalc_.py", line 205, in hkl_to_angles
    (pos, params) = self._hklcalc.hklToAngles(h, k, l, wavelength)
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/hkl/you/calc.py", line 316, in hklToAngles
    pos_virtual_angles_pairs = self._hklToAngles(h, k, l, wavelength)  # in rad
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/hkl/you/calc.py", line 384, in _hklToAngles
    psi, alpha, _ = self._calc_remaining_reference_angles(
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/hkl/you/calc.py", line 503, in _calc_remaining_reference_angles
    psi = acos(bound(cos_psi))
  File "/dls_sw/i16/software/gda_versions/gda_8.30/workspace_git/diffcalc.git/diffcalc/util.py", line 120, in bound
    raise AssertionError(
AssertionError: The value (23.058411) was unexpectedly too far outside -1 or 1 to safely bound. Please report this.

Change default sample base axis name from 'nu' to 'gam'

After an experiment with a three ton diffractometer with base axes called mu and nu I understand why scientists have not taken up H. You's name nu. The old behaviour can be configured by changing diffcalc.hkl.you.constraints.NUNAME to 'nu'

GDA: Axis constraint Scannables naming convention is unintuitive ('You' engine)

Where an axis (e.g. gamma) may be fixed by a constraint an <axis_name>_con Scannable is created rather than an <axis_name> Scannable in order to avoid a namespace clash with that axis' actual Scannable. This is unintuitive.

One solution is for Diffcalc to read up the last set value for an axis when that axes is constrained.

However if the axis is Scanned while hkl is held still this would result in two motor moves. This could be resolved by making the physical axis Scannables the same level as the hkl Scannable and treating them as a group, although this is a pretty heavy solution.

tp_lab throw exception - null

2017-08-09 15:36:15,263 DEBUG [RequestProcessor-4] gda.jython.logger.RedirectableFileLogger -  | >>> tp_lab  
2017-08-09 15:36:15,264 DEBUG [logback-1] gda.jython.GDAInteractiveConsole - GDA command: tp_lab  
2017-08-09 15:36:15,264 DEBUG [logback-1] gda.jython.GDAInteractiveConsole - Jython command: tp_lab  
2017-08-09 15:36:15,280 DEBUG [2017-08-09T15:36:15 : tp_lab] gda.jython.logger.RedirectableFileLogger -  | Traceback (most recent call last):  
2017-08-09 15:36:15,280 DEBUG [2017-08-09T15:36:15 : tp_lab] gda.jython.logger.RedirectableFileLogger -  |   File '<input>', line 1, in <module>  
2017-08-09 15:36:15,280 DEBUG [2017-08-09T15:36:15 : tp_lab] gda.jython.logger.RedirectableFileLogger -  |   File '/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/diffcalc/gdasupport/minigda/scannable.py', line 324, in __repr__  
2017-08-09 15:36:15,280 DEBUG [2017-08-09T15:36:15 : tp_lab] gda.jython.logger.RedirectableFileLogger -  |     pos = self.getPosition()  
2017-08-09 15:36:15,282 DEBUG [2017-08-09T15:36:15 : tp_lab] gda.jython.logger.RedirectableFileLogger -  | gda.device.DeviceException: exception in tp_lab.getPosition()  
2017-08-09 15:36:15,283 ERROR [logback-1] gda.jython.GDAInteractiveConsole - InteractiveConsole exception: exception in tp_lab.getPosition() org.python.core.PyException: null
	at org.python.core.Py.JavaError(Py.java:548)
	at org.python.core.Py.JavaError(Py.java:539)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
	at org.python.core.PyObject.__call__(PyObject.java:480)
	at org.python.core.PyObject.__call__(PyObject.java:484)
	at org.python.core.PyMethod.__call__(PyMethod.java:126)
	at diffcalc.gdasupport.minigda.scannable$py.__repr__$62(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/diffcalc/gdasupport/minigda/scannable.py:334)
	at diffcalc.gdasupport.minigda.scannable$py.call_function(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/diffcalc/gdasupport/minigda/scannable.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:139)
	at org.python.core.PyFunction.__call__(PyFunction.java:413)
	at org.python.core.PyMethod.__call__(PyMethod.java:126)
	at org.python.core.PyMethod.__call__(PyMethod.java:117)
	at org.python.core.PyObjectDerived.__repr__(PyObjectDerived.java:104)
	at org.python.core.PySystemState.displayhook(PySystemState.java:1438)
	at org.python.core.PySystemStateFunctions.__call__(PySystemState.java:1804)
	at org.python.core.PyObject.invoke(PyObject.java:3728)
	at org.python.core.Py.printResult(Py.java:2053)
	at org.python.pycode._pyx577.f$0(<input>:1)
	at org.python.pycode._pyx577.call_function(<input>)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1401)
	at org.python.core.Py.exec(Py.java:1445)
	at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)
	at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:131)
	at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:116)
	at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:50)
	at gda.jython.GDAInteractiveConsole.runsource(GDAInteractiveConsole.java:111)
	at gda.jython.GDAJythonInterpreter.runsource(GDAJythonInterpreter.java:632)
	at gda.jython.JythonServer$RunSourceRunner.run(JythonServer.java:1350)
Caused by: gda.device.DeviceException: exception in tp_lab.getPosition()
	at gda.device.scannable.ScannableBase.getPosition(ScannableBase.java:189)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
	... 29 common frames omitted
Caused by: org.python.core.PyException: null
	at org.python.core.Py.TypeError(Py.java:261)
	at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:209)
	at org.python.core.PyReflectedFunction.throwBadArgError(PyReflectedFunction.java:312)
	at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:321)
	at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructor.java:177)
	at org.python.core.PyObject.__call__(PyObject.java:438)
	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
	at org.python.core.PyMethod.__call__(PyMethod.java:228)
	at org.python.core.PyMethod.__call__(PyMethod.java:223)
	at org.python.core.Deriveds.dispatch__init__(Deriveds.java:19)
	at org.python.core.PyObjectDerived.dispatch__init__(PyObjectDerived.java:1112)
	at org.python.core.PyType.type___call__(PyType.java:1700)
	at org.python.core.PyType.__call__(PyType.java:1683)
	at org.python.core.PyObject.__call__(PyObject.java:480)
	at org.python.core.PyObject.__call__(PyObject.java:484)
	at numjy.jama_matrix_wrapper$py.__init__$2(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/numjy/jama_matrix_wrapper.py:44)
	at numjy.jama_matrix_wrapper$py.call_function(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/numjy/jama_matrix_wrapper.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:199)
	at org.python.core.PyFunction.__call__(PyFunction.java:482)
	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
	at org.python.core.PyMethod.__call__(PyMethod.java:228)
	at org.python.core.PyMethod.__call__(PyMethod.java:223)
	at org.python.core.Deriveds.dispatch__init__(Deriveds.java:19)
	at org.python.core.PyObjectDerived.dispatch__init__(PyObjectDerived.java:1112)
	at org.python.core.PyType.type___call__(PyType.java:1700)
	at org.python.core.PyType.__call__(PyType.java:1683)
	at org.python.core.PyObject.__call__(PyObject.java:480)
	at org.python.core.PyObject.__call__(PyObject.java:484)
	at startup.beamlinespecific.i21$py.calc_tp_lab$1(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py:51)
	at startup.beamlinespecific.i21$py.call_function(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
	at org.python.core.PyFunction.function___call__(PyFunction.java:471)
	at org.python.core.PyFunction.__call__(PyFunction.java:466)
	at org.python.core.PyFunction.__call__(PyFunction.java:456)
	at startup.beamlinespecific.i21$py.rawGetPosition$34(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py:321)
	at startup.beamlinespecific.i21$py.call_function(/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:199)
	at org.python.core.PyFunction.__call__(PyFunction.java:482)
	at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
	at org.python.core.PyMethod.__call__(PyMethod.java:228)
	at org.python.core.PyMethod.__call__(PyMethod.java:218)
	at org.python.core.PyMethod.__call__(PyMethod.java:213)
	at org.python.core.PyObject._jcallexc(PyObject.java:3645)
	at org.python.proxies.startup.beamlinespecific.i21$I21TPLab$79.rawGetPosition(Unknown Source)
	at gda.device.scannable.ScannableBase.getPosition(ScannableBase.java:186)
	... 34 common frames omitted
 

Replace 'saveubas' command with 'copyub'

Changes to the loaded ub calculation are saved automatically. The saveubas command is therefor confusing. copyub with one arg would copy the currently load ubcalc, and with two names, or a number and a name, would copy another one.

'pos tp_lab [1 2 3]' command failed inside GDA

pos tp_lab [1 2 3]
Traceback (most recent call last):
File "", line 1, in
File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py", line 330, in waitWhileBusy
self.self.sample_stage_scn.xyz_eta_scn.waitWhileBusy()
File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/diffcalc/gdasupport/minigda/scannable.py", line 408, in getattr
raise AttributeError("No child named:" + name)
AttributeError: No child named:self

zerosample failed.

>>> zerosample
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/i21.py", line 55, in zerosample
    sa.zerosample()
  File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py", line 194, in zerosample
    tp_phi = move_lab_origin_into_phi(chi, phi, xyz_eta_tuple)
  File "/scratch/gda_versions/gda_master2/workspace_git/diffcalc.git/startup/beamlinespecific/i21.py", line 63, in move_lab_origin_into_phi
    tp_phi = PHI.I * CHI.I * (-1 * xyz_eta)
TypeError: unsupported operand type(s) for *: 'int' and 'matrix'

TestScan.test__call__ failed

�[1m�[31m____________________________ TestScan.test__Call__ _____________________________�[0m

self = <test.diffcalc.gdasupport.minigda.test_command.TestScan object at 0x7f702b236fd0>

�[1m    def test__Call__(self):�[0m
�[1m        scn4 = SingleFieldDummyScannable('scn4')�[0m
�[1m        scn4.setLevel(4)�[0m
�[1m        scn5a = SingleFieldDummyScannable('scn5a')�[0m
�[1m        scn5a.setLevel(5)�[0m
�[1m        scn5b = SingleFieldDummyScannable('scn5b')�[0m
�[1m        scn5b.setLevel(5)�[0m
�[1m        scn6 = SingleFieldDummyScannable('scn6')�[0m
�[1m        scn6.setLevel(6)�[0m
�[1m>       self.scan.__call__(scn5a, 1, 3, 1, scn6, 1, scn5b, scn4)�[0m

�[1m�[31mtest/diffcalc/gdasupport/minigda/test_command.py�[0m:138: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
�[1m�[31mdiffcalc/gdasupport/minigda/command.py�[0m:217: in __call__
�[1m    self._performScan(groups, currentRecursionLevel=0)�[0m
�[1m�[31mdiffcalc/gdasupport/minigda/command.py�[0m:262: in _performScan
�[1m    self._performScan(groups, currentRecursionLevel + 1)�[0m
�[1m�[31mdiffcalc/gdasupport/minigda/command.py�[0m:272: in _performScan
�[1m    for handler in self.dataHandlers: handler.callWithScanPoint(posDict)�[0m
�[1m�[31mdiffcalc/gdasupport/minigda/command.py�[0m:169: in callWithScanPoint
�[1m    self.print_first_point(position_dict)�[0m

scan delta does not work inside GDA - it looks delta is not a scannable in GDA context

scan delta 40 90 10 hkl ct 1
Traceback (most recent call last):
File "", line 1, in
File "/scratch/gda_versions/gda_master2/workspace_git/gda-core.git/uk.ac.gda.core/scripts/gdascripts/scan/concurrentScanWrapper.py", line 114, in call
argStruct = self.parseArgsIntoArgStruct(args)
File "/scratch/gda_versions/gda_master2/workspace_git/gda-core.git/uk.ac.gda.core/scripts/gdascripts/scan/concurrentScanWrapper.py", line 198, in parseArgsIntoArgStruct
raise Exception("First argument to scan command must be a scannable")
Exception: First argument to scan command must be a scannable
delta
_fourc.delta : 66.4999418286

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.