Sample

Sample.Sample

Sample object to store all information of the sample from the experiment

Sample.Sample.__init__

Sample.Sample.initialize

Initialize the Sample object.

Sample.Sample.calculateProjections

Calculate projections and generate projection angles.

Sample.Sample.tr

Convert from projX, projY coordinate to Qx,QY coordinate.

Sample.Sample.inv_tr

Convert from Qx,QY coordinate to projX, projY coordinate.

Sample.Sample.format_coord

Format coordinates from QxQy in rotated frame into HKL.

Sample.Sample.calculateQxQyToHKL

convert from Qx,Qy to HKL.

Sample.Sample.calculateHKLToQxQy

convert HKL to Qx,Qy.

Sample.Sample.calculateHKLtoProjection

convert from projections to HKL.

Sample.Sample.CurratAxe

Function to calculate Currat-Axe position in QxQy coordinate system.

Sample Object and Methods

class Sample.Sample(a=6.283185307179586, b=6.283185307179586, c=6.283185307179586, alpha=90, beta=90, gamma=90, sample=None, name='Unknown', projectionVector1=None, projectionVector2=None, recalculateUB=False)[source]

Sample object to store all information of the sample from the experiment

__init__(a=6.283185307179586, b=6.283185307179586, c=6.283185307179586, alpha=90, beta=90, gamma=90, sample=None, name='Unknown', projectionVector1=None, projectionVector2=None, recalculateUB=False)[source]
CurratAxe(Ei, Ef, Bragg, spurionType='Monochromator', HKL=False, Projection=False)[source]

Function to calculate Currat-Axe position in QxQy coordinate system.

Parameters
  • Ei (-) – Incoming energy in meV.

  • Ef (-) – Outgoing energy in meV.

  • Bragg (-) – Bragg peak in HKL or list of.

Kwargs:

  • spurionType (str): Either “Monochromator” or “Analyser” for origin of “wrong” energy (default “Monochromator”).

  • HKL (bool): Whether or not to recalculate to HKL instead of Qx, Qy, Qz (default False).

  • Projection (Bool): Whether or not to recalculate to Projection vectors instead of Qx, Qy, Qz (default False).

Returns

List of size (len(Bragg),len(Ei),len(Ef),3), where last axis is Qx, Qy, Qz

Return type

  • Position (list)

calculateHKLToQxQy(H, K, L)[source]

convert HKL to Qx,Qy.

calculateHKLtoProjection(H, K, L)[source]

convert from projections to HKL.

calculateProjections()[source]

Calculate projections and generate projection angles.

calculateQxQyToHKL(x, y)[source]

convert from Qx,Qy to HKL.

format_coord(x, y)[source]

Format coordinates from QxQy in rotated frame into HKL.

initialize()[source]

Initialize the Sample object. Automatically called during __init__method.

inv_tr(x, y)[source]

Convert from Qx,QY coordinate to projX, projY coordinate.

tr(p0, p1)[source]

Convert from projX, projY coordinate to Qx,QY coordinate.

updateCell(unitCell=None)[source]

Update cell parameters with current unit cell values.

Kwargs:

  • unitCell (list): List of a,b,c,alpha,beta,gamma. If None, use self.unitCell (default None)

updateSampleParameters(unitCell)[source]

Update the sample parameters and change UB matrix as well.

Parameters

unitCell (-) – List of cell parameters. If None use self.unitCell