ImageD11.indexing
index
/sware/exp/fable/standalone/redhate4-a64/lib/python2.5/site-packages/ImageD11/indexing.py

## Automatically adapted for numpy.oldnumeric Sep 06, 2007 by alter_code1.py

 
Modules
       
numpy.oldnumeric.linear_algebra
ImageD11.closest
logging
math
numpy.oldnumeric
numpy
sys
time

 
Classes
       
indexer

 
class indexer
    A class for searching for orientation matrices
 
  Methods defined here:
__init__(self, unitcell=None, gv=None, cosine_tol=0.002, minpks=10, hkl_tol=0.01, ring_1=1, ring_2=2, ds_tol=0.0050000000000000001, wavelength=-1, uniqueness=0.5, eta_range=0.0, max_grains=100)
Unitcell would be a unitcell object for generating hkls peaks
gv would be a 3*n array of points in reciprocal space
The rest of the arguments are parameters.
assigntorings(self)
Assign the g-vectors to hkl rings
coverage(self)
Compute the expected coverage of reciprocal space
use the min/max obs values of xp/yp/omega to work out what was measured in the scan?
No lambda or
find(self)
Dig out the potential hits
friedelpairs(self, filename)
Attempt to identify Freidel pairs
 
Peaks must be assigned to the same powder ring
Peaks will be the closest thing to being 180 degrees apart
getind(self, UBI, tol=None)
Returns the indices of peaks in self.gv indexed by matrix UBI
histogram_drlv_fit(self, UBI=None, bins=None)
Generate a histogram of |drlv| for a ubi matrix
For use in validation of grains
loadpars(self, filename=None)
out_of_eta_range(self, e)
decide if an eta is going to be kept
readgvfile(self, filename, quiet=False)
refine(self, UBI)
Refine an orientation matrix and rescore it.
 
From Paciorek et al Acta A55 543 (1999)
UB = R H-1
   where:
   R = sum_n r_n h_n^t
   H = sum_n h_n h_n^t
   r = g-vectors
   h = hkl indices
saveindexing(self, filename, tol=None)
Save orientation matrices
 
FIXME : refactor this into something to do 
    grain by grain }
    peak by peak   }
savepars(self, filename=None)
saveubis(self, filename)
Save the generated ubi matrices into a text file
score(self, UBI, tol=None)
Decide which are the best orientation matrices
scorethem(self)
updateparameters(self)

 
Functions
       
calc_drlv2(UBI, gv)
Get the difference from being integer hkls
UBI: ubi matrix
gv: list of g-vectors
returns drlv2 = (h_calc - h_int)^2
mod_360(theta, target)
Find multiple of 360 to add to theta to be closest to target
readubis(ubifile)
read ubifile and return a list of ubi arrays
refine(UBI, gv, tol, quiet=True)
Refine an orientation matrix and rescore it.
 
From Paciorek et al Acta A55 543 (1999)
   UB = R H-1
where:
   R = sum_n r_n h_n^t
   H = sum_n h_n h_n^t
   r = g-vectors
   h = hkl indices
ubitoB(ubi)
give the B matrix from ubi
ubitoRod(ubi)
TODO Testcases!!!
ubitoU(ubi)
(try) to convert ubi to Grainspotter style U
The convention is B as being triangular, hopefully as Busing and Levy
TODO / FIXME - make some testcases please!!
ubitocellpars(ubi)
convert ubi matrix to unit cell
write_ubi_file(filename, ubilist)
save 3x3 matrices into file