NSLS-II / wishlist

an issue tracker for the big picture
1 stars 0 forks source link

Test HKL scan capability #12

Closed danielballan closed 8 years ago

danielballan commented 9 years ago

It looks like @klauer did the hard parts. We just need to test this. (Haha, "just.") We also need to think about what we want from the user API.

See https://github.com/klauer/conda-prescriptions/tree/master/hkl

@licode is taking point on this.

ericdill commented 9 years ago

Notes from working on building hkl

Installing hkl
--------------
library: https://github.com/picca/hkl

Installation notes
==================
install gobject-introspection
install libgtkmm-3.0-dev
install libgtk2.0-dev
install libyaml-dev:amd64
install povray (1:3.7.0.0-8)
install asymptote
install libg3d-dbg
install libg3d-doc
install libg3d-plugin-gdkpixbuf
conda install pygtk
install flex
install bison

#. ./autogen.sh
#. ./configure --prefix=/home/edill/local-installs
#. make
#. make install
   #. Installs to /home/edill/local-installs/

build the docs

sudo apt-get install texlive-latex-extra

#. ./configure --enable-gtk-doc
#. make
#. make html
   #. Dumps html docs to /home/edill/local-installs/share/doc/hkl/hkl.html

hkl install after conda binary is built
=======================================
#. conda create -n hkl python=2
#. source activate hkl
#. conda install -c https://conda.nsls2.bnl.gov/conda/edill hkl
#. conda install ipython
#. conda install pygobject3

building hkl packages with conda
================================
#. Use the recipes here: https://github.com/pkgw/conda-recipes
#. sudo apt-get install libffi-dev
#. build glib
#. build gobject-introspection
#.

building hkl dependencies with conda on debian 7
================================================
ericdill commented 9 years ago

Notes from talking with @klauer

Ken's HKL implementation
------------------------

You can do HKL calculations in the ``CalcRecip``

gobject introspection (can autogenerate wrappers for multiple different
                       languages)

_create_classes instantiates a bunch of various diffractometers

- Calc{{name}} and Diff{{name}} are object that do HKL forward and reverse
  calculations and then pseudopositioners that can move the hardware

- there are a bunch of engines that can be used to do calculations. 'hkl' is
  one of the engines and there are an undetermined amount of engines (all are
  written in the C library

- in the pseudopositioner, pick the first solution or give it a function that
  decides which one to choose

- never figured out how to deal with energy. Energy is a class attribute for
  the diffractometer. The diffractometer also has an energy signal.

Actually testing this stuff
---------------------------
- Stuart has a copy of spec lying around, one testing option would be to
  drive the diffractometer with spec and then drive it with the Ophyd hkl
  version and then compare the trajectories
- According to @stuwilkins, Vivek has a copy of spec on a computer in
  condensed matter physics
- Also according to @stuwilkins he **might** have a debian VM with spec on it
  on his old laptop.

Surveying this HKL stuff
------------------------
- What is the current state of the ophyd hkl API and what should it look like?
- Send @dchabot an email about HKL C library (see trajectory.py)
- ``compute_trajectories`` function

@stuwilkins CSX-1 Endstation is a 6-circle Eularian endstation in spec
mode 16 with chi phi and mu fixed
danielballan commented 9 years ago

Diffractometer object: https://github.com/NSLS-II/ophyd/tree/hkl libhkl conda recipe: https://github.com/klauer/conda-prescriptions/commits/master

dchabot commented 9 years ago

Referring to @ericdill's notes:

klauer commented 9 years ago

Some further progress on the conda build. I started mostly from scratch: https://github.com/klauer/conda-prescriptions/tree/hkl Assumes usage of this binstar channel: https://conda.binstar.org/pkgw/

Problem now is Python 3 incompatibility in the packaged version of gobject-introspection. Will have to rebuild it. I don't have too much time to spare for this with beam coming back next week, so any help would be appreciated, especially on the conda side.

tacaswell commented 9 years ago

https://bugzilla.gnome.org/show_bug.cgi?id=679438 <- unmerged upstream fixes. Working on getting a github repo with that stack of commits applied.

tacaswell commented 9 years ago

As a follow up, the upstream fixes to gobject have been accepted and merged, need to test re-building again.

klauer commented 8 years ago

hklpy exists and works at least reasonably well for CSX. Closing this old issue for now.