a+ mode ICP 'Q' bufer to Q(h,k,l),E
============================

Input file is an ICP 'Q' buffer containing scan in h,k,l,E. At each data
point, a PSD records the intensity at 256 horizontal pixels (integration is
performed along the vertical pixels).

The h,k,l,E values are the norminal values (ho,ko,lo,Eo) for each data point. 
We need to determine the h,k,l,E (Q,E for a powder) values at each pixel. A
calibration file (containing final energy and efficiency for each pixel) is
required to perform the calculations/transformation.

Powder
======

Aim: calc (Qp,Ep) for dataset (I buffer)

Qp:

Efp from calib file
Calc A5p from Efp	
delA4p = A5o - A5p where A5o from data file
A4p = delA4p + A4o where A4o from data file
calc Qp from A4p {Qp = ki2 + kf2 - 2kikfcos(a4p)}

Ep:

Efp from calib file
Eio from data file (calc from A2o)

Ep = Eio - Efp


Energy Calculations
==================
* Require energy transfer at each pixel.

* For each data point, we know:
  - the norminal fixed final energy (NB on SPINS, the PSD is always run in
  fixed final energy mode in order to avoid moving the PSD). This Efo is the
  same for the whole dataset.
  - know the norminal energy transfer (Eo) for that data point

* ==> can determine the norminal Ei (Eio) for each data point using
        Eio = Efo + Efo

* Need to find the energy transfer at each pixel (Ep).
  - Read final energy at each pixel (Efp) from the calibration file.

  ==> Ep = Eio - Efp
____________________________________________________________________________

Q & h,k,l Calculations
======================

* Require momentum transfer at each pixel. For powders, only Q is possible
  and for single xtals, h,k,l can be determined also.

* At each data point, we know
  - the norminal  