PyMcaPhysics Package

PyMcaPhysics Package

SixCircle Module

Methods to convert single point or complete images to reciprocal space. It is fully vectorized and therefore very fast for converting complete images.

class PyMca5.PyMcaPhysics.SixCircle.SixCircle[source]

Bases: object

getChiMatrix(chi)[source]
Parameters:chi (float) – the chi angle in degree
Returns:the rotation matrix of the chi
Return type:numpy.ndarray
getDeltaMatrix(delta)[source]
Parameters:delta (float) – the delta angle in Degree
Returns:the rotation matrix of the delta axis
Return type:numpy.ndarray
getEnergy()[source]
Returns:the energy in KeV
Return type:float
getGammaMatrix(gamma)[source]
Parameters:gamma (float) – the gamma angle in Degree
Returns:the rotation matrix of the gamma axis
Return type:numpy.ndarray
getHKL(phi=0.0, chi=0.0, theta=0.0, mu=0.0, delta=0.0, gamma=0.0, gamma_first=False)[source]
Parameters:
  • phi (float) – angle in Degrees
  • chi (float) – angle in Degrees
  • theta (float) – angle in Degrees
  • mu (float) – angle in Degrees
  • delta (float or numpy.ndarray) – angle in Degrees
  • gamma (float or numpy.ndarray) – angle in Degrees
  • gamma_first (boolean) – if delta and gamma are arrays, which one variates first.
Returns:

HKL values for all the given delta, gamma values

getLambda()[source]
Returns:the wavelength in Angstroms
Return type:float
getMuMatrix(mu)[source]
Parameters:mu (float) – the mu angle in degree
Returns:the rotation matrix of the mu axis
Return type:numpy.ndarray
getPhiMatrix(phi)[source]
Parameters:phi (float) – the phi angle in degree
Returns:the rotation matrix of the phi axis for a given angle
Return type:numpy.ndarray
getQLab(mu=0.0, delta=0.0, gamma=0.0, gamma_first=False)[source]
Parameters:
  • mu (float) – angle in Degrees
  • delta (float or numpy.ndarray) – angle in Degrees
  • gamma (float or numpy.ndarray) – angle in Degrees
  • gamma_first (boolean) – if delta and gamma are arrays, which one variates first.
Returns:

the Q coordinates in the Lab system

Return type:

numpy.ndarray ()

Q = Kf - Ki = (2 * pi / lambda) * (MU DELTA GAMMA - I) * (0, 1, 0)

This gives (transforming angles to radians):

(2*pi/lambda) * ( sin(delta) cos(gamma),
cos(mu) cos(delta) cos(gamma) - sin(mu) sin(gamma) - 1, sin(mu) cos(delta) cos(gamma) + cos(mu) sin(gamma))

or, in terms of DG = numpy.dot(DELTA, GAMMA):

(2*pi/lambda) * ( DG[0,1],
cos(mu)* DG[1,1] - sin(mu) * DG[2,1] - 1 sin(mu)* DG[1,1] + cos(mu) * DG[2,1])
getQMu(phi=0.0, chi=0.0, theta=0.0, mu=0.0, delta=0.0, gamma=0.0, gamma_first=False)[source]
Parameters:
  • phi (float) – angle in Degrees
  • chi (float) – angle in Degrees
  • theta (float) – angle in Degrees
  • mu (float) – angle in Degrees
  • delta (float or numpy.ndarray) – angle in Degrees
  • gamma (float or numpy.ndarray) – angle in Degrees
  • gamma_first (boolean) – if delta and gamma are arrays, which one variates first.
Returns:

Q coordinates for all the given delta, gamma values

Return type:

numpy.ndarray (len(delta), len(gamma), 3)

getQSurface(phi=0.0, chi=0.0, theta=0.0, mu=0.0, delta=0.0, gamma=0.0, gamma_first=False)[source]
Parameters:
  • phi (float) – angle in Degrees
  • chi (float) – angle in Degrees
  • theta (float) – angle in Degrees
  • mu (float) – angle in Degrees
  • delta (float or numpy.ndarray) – angle in Degrees
  • gamma (float or numpy.ndarray) – angle in Degrees
  • gamma_first (boolean) – if delta and gamma are arrays, which one variates first.
Returns:

Q values for all the given delta, gamma values

This is only true if the diffractometer has been properly aligned.

getThetaMatrix(th)[source]
Parameters:th (float) – the theta angle in Degree
Returns:the rotation matrix of the theta axis
Return type:numpy.ndarray
getUB()[source]
Returns:the ub matrix element values
Return type:list(float)
setEnergy(energy)[source]
Parameters:energy (float) – the energy to set in KeV
setLambda(value)[source]
Parameters:value (float) – the wavelength to set in Angstroms
setUB(ublist)[source]
Parameters:ublist (list, tuple or array to convert to a 3x3 matrix) – the ub matrix element values
update()[source]

compute K from the wavelength value

PyMca5.PyMcaPhysics.SixCircle.getHKL(wavelength, ub, phi=0.0, chi=0.0, theta=0.0, mu=0.0, delta=0.0, gamma=0.0, gamma_first=False)[source]

A convenience function that takes the whole input in one go.

Parameters:
  • wavelength (float) – the wavelength in Angstroms
  • ub (list(float)) – the ub matrix element values
  • phi (float) – angle in Degrees
  • chi (float) – angle in Degrees
  • theta (float) – angle in Degrees
  • mu (float) – angle in Degrees
  • delta (float or numpy.ndarray) – angle in Degrees
  • gamma (float or numpy.ndarray) – angle in Degrees
  • gamma_first (boolean) – if delta and gamma are arrays, which one variates first.
Returns:

HKL values for all the given delta, gamma values

PyMca5.PyMcaPhysics.SixCircle.main()[source]