\(\renewcommand\AA{\text{Å}}\)
22. GSAS-II Independent Tools
The modules here are used for independent programs to be used as tools within the GSAS-II package and run independently of the main GSAS-II program.
GSASIIIntPDFtool: Parallelized auto-integration/PDF program
G2compare: Project Comparison program
Both are under development.
22.1. GSASIIIntPDFtool: autointegration routines
An auto-integration program based on GSAS-II but with a minimal GUI and no visualization that runs independently from the main GSAS-II program . This is intended to implement significant levels of parallelization and require less of a memory footprint.
Autointegration GSASIIimgGUI and GSASIIimage, hacked for stand-alone use
- class GSASIIIntPDFtool.AutoIntFrame(G2frame, PollTime=30.0)[source]
Creates a wx.Frame window for the Image AutoIntegration. The intent is that this will be used as a non-modal dialog window.
Implements a Start button that morphs into a pause and resume button. This button starts a processing loop that is repeated every
PollTime()
seconds.- Parameters:
G2frame (wx.Frame) – main GSAS-II frame
PollTime (float) – frequency in seconds to repeat calling the processing loop. (Default is 30.0 seconds.)
- OnPause()[source]
Respond to Pause, changes text on button/Status line, if needed Stops timer self.Pause should already be True
- OnTimerLoop(event)[source]
A method that is called every
PollTime()
seconds that is used to check for new files and process them. Integrates new images. Also optionally sets up and computes PDF. This is called only after the “Start” button is pressed (then its label reads “Pause”).
- GSASIIIntPDFtool.LookupFromTable(dist, parmList)[source]
Interpolate image parameters for a supplied distance value
- Parameters:
dist (float) – distance to use for interpolation
- Returns:
a list with 2 items: * a dict with interpolated parameter values, * the closest imctrl
- GSASIIIntPDFtool.MapCache = {'ThetaAzimMap': {}, 'distanceList': [], 'maskMap': {}}
caches for TA and Mask maps
- GSASIIIntPDFtool.ProcessImage(newImage, imgprms, mskprms, xydata, PDFdict, InterpVals, calcModes, outputModes)[source]
Process one image that is read from file newImage and is integrated into one or more diffraction patterns and optionally each diffraction pattern can be transformed into a pair distribution function.
- Parameters:
newImage (str) – file name (full path) for input image
imgprms (dict) – dict with some nested lists & dicts describing the image settings and integration parameters
mskprms (dict) – dict with areas of image to be masked
xydata (dict) – contains histogram information with about background contributions, used for PDF computation (used if ComputePDF is True)
PDFdict – contains PDF parameters (used if ComputePDF is True)
InterpVals – contains interpolation table (used if TableMode is True)
calcModes (tuple) – set of values for which computations are performed and how
outputModes (tuple) – determines which files are written and where
22.2. G2compare: Tool for project comparison
This is intended to read in multiple GSAS-II projects and provide graphics, tables of information and so on. Not much of this has been written at present.
- class G2compare.MakeTopWindow(parent)[source]
Define the main frame and its associated menu items
- LoadPhase(fil)[source]
Load Phase entries from a .GPX file to the tree. see
GSASIImiscGUI.ProjFileOpen()
- LoadProject(fil)[source]
Load the Covariance entry from a .GPX file to the tree. see
GSASIImiscGUI.ProjFileOpen()
- LoadPwdr(fil)[source]
Load PWDR entries from a .GPX file to the tree. see
GSASIImiscGUI.ProjFileOpen()
- getMode()[source]
returns the display mode (one of “Histogram”,”Phase”,”Project”). Could return ‘?’ in case of an error.
- onHistPrinceTest(event)[source]
Compare two histograms (selected here if more than two are present) using the statistical test proposed by Ted Prince in Acta Cryst. B35 1099-1100. (1982). Also see Int. Tables Vol. C (1st Ed.) chapter 8.4, 618-621 (1995).
- onProjFtest(event)[source]
Compare two projects (selected here if more than two are present) using the statistical F-test (aka Hamilton R-factor test), see:
Hamilton, R. W. (1965), Acta Crystallogr. 18, 502-510.
Prince, E., Mathematical Techniques in Crystallography and Materials Science, Second ed. (Springer-Verlag, New York, 1994).
- G2compare.RC2Ftest(npts, RChiSq0, nvar0, RChiSq1, nvar1)[source]
Compute the F-test probability that a model expanded with added parameters (relaxed model) is statistically more likely than the constrained (base) model :param int npts: number of observed diffraction data points :param float RChiSq0: Reduced Chi**2 for the base model :param int nvar0: number of refined variables in the base model :param float RChiSq0: Reduced Chi**2 for the relaxed model :param int nvar1: number of refined variables in the relaxed model
- G2compare.RwFtest(npts, Rwp0, nvar0, Rwp1, nvar1)[source]
Compute the F-test probability that a model expanded with added parameters (relaxed model) is statistically more likely than the constrained (base) model :param int npts: number of observed diffraction data points :param float Rwp0: Weighted profile R-factor or GOF for the base model :param int nvar0: number of refined variables in the base model :param float Rwp1: Weighted profile R-factor or GOF for the relaxed model :param int nvar1: number of refined variables in the relaxed model