hexrd.instrument.planar_detector module

class hexrd.instrument.planar_detector.PlanarDetector(**detector_kwargs)[source]

Bases: Detector

Base class for 2D planar, rectangular row-column detector

angles_to_cart(tth_eta, rmat_s=None, tvec_s=None, rmat_c=None, tvec_c=None, apply_distortion=False)[source]

Transform angular coordinates to cartesian.

Parameters

tth_etaarray_like

The (n, 2) array of n (tth, eta) coordinates to be transformed.

rmat_sarray_like, optional

The (3, 3) COB matrix for the sample frame. The default is None.

tvec_sarray_like, optional

The (3, ) translation vector for the sample frame. The default is None.

rmat_carray_like, optional

(3, 3) COB matrix for the crystal frame. The default is None.

tvec_carray_like, optional

The (3, ) translation vector for the crystal frame. The default is None.

apply_distortionbool, optional

If True, apply distortion to take cartesian coordinates to the “warped” configuration. The default is False.

Returns

xy_detarray_like

The (n, 2) array on the n input coordinates in the .

property beam_position

returns the coordinates of the beam in the cartesian detector frame {Xd, Yd, Zd}. NaNs if no intersection.

cart_to_angles(xy_data, rmat_s=None, tvec_s=None, tvec_c=None, apply_distortion=False)[source]

Transform cartesian coordinates to angular.

Parameters

xy_dataTYPE

The (n, 2) array of n (x, y) coordinates to be transformed in either the raw or ideal cartesian plane (see apply_distortion kwarg below).

rmat_sarray_like, optional

The (3, 3) COB matrix for the sample frame. The default is None.

tvec_sarray_like, optional

The (3, ) translation vector for the sample frame. The default is None.

tvec_carray_like, optional

The (3, ) translation vector for the crystal frame. The default is None.

apply_distortionbool, optional

If True, apply distortion to the inpout cartesian coordinates. The default is False.

Returns

tth_etaTYPE

DESCRIPTION.

g_vecTYPE

DESCRIPTION.

cart_to_dvecs(xy_data)[source]

Convert cartesian coordinates to dvectors

property detector_type
pixel_angles(origin=array([0., 0., 0.]))[source]
pixel_eta_gradient(origin=array([0., 0., 0.]))[source]
property pixel_solid_angles
pixel_tth_gradient(origin=array([0., 0., 0.]))[source]
static update_memoization_sizes(all_panels)[source]