GSAS-II Scripts

testDeriv: Check derivative computation

Use this to check derivatives used in structure least squares refinement against numerical values computed in this script.

To use set DEBUG=True in GSASIIstrMain.py (line 22, as of version 1110); run the least squares - one cycle is sufficient. Do the “Save Results”; this will write the file testDeriv.dat in the local directory.

Then run this program to see plots of derivatives for all parameters refined in the last least squares. Shown will be numerical derivatives generated over all observations (including penalty terms) and the corresponding analytical ones produced in the least squares. They should match.

testDeriv.main()[source]

Starts main application to compute and plot derivatives

GSASIItestplot: Plotting for testDeriv

Plotting module used for script testDeriv.

class GSASIItestplot.Plot(parent, id=-1, dpi=None, **kwargs)[source]

Creates a plotting window

class GSASIItestplot.PlotNotebook(id=-1)[source]

creates a Wx application and a plotting notebook

scanCCD: reduce data from scanning CCD

Quickly prototyped routine for reduction of data from detector described in B.H. Toby, T.J. Madden, M.R. Suchomel, J.D. Baldwin, and R.B. Von Dreele, “A Scanning CCD Detector for Powder Diffraction Measurements”. Journal of Applied Crystallography. 46(4): p. 1058-63 (2013).

scanCCD.main()[source]

starts main application to merge data from scanning CCD

makeMacApp: Create Mac Applet

This script creates an AppleScript app to launch GSAS-II. The app is created in the directory where the GSAS-II script is located. A softlink to Python is created, but is named GSAS-II, so that GSAS-II shows up as the name of the app rather than Python in the menu bar, etc. Note that this requires finding an app version of Python (expected name .../Resources/Python.app/Contents/MacOS/Python in directory tree of the calling python interpreter).

Run this script with one optional argument, the path to the GSASII.py The script path may be specified relative to the current path or given an absolute path, but will be accessed via an absolute path. If no arguments are supplied, the GSASII.py script is assumed to be in the same directory as this file.

unit_tests: Self-test Module

A script that can be run to test a series of self-tests in GSAS-II. At present, only modules GSASIIspc and GSASIIlattice have self-tests.

unit_tests.test_GSASIIlattice()[source]

Test registered self-tests in GSASIIlattice. Takes no input and returns nothing. Throws an Exception if a test fails.

unit_tests.test_GSASIIspc()[source]

Test registered self-tests in GSASIIspc. Takes no input and returns nothing. Throws an Exception if a test fails.