xrayutilities.analysis package

Submodules

xrayutilities.analysis.line_cuts module

xrayutilities.analysis.line_cuts.get_omega_scan_ang(qx, qz, intensity, omcenter, ttcenter, omrange, npoints, **kwargs)[source]

extracts an omega scan from a gridded reciprocal space map

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
omcenter:omega-position at which the omega scan should be extracted
ttcenter:2theta-position at which the omega scan should be extracted
omrange:range of the omega scan to extract
npoints:number of points of the omega scan

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
Nint:number of subscans used for the integration (optionally)
lam:wavelength for use in the conversion to angular coordinates
relative:determines if absolute or relative omega positions are returned :(default: True)
bounds:flag to specify if the scan bounds should be returned :(default: False)
Returns:
om,omint:

omega scan coordinates and intensities (bounds=False)

om,omint,(qxb,qzb):
 omega scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>> omcut, intcut = get_omega_scan(qx,qz,intensity,0.0,5.0,2.0,200)
xrayutilities.analysis.line_cuts.get_omega_scan_bounds_ang(omcenter, ttcenter, omrange, npoints, **kwargs)[source]

return reciprocal space boundaries of omega scan

Parameters:

**omcenter: omega-position at which the omega scan should be extracted**

ttcenter:2theta-position at which the omega scan should be extracted
omrange:range of the omega scan to extract
npoints:number of points of the omega scan

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
lam:wavelength for use in the conversion to angular coordinates
Returns:
qx,qz:reciprocal space coordinates of the omega scan boundaries

Examples

>>> qxb,qzb = get_omega_scan_bounds_ang(1.0,4.0,2.4,240,qrange=0.1)
xrayutilities.analysis.line_cuts.get_omega_scan_q(qx, qz, intensity, qxcenter, qzcenter, omrange, npoints, **kwargs)[source]

extracts an omega scan from a gridded reciprocal space map

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
qxcenter:qx-position at which the omega scan should be extracted
qzcenter:qz-position at which the omega scan should be extracted
omrange:range of the omega scan to extract
npoints:number of points of the omega scan

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
Nint:number of subscans used for the integration (optionally)
lam:wavelength for use in the conversion to angular coordinates
relative:determines if absolute or relative omega positions are returned :(default: True)
bounds:flag to specify if the scan bounds should be returned; :(default: False)
Returns:
om,omint:

omega scan coordinates and intensities (bounds=False)

om,omint,(qxb,qzb):
 omega scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>> omcut, intcut = get_omega_scan(qx,qz,intensity,0.0,5.0,2.0,200)
xrayutilities.analysis.line_cuts.get_qx_scan(qx, qz, intensity, qzpos, **kwargs)[source]

extract qx line scan at position qzpos from a gridded reciprocal space map by taking the closest line of the intensity matrix, or summing up a given range along qz

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
qzpos:position at which the line scan should be extracted

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
qmin,qmax:minimum and maximum value of extracted scan axis
bounds:flag to specify if the scan bounds of the extracted scan should be returned (default:False)
Returns:
qx,qxint:

qx scan coordinates and intensities (bounds=False)

qx,qxint,(qxb,qyb):
 qx scan coordinates and intensities + scan bounds for plotting

Examples

>>> qxcut,qxcut_int = get_qx_scan(qx,qz,inten,5.0,qrange=0.03)
xrayutilities.analysis.line_cuts.get_qz_scan(qx, qz, intensity, qxpos, **kwargs)[source]

extract qz line scan at position qxpos from a gridded reciprocal space map by taking the closest line of the intensity matrix, or summing up a given range along qx

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
qxpos:position at which the line scan should be extracted

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
qmin,qmax:minimum and maximum value of extracted scan axis
Returns:
qz,qzint:qz scan coordinates and intensities

Examples

>>> qzcut,qzcut_int = get_qz_scan(qx,qz,inten,1.5,qrange=0.03)
xrayutilities.analysis.line_cuts.get_qz_scan_int(qx, qz, intensity, qxpos, **kwargs)[source]

extracts a qz scan from a gridded reciprocal space map with integration along omega (sample rocking angle) or 2theta direction

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
qxpos:position at which the line scan should be extracted

****kwargs: possible keyword arguments:**

angrange:integration range in angular direction
qmin,qmax:minimum and maximum value of extracted scan axis
bounds:flag to specify if the scan bounds of the extracted scan should be returned (default:False)
intdir:integration direction ‘omega’: sample rocking angle (default) ‘2theta’: scattering angle
wl:wavelength used to determine angular integration positions
Returns:
qz,qzint:

qz scan coordinates and intensities (bounds=False)

qz,qzint,(qzb,qzb):
 qz scan coordinates and intensities + scan bounds for plotting

Examples

>>> qzcut,qzcut_int = get_qz_scan_int(qx,qz,inten,5.0,omrange=0.3)
xrayutilities.analysis.line_cuts.get_radial_scan_ang(qx, qz, intensity, omcenter, ttcenter, ttrange, npoints, **kwargs)[source]

extracts a radial scan from a gridded reciprocal space map

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
omcenter:om-position at which the radial scan should be extracted
ttcenter:tt-position at which the radial scan should be extracted
ttrange:two theta range of the radial scan to extract
npoints:number of points of the radial scan

****kwargs: possible keyword arguments:**

omrange:integration range perpendicular to scan direction
Nint:number of subscans used for the integration (optionally)
lam:wavelength for use in the conversion to angular coordinates
relative:determines if absolute or relative two theta positions are returned (default=True)
bounds:flag to specify if the scan bounds should be returned :(default: False)
Returns:
om,tt,radint:

omega,two theta scan coordinates and intensities

(bounds=False)

om,tt,radint,(qxb,qzb):
 radial scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>> omc, ttc, cut_int = get_radial_scan_ang(qx, qz, intensity, 32.0, 64.0,
                                            30.0, 800, omrange = 0.2)
xrayutilities.analysis.line_cuts.get_radial_scan_bounds_ang(omcenter, ttcenter, ttrange, npoints, **kwargs)[source]

return reciprocal space boundaries of radial scan

Parameters:

**omcenter: om-position at which the radial scan should be extracted**

ttcenter:tt-position at which the radial scan should be extracted
ttrange:two theta range of the radial scan to extract
npoints:number of points of the radial scan

****kwargs: possible keyword arguments:**

omrange:integration range perpendicular to scan direction
lam:wavelength for use in the conversion to angular coordinates
Returns:
qxrad,qzrad:reciprocal space boundaries of radial scan

Examples

>>>
xrayutilities.analysis.line_cuts.get_radial_scan_q(qx, qz, intensity, qxcenter, qzcenter, ttrange, npoints, **kwargs)[source]

extracts a radial scan from a gridded reciprocal space map

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
qxcenter:qx-position at which the radial scan should be extracted
qzcenter:qz-position at which the radial scan should be extracted
ttrange:two theta range of the radial scan to extract
npoints:number of points of the radial scan

****kwargs: possible keyword arguments:**

omrange:integration range perpendicular to scan direction
Nint:number of subscans used for the integration (optionally)
lam:wavelength for use in the conversion to angular coordinates
relative:determines if absolute or relative two theta positions are returned (default=True)
bounds:flag to specify if the scan bounds should be returned :(default: False)
Returns:
om,tt,radint:

omega,two theta scan coordinates and intensities

(bounds=False)

om,tt,radint,(qxb,qzb):
 radial scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>> omc, ttc, cut_int = get_radial_scan_q(qx, qz, intensity, 0.0, 5.0,
                                          1.0, 100, omrange = 0.01)
xrayutilities.analysis.line_cuts.get_ttheta_scan_ang(qx, qz, intensity, omcenter, ttcenter, ttrange, npoints, **kwargs)[source]

extracts a twotheta scan from a gridded reciprocal space map

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
omcenter:om-position at which the 2theta scan should be extracted
ttcenter:tt-position at which the 2theta scan should be extracted
ttrange:two theta range of the scan to extract
npoints:number of points of the radial scan

****kwargs: possible keyword arguments:**

omrange:integration range in omega direction
Nint:number of subscans used for the integration (optionally)
lam:wavelength for use in the conversion to angular coordinates
relative:determines if absolute or relative two theta positions are returned (default=True)
bounds:flag to specify if the scan bounds should be returned :(default: False)
Returns:
tt,ttint:

two theta scan coordinates and intensities (bounds=False)

tt,ttint,(qxb,qzb):
 2theta scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>> ttc,cut_int = get_ttheta_scan_ang(qx,qz,intensity,32.0,64.0,4.0,400)
xrayutilities.analysis.line_cuts.get_ttheta_scan_bounds_ang(omcenter, ttcenter, ttrange, npoints, **kwargs)[source]

return reciprocal space boundaries of 2theta scan

Parameters:

**omcenter: om-position at which the 2theta scan should be extracted**

ttcenter:tt-position at which the 2theta scan should be extracted
ttrange:two theta range of the 2theta scan to extract
npoints:number of points of the 2theta scan

****kwargs: possible keyword arguments:**

omrange:integration range in omega direction
lam:wavelength for use in the conversion to angular coordinates
Returns:
qxtt,qztt:

reciprocal space boundaries of 2theta scan (bounds=False)

tt,ttint,(qxb,qzb):
 2theta scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>>
xrayutilities.analysis.line_cuts.get_ttheta_scan_q(qx, qz, intensity, qxcenter, qzcenter, ttrange, npoints, **kwargs)[source]

extracts a twotheta scan from a gridded reciprocal space map

Parameters:

**qx: equidistant array of qx momentum transfer**

qz:equidistant array of qz momentum transfer
intensity:2D array of gridded reciprocal space intensity with shape (qx.size,qz.size)
qxcenter:qx-position at which the 2theta scan should be extracted
qzcenter:qz-position at which the 2theta scan should be extracted
ttrange:two theta range of the scan to extract
npoints:number of points of the radial scan

****kwargs: possible keyword arguments:**

omrange:integration range in omega direction
Nint:number of subscans used for the integration (optionally)
lam:wavelength for use in the conversion to angular coordinates
relative:determines if absolute or relative two theta positions are returned (default=True)
bounds:flag to specify if the scan bounds should be returned :(default: False)
Returns:
tt,ttint:

two theta scan coordinates and intensities (bounds=False)

om,tt,radint,(qxb,qzb):
 radial scan coordinates and intensities + reciprocal space bounds of the extraced scan (bounds=True)

Examples

>>> ttc,cut_int = get_ttheta_scan_q(qx,qz,intensity,0.0,4.0,4.4,440)
xrayutilities.analysis.line_cuts.getindex(x, y, xgrid, ygrid)[source]

gives the indices of the point x,y in the grid given by xgrid ygrid xgrid,ygrid must be arrays containing equidistant points

Parameters:

**x,y: coordinates of the point of interest (float)**

xgrid,ygrid:grid coordinates in x and y direction (array)
Returns:
ix,iy:index of the closest gridpoint (lower left) of the point (x,y)

xrayutilities.analysis.line_cuts3d module

xrayutilities.analysis.line_cuts3d.get_qx_scan3d(gridder, qypos, qzpos, **kwargs)[source]

extract qx line scan at position y,z from a gridded reciprocal space map by taking the closest line of the intensity matrix, or summing up a given area around this position

Parameters:

**gridder: 3d xrayutilities.Gridder3D object containing the data**

qypos,qzpos:position at which the line scan should be extracted

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
qmin,qmax:minimum and maximum value of extracted scan axis
Returns:
qx,qxint:qx scan coordinates and intensities

Examples

>>> qxcut,qxcut_int = get_qx_scan3d(gridder,0,0,qrange=0.03)
xrayutilities.analysis.line_cuts3d.get_qy_scan3d(gridder, qxpos, qzpos, **kwargs)[source]

extract qy line scan at position x,z from a gridded reciprocal space map by taking the closest line of the intensity matrix, or summing up a given area around this position

Parameters:

**gridder: 3d xrayutilities.Gridder3D object containing the data**

qxpos,qzpos:position at which the line scan should be extracted

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
qmin,qmax:minimum and maximum value of extracted scan axis
Returns:
qy,qyint:qy scan coordinates and intensities

Examples

>>> qycut,qycut_int = get_qy_scan3d(gridder,0,0,qrange=0.03)
xrayutilities.analysis.line_cuts3d.get_qz_scan3d(gridder, qxpos, qypos, **kwargs)[source]

extract qz line scan at position x,y from a gridded reciprocal space map by taking the closest line of the intensity matrix, or summing up a given area around this position

Parameters:

**gridder: 3d xrayutilities.Gridder3D object containing the data**

qxpos,qypos:position at which the line scan should be extracted

****kwargs: possible keyword arguments:**

qrange:integration range perpendicular to scan direction
qmin,qmax:minimum and maximum value of extracted scan axis
Returns:
qz,qzint:qz scan coordinates and intensities

Examples

>>> qzcut,qzcut_int = get_qz_scan3d(gridder,0,0,qrange=0.03)
xrayutilities.analysis.line_cuts3d.getindex3d(x, y, z, xgrid, ygrid, zgrid)[source]

gives the indices of the point x,y,z in the grid given by xgrid ygrid zgrid xgrid,ygrid,zgrid must be arrays containing equidistant points

Parameters:

**x, y, z: coordinates of the point of interest (float)**

xgrid, ygrid, zgrid: grid coordinates in x, y, z direction (array)

Returns:

ix, iy, iz: index of the closest gridpoint (lower left) of the point

(x, y, z)

xrayutilities.analysis.misc module

miscellaneous functions helpful in the analysis and experiment

xrayutilities.analysis.misc.getangles(peak, sur, inp)[source]

calculates the chi and phi angles for a given peak

Parameters:

**peak: array which gives hkl for the peak of interest**

sur:hkl of the surface
inp:inplane reference peak or direction
Returns:

[chi,phi] for the given peak on surface sur with inplane direction inp

as reference

Examples

To get the angles for the -224 peak on a 111 surface type
[chi,phi] = getangles([-2,2,4],[1,1,1],[2,2,4])

xrayutilities.analysis.sample_align module

functions to help with experimental alignment during experiments, especially for experiments with linear and area detectors

xrayutilities.analysis.sample_align.area_detector_calib(angle1, angle2, ccdimages, detaxis, r_i, plot=True, cut_off=0.7, start=(None, None, 1, 0, 0, 0, 0), fix=(False, False, True, False, False, False, False), fig=None, wl=None, plotlog=False, nwindow=50, debug=False)[source]

function to calibrate the detector parameters of an area detector it determines the detector tilt possible rotations and offsets in the detector arm angles

Parameters:

**angle1 ..... outer detector arm angle**

angle2:inner detector arm angle
ccdimages:images of the ccd taken at the angles given above
detaxis:detector arm rotation axis :default: [‘z+’,’y-‘]
r_i:primary beam direction [xyz][+-] default ‘x+’

**keyword_arguments:**

plot:flag to determine if results and intermediate results should be plotted; default: True
cut_off:cut off intensity to decide if image is used for the determination or not; default: 0.7 = 70%
start:sequence of start values of the fit for parameters, which can not be estimated automatically or might want to be fixed. These are: pwidth1, pwidth2, distance, tiltazimuth, tilt, detector_rotation, outerangle_offset. By default (None, None, 1, 0, 0, 0, 0) is used.
fix:fix parameters of start :(default: (False, False, True, False, False, False, False)) It is strongly recommended to either fix the distance or the pwidth1,2 values.
fig:matplotlib figure used for plotting the error :default: None (creates own figure)
wl:wavelength of the experiment in Angstrom (default: config.WAVELENGTH) value does not really matter here but does affect the scaling of the error
plotlog:flag to specify if the created error plot should be on log-scale
nwindow:window size for determination of the center of mass position after the center of mass of every full image is determined, the center of mass is determined again using a window of size nwindow in order to reduce the effect of hot pixels.
debug:flag to specify that you want to see verbose output and saving of images to show if the CEN determination works
xrayutilities.analysis.sample_align.area_detector_calib_hkl(sampleang, angle1, angle2, ccdimages, hkls, experiment, material, detaxis, r_i, plot=True, cut_off=0.7, start=(None, None, 1, 0, 0, 0, 0, 0, 0, 'config'), fix=(False, False, True, False, False, False, False, False, False, False), fig=None, plotlog=False, nwindow=50, debug=False)[source]

function to calibrate the detector parameters of an area detector it determines the detector tilt possible rotations and offsets in the detector arm angles

in this variant not only scans through the primary beam but also scans at a set of symmetric reflections can be used for the detector parameter determination. for this not only the detector parameters but in addition the sample orientation and wavelength need to be fit. Both images from the primary beam hkl = (0,0,0) and from a symmetric reflection hkl = (h,k,l) need to be given for a successful run.

Parameters:

**sampleang .. sample rocking angle (needed to align the reflections (same**

rotation direction as inner detector rotation)) other sample angle are not allowed to be changed during the scans

angle1:outer detector arm angle
angle2:inner detector arm angle
ccdimages:images of the ccd taken at the angles given above
hkls:array/list of hkl values for every image
experiment:Experiment class object needed to get the UB matrix for the hkl peak treatment
material:material used as reference crystal
detaxis:detector arm rotation axis :default: [‘z+’,’y-‘]
r_i:primary beam direction [xyz][+-] default ‘x+’

**keyword_arguments:**

plot:flag to determine if results and intermediate results should be plotted. default: True
cut_off:cut off intensity to decide if image is used for the determination or not. default: 0.1 = 10%
start:sequence of start values of the fit for parameters, which can not be estimated automatically or might want to be fixed. These are: pwidth1, pwidth2, distance, tiltazimuth, tilt, detector_rotation, outerangle_offset, sampletilt, sampletiltazimuth, wavelength. By default (None, None, 1, 0, 0, 0, 0, 0, 0, ‘config’).
fix:fix parameters of start (default: (False, False, True, False, False, False, False, False, False, False)) It is strongly recommended to either fix the distance or the pwidth1,2 values.
fig:matplotlib figure used for plotting the error. :default: None (creates own figure)
plotlog:flag to specify if the created error plot should be on log-scale
nwindow:window size for determination of the center of mass position after the center of mass of every full image is determined, the center of mass is determined again using a window of size nwindow in order to reduce the effect of hot pixels.
debug:flag to tell if you want to see debug output of the script (switch this to true only if you can handle it :))
xrayutilities.analysis.sample_align.fit_bragg_peak(om, tt, psd, omalign, ttalign, exphxrd, frange=(0.03, 0.03), peaktype='Gauss', plot=True)[source]

helper function to determine the Bragg peak position in a reciprocal space map used to obtain the position needed for correction of the data. the determination is done by fitting a two dimensional Gaussian (xrayutilities.math.Gauss2d) or Lorentzian (xrayutilities.math.Lorentz2d)

PLEASE ALWAYS CHECK THE RESULT CAREFULLY!

Parameters:

**om,tt: angular coordinates of the measurement (numpy.ndarray)**

either with size of psd or of psd.shape[0]

psd:intensity values needed for fitting
omalign:aligned omega value, used as first guess in the fit
ttalign:aligned two theta values used as first guess in the fit these values are also used to set the range for the fit: the peak should be within +/-frangeAA^{-1} of those values
exphxrd:experiment class used for the conversion between angular and reciprocal space.
frange:data range used for the fit in both directions (see above for details default:(0.03,0.03) unit: AA^{-1})
peaktype:can be ‘Gauss’ or ‘Lorentz’ to fit either of the two peak shapes
plot:if True (default) function will plot the result of the fit in comparison with the measurement.
Returns:
omfit,ttfit,params,covariance:
 

fitted angular values, and the fit

parameters (of the Gaussian/Lorentzian) as well as their errors

xrayutilities.analysis.sample_align.linear_detector_calib(angle, mca_spectra, **keyargs)[source]

function to calibrate the detector distance/channel per degrees for a straight linear detector mounted on a detector arm

Parameters:

**angle: array of angles in degree of measured detector spectra**

mca_spectra:corresponding detector spectra :(shape: (len(angle), Nchannels)

**keyword arguments:**

r_i:primary beam direction as vector [xyz][+-]; default: ‘y+’
detaxis:detector arm rotation axis [xyz][+-]; default: ‘x+’

**other options are passed to psd_chdeg function, options include:**

plot:flag to specify if a visualization of the fit should be done
usetilt:whether to use model considering a detector tilt, i.e. deviation angle of the pixel direction from orthogonal to the primary beam) (default: True)

**Note: see help of psd_chdeg for more options**

Returns:

pixelwidth (at one meter distance), center_channel[, detector_tilt]

Note

Note: L/pixelwidth*pi/180 ~= channel/degree, with the sample detector

distance L

pixelwidth is negative in case the hit channel number decreases upon an

increase of the detector angle The function also prints out how a linear

detector can be initialized using the results obtained from this

calibration. Carefully check the results

xrayutilities.analysis.sample_align.miscut_calc(phi, aomega, zeros=None, omega0=None, plot=True)[source]

function to calculate the miscut direction and miscut angle of a sample by fitting a sinusoidal function to the variation of the aligned omega values of more than two reflections. The function can also be used to fit reflectivity alignment values in various azimuths.

Parameters:

**phi: azimuths in which the reflection was aligned (deg)**

aomega:aligned omega values (deg)
zeros:(optional) angles at which surface is parallel to the beam (deg). For the analysis the angles (aomega-zeros) are used.
omega0:if specified the nominal value of the reflection is not included as fit parameter, but is fixed to the specified value. This value is MANDATORY if ONLY TWO AZIMUTHs are given.
plot:flag to specify if a visualization of the fit is wanted. :default: True
Returns:

[omega0,phi0,miscut]

list with fitted values for

omega0:the omega value of the reflection should be close to the nominal one
phi0:the azimuth in which the primary beam looks upstairs
miscut:amplitude of the sinusoidal variation == miscut angle
xrayutilities.analysis.sample_align.psd_chdeg(angles, channels, stdev=None, usetilt=True, plot=True, datap='kx', modelline='r--', modeltilt='b-', fignum=None, mlabel='fit', mtiltlabel='fit w/tilt', dlabel='data', figtitle=True)[source]

function to determine the channels per degree using a linear fit of the function nchannel = center_ch+chdeg*tan(angles) or the equivalent including a detector tilt

Parameters:

**angles: detector angles for which the position of the beam was**

measured

channels:detector channels where the beam was found

**keyword arguments:**

stdev:standard deviation of the beam position
plot:flag to specify if a visualization of the fit should be done
usetilt:whether to use model considering a detector tilt, i.e. deviation angle of the pixel direction from orthogonal to the primary beam :(default: True)
datap:plot format of data points
modelline:plot format of modelline
modeltilt:plot format of modeltilt
fignum:figure number to use for the plot
mlabel:label of the model w/o tilt to be used in the plot
mtiltlabel:label of the model with tilt to be used in the plot
dlabel:label of the data line to be used in the plot
figtitle:boolean to tell if the figure title should show the fit parameters
Returns:

(pixelwidth,centerch,tilt)

pixelwidth:

the width of one detector channel @ 1m distance, which is

negative in case the hit channel number decreases upon an increase of the detector angle.

centerch:

center channel of the detector

tilt:

tilt of the detector from perpendicular to the beam

(will be zero in case of usetilt=False)

Note

Note:

L/pixelwidth*pi/180 = channel/degree for large detector distance with the sample detector disctance L

xrayutilities.analysis.sample_align.psd_refl_align(primarybeam, angles, channels, plot=True)[source]

function which calculates the angle at which the sample is parallel to the beam from various angles and detector channels from the reflected beam. The function can be used during the half beam alignment with a linear detector.

Parameters:

**primarybeam** : primary beam channel number

angles:list or numpy.array with angles
channels:list or numpy.array with corresponding detector channels
plot:flag to specify if a visualization of the fit is wanted :default: True
Returns:

**omega** : angle at which the sample is parallel to the beam

Examples

>>> psd_refl_align(500,[0,0.1,0.2,0.3],[550,600,640,700])

Module contents

xrayutilities.analysis is a package for assisting with the analysis of x-ray diffraction data, mainly reciprocal space maps

Routines for obtaining line cuts from gridded reciprocal space maps are offered, with the ability to integrate the intensity perpendicular to the line cut direction.