9. GSASIIimage: Image calc module¶
Ellipse fitting & image integration
-
GSASIIimage.
DoPolaCalib
(ImageZ, imageData, arcTth)[source]¶ Determine image polarization by successive integrations with & without preset arc mask. After initial search, does a set of five with offset azimuth to get mean(std) result.
-
GSASIIimage.
EdgeFinder
(image, data)[source]¶ this makes list of all x,y where I>edgeMin suitable for an ellipse search? Not currently used but might be useful in future?
-
GSASIIimage.
FitDetector
(rings, varyList, parmDict, Print=True, covar=False)[source]¶ Fit detector calibration parameters
Parameters: - rings (np.array) – vector of ring positions
- varyList (list) – calibration parameters to be refined
- parmDict (dict) – all calibration parameters
- Print (bool) – set to True (default) to print the results
- covar (bool) – set to True to return the covariance matrix (default is False)
Returns: [chisq,vals,sigList] unless covar is True, then [chisq,vals,sigList,coVarMatrix] is returned
-
GSASIIimage.
FitMultiDist
(rings, varyList, parmDict, Print=True, covar=False)[source]¶ Fit detector calibration parameters with multi-distance data
Parameters: - rings (np.array) – vector of ring positions (x,y,dist,d-space)
- varyList (list) – calibration parameters to be refined
- parmDict (dict) – calibration parameters
- Print (bool) – set to True (default) to print the results
- covar (bool) – set to True to return the covariance matrix (default is False)
Returns: [chisq,vals,sigDict] unless covar is True, then [chisq,vals,sigDict,coVarMatrix] is returned
-
GSASIIimage.
GetAzm
(x, y, data)[source]¶ Give azimuth value for detector x,y position; calibration info in data
-
GSASIIimage.
GetDetXYfromThAzm
(Th, Azm, data)[source]¶ Computes a detector position from a 2theta angle and an azimultal angle (both in degrees) - apparently not used!
-
GSASIIimage.
GetDetectorXY
(dsp, azm, data)[source]¶ Get detector x,y position from d-spacing (dsp), azimuth (azm,deg) & image controls dictionary (data) - new version it seems to be only used in plotting
-
GSASIIimage.
GetDetectorXY2
(dsp, azm, data)[source]¶ Get detector x,y position from d-spacing (dsp), azimuth (azm,deg) & image controls dictionary (data) it seems to be only used in plotting
-
GSASIIimage.
GetDsp
(x, y, data)[source]¶ Give d-spacing value for detector x,y position; calibration info in data
-
GSASIIimage.
GetEllipse
(dsp, data)[source]¶ uses Dandelin spheres to find ellipse or hyperbola parameters from detector geometry as given in image controls dictionary (data) and a d-spacing (dsp)
-
GSASIIimage.
GetEllipse2
(tth, dxy, dist, cent, tilt, phi)[source]¶ uses Dandelin spheres to find ellipse or hyperbola parameters from detector geometry on output radii[0] (b-minor axis) set < 0. for hyperbola
-
GSASIIimage.
GetTth
(x, y, data)[source]¶ Give 2-theta value for detector x,y position; calibration info in data
-
GSASIIimage.
GetTthAzm
(x, y, data)[source]¶ Give 2-theta, azimuth values for detector x,y position; calibration info in data
-
GSASIIimage.
GetTthAzmDsp
(x, y, data)[source]¶ Computes a 2theta, etc. from a detector position and calibration constants - checked OK for ellipses & hyperbola. Use for detector 2-theta != 0.
Returns: np.array(tth,azm,G,dsp) where tth is 2theta, azm is the azimutal angle, G is ? and dsp is the d-space
-
GSASIIimage.
GetTthAzmDsp2
(x, y, data)[source]¶ Computes a 2theta, etc. from a detector position and calibration constants - checked OK for ellipses & hyperbola. Use only for detector 2-theta = 0
Returns: np.array(tth,azm,G,dsp) where tth is 2theta, azm is the azimutal angle, G is ? and dsp is the d-space
-
GSASIIimage.
GetTthAzmG
(x, y, data)[source]¶ Give 2-theta, azimuth & geometric corr. values for detector x,y position; calibration info in data - only used in integration for detector 2-theta != 0. checked OK for ellipses & hyperbola This is the slow step in image integration
-
GSASIIimage.
GetTthAzmG2
(x, y, data)[source]¶ Give 2-theta, azimuth & geometric corr. values for detector x,y position; calibration info in data - only used in integration for detector 2-theta = 0
-
GSASIIimage.
ImageCalibrate
(G2frame, data)[source]¶ Called to perform an initial image calibration after points have been selected for the inner ring.
-
GSASIIimage.
ImageCompress
(image, scale)[source]¶ Reduces size of image by selecting every n’th point param: image array: original image param: scale int: intervsl between selected points returns: array: reduced size image
-
GSASIIimage.
ImageIntegrate
(image, data, masks, blkSize=128, returnN=False, useTA=None, useMask=None)[source]¶ Integrate an image; called from OnIntegrateAll and OnIntegrate in G2imgGUI
-
GSASIIimage.
ImageRecalibrate
(G2frame, ImageZ, data, masks, getRingsOnly=False)[source]¶ Called to repeat the calibration on an image, usually called after calibration is done initially to improve the fit.
Parameters: - G2frame – The top-level GSAS-II frame or None, to skip plotting
- ImageZ (np.Array) – the image to calibrate
- data (dict) – the Controls dict for the image
- masks (dict) – a dict with masks
Returns: a list containing vals,varyList,sigList,parmDict,covar or rings (with an array of x, y, and d-space values) if getRingsOnly is True or an empty list, in case of an error
-
GSASIIimage.
Make2ThetaAzimuthMap
(data, iLim, jLim)[source]¶ transforms 2D image from x,y space to 2-theta,azimuth space based on detector orientation param: dict data: GSAS-II image data object param: list iLim: boundary along x-pixels param: list jLim: boundary along y-pixels returns: array[4,nI,nJ] TA: 2-theta,azimuth, 2 geometric corrections
-
GSASIIimage.
calcFij
(omg, phi, azm, th)[source]¶ Uses parameters as defined by Bob He & Kingsley Smith, Adv. in X-Ray Anal. 41, 501 (1997)
Parameters: - omg – his omega = sample omega rotation; 0 when incident beam || sample surface, 90 when perp. to sample surface
- phi – his phi = sample phi rotation; usually = 0, axis rotates with omg.
- azm – his chi = azimuth around incident beam
- th – his theta = theta
-
GSASIIimage.
makeMat
(Angle, Axis)[source]¶ Make rotation matrix from Angle and Axis
Parameters: - Angle (float) – in degrees
- Axis (int) – 0 for rotation about x, 1 for about y, etc.