Module: xrd.experiment¶
Module for wrapping the main functionality of the xrd package.
The Experiment class is the primary interface. Other classes are helpers.
9 Classes¶
- class hexrd.xrd.experiment.FitModes[source]¶
Bases: object
Indicators for single-frame or multiframe data files
- class hexrd.xrd.experiment.ImageModes[source]¶
Bases: object
Indicators for single-frame or multiframe data files
- class hexrd.xrd.experiment.Experiment(cfgFile='/home/docs/checkouts/readthedocs.org/user_builds/hexrd/envs/0.2.x/local/lib/python2.7/site-packages/hexrd/data/materials.cfg', matFile='/home/docs/checkouts/readthedocs.org/user_builds/hexrd/envs/0.2.x/local/lib/python2.7/site-packages/hexrd/data/all_materials.cfg')[source]¶
Bases: object
Wrapper for xrd functionality
- __init__(cfgFile='/home/docs/checkouts/readthedocs.org/user_builds/hexrd/envs/0.2.x/local/lib/python2.7/site-packages/hexrd/data/materials.cfg', matFile='/home/docs/checkouts/readthedocs.org/user_builds/hexrd/envs/0.2.x/local/lib/python2.7/site-packages/hexrd/data/all_materials.cfg')[source]¶
Constructor for Experiment
INPUTS
- cfgFile – name of the config file to use for initialization;
- an empty string indicates that default values for options are used
- matFile – name of the materials data file; a real file name
- is required here
- activeMaterial¶
Active Material
Can be set by number (index in material list) or by name.
On output, it is always a material instance.
- activeReader¶
Get method for activeReader
Reader is set by using index in reader list or by name.
- export_grainList(f, dspTol=None, etaTol=None, omeTol=None, doFit=False, sort=True)[source]¶
export method for grainList
- loadDetector(fname)[source]¶
Load the detector information from a file
INPUTS fname – the name of the file to load from
- loadMaterialList(fname)[source]¶
Load the pickled material list from a file
INPUTS fname – the name of the file to load from
- loadRawSpots(fname)[source]¶
Load the detector information from a file
INPUTS fname – the name of the file to load from
- loadReaderList(fname)[source]¶
Load the reader list from a file
INPUTS fname – the name of the file to load from
- matList¶
List of materials
- newDetector(gp, dp)[source]¶
Create a new detector with given geometry and distortion parameters
gp - initial geometric parameters dp - initial distortion parameters
- readImage(frameNum=1)[source]¶
Read and return an image
DESCRIPTION
This reads an image according to the active reader specification, saving it in the activeImage attribute.
- refine_grains(minCompl, nSubIter=3, doFit=False, etaTol=valWUnit("etaTol", "ANGLE", 1.0, "degrees"), omeTol=valWUnit("etaTol", "ANGLE", 1.0, "degrees"), fineDspTol=0.005, fineEtaTol=valWUnit("etaTol", "ANGLE", 0.5, "degrees"), fineOmeTol=valWUnit("etaTol", "ANGLE", 0.5, "degrees"))[source]¶
refine a grain list
- saveDetector(fname)[source]¶
Save the detector information to a file
INPUTS fname – the name of the file to save in
- saveRawSpots(fname)[source]¶
Save the detector information to a file
INPUTS fname – the name of the file to save in
- saveReaderList(fname)[source]¶
Save the reader list to a file
INPUTS fname – the name of the file to save in
- Experiment.simulateGrain(rMat=array([[ 1., 0., 0.],
- [ 0., 1., 0.],
- [ 0., 0., 1.]]), vMat=array([ 1., 1., 1., 0., 0., 0.]), planeData=None, detector=None, omegaRanges=[(-3.141592653589793, 3.141592653589793)], output=None)
Simulate a grain with choice of active material
- class hexrd.xrd.experiment.ReaderInput(name='reader', desc='no description')[source]¶
Bases: object
ReaderInput
This class is for holding input required to instantiate a reader object. Currently, only GE reader is supported.
- __init__(name='reader', desc='no description')[source]¶
Constructor for ReaderInput
INPUT name – [optional] (str) name desc – [optional] (str) description
NOTES * currently only GE reader is supported
- RC¶
alias of ReadGE
- darkFile¶
Full pathname of dark file
- imageNames¶
Get method for imageNames
- class hexrd.xrd.experiment.CalibrationInput(mat, xtol=1e-06)[source]¶
Bases: object
CalibrationInput
- calData[source]¶
(get only) Lattice parameter data for calibrant
This provides a deepcopy with wavelength, strain magnitude and two-theta width set.
- calMat¶
Calibration material (calibrant)
- fitType¶
fit type: direct or caked
- class hexrd.xrd.experiment.DetectorInfo(gParms=, []dParms=[])[source]¶
Bases: object
Class for detector and associated data
- class hexrd.xrd.experiment.PolarRebinOpts[source]¶
Bases: object
Options for polar rebinning
5 Functions¶
- hexrd.xrd.experiment.newName(name, nlist)[source]¶
return a name not in the list, but based on name input
- hexrd.xrd.experiment.loadExp(inpFile, matFile='/home/docs/checkouts/readthedocs.org/user_builds/hexrd/envs/0.2.x/local/lib/python2.7/site-packages/hexrd/data/materials.cfg')[source]¶
Load an experiment from a config file or from a saved exp file
- inpFile – the name of either the config file or the saved exp file;
- empty string means start new experiment
matFile – name of the materials file