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

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

Modules
`` |  |
ImageD11.closest ImageD11.columnfile ImageD11.grain | ImageD11.indexing math numpy | ImageD11.parameters ImageD11.simplex ImageD11.transform |

Classes
`` |  | refinegrains
class refinegrains
`` | `Class to refine the position and orientation of grains and also the detector parameters`
| Methods defined here: __init__(self, tolerance=0.01, intensity_tth_range=(8.4000000000000004, 9.0)) applyargs(self, args) assignlabels(self) `Fill out the appropriate labels for the spots` compute_gv(self, grainname, scanname) `Makes self.gv refer be g-vectors computed for this grain in this scan` estimate_steps(self, gof, guess, steps) fit(self, maxiters=100) `Fit the global parameters` generate_grains(self) getgrains(self) gof(self, args) `<drlv> for all of the grains in all of the scans` loadfiltered(self, filename) `Read in file containing filtered and merged peak positions` loadparameters(self, filename) makeuniq(self, symmetry) `Flip orientations to a particular choice Be aware that if the unit cell is distorted and you do this, you might have problems...` printresult(self, arg) readubis(self, filename) `Read ubi matrices from a text file` refine(self, ubi, quiet=True) `Fit the matrix without changing the peak assignments` refinepositions(self, quiet=True, maxiters=100) refineubis(self, quiet=True, scoreonly=False) reset_labels(self, scanname) savegrains(self, filename, sort_npks=True) `Save the refined grains` saveparameters(self, filename) set_translation(self, gr, sc) Data and other attributes defined here: pars = {'cell__a': 4.1569162000000004, 'cell__b': 4.1569162000000004, 'cell__c': 4.1569162000000004, 'cell_alpha': 90.0, 'cell_beta': 90.0, 'cell_gamma': 90.0, 'cell_lattice_[P,A,B,C,I,F,R]': 'P', 'chi': 0.0, 'distance': 7367.8452301999996, 'fit_tolerance': 0.5, ...} stepsizes = {'chi': 0.0017453292519943296, 'distance': 0.20000000000000001, 't_x': 0.20000000000000001, 't_y': 0.20000000000000001, 't_z': 0.20000000000000001, 'tilt_x': 0.0017453292519943296, 'tilt_y': 0.0017453292519943296, 'tilt_z': 0.0017453292519943296, 'wavelength': 0.001, 'wedge': 0.0017453292519943296, ...}

Functions
`` |  | compute_lp_factor(colfile, **kwds) `We'll assume for simplicity that wedge, chi, tilts are all zero Of course we should put that in sometime in the near future Try using: Table 6.2.1.1 in Volume C of international tables : (h) Rotation photograph of small crystal, volume V 1. Beam normal to axis rho = rac{ N^2 e^4 \lambda^3 V} { 4 \pi m^2 c^4} . rac{ 1 + \cos^2{ heta} } { \sin{2 heta } . rac{ cos{ heta} { \sqrt{ \cos^2{\psi} - \sin^2{ heta} } } p' |F|^2 rho is Integrated reflection power ratio from a crystal element e, m Electronic charge and mass c Speed of light \lambda Wavelength of radiation 2 heta Angle between incident and diffracted beams \psi in (h), latitude of reciprocal-lattice point relative to axis of rotation V Volume of crystal, or of irradiated part of powder sample N Number of unit cells per unit volume F Structure factor of hkl reflection p' Multiplicity factor for single-crystal methods nb - what is this ? Hopefully would be 1 ? From this we will take the (1+cos^2(2t))cos(2t)/sqrt(cos^2p-sin^2t)/sin2t` compute_total_intensity(colfile, indices, tth_range, ntrim=2) `Add up the intensity in colfile for peaks given in indices` cosd(x) lf(tth, eta) sind(x) test_benoit() test_nac()