Changeset 954 for trunk/GSASIImath.py


Ignore:
Timestamp:
Jun 18, 2013 3:53:19 PM (9 years ago)
Author:
vondreele
Message:

fix to Hessian LSQ to stop if lam > 10e5!
fix to rigid body quaternion derivatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r953 r954  
    130130                lam /= 10.
    131131                break
     132            if lam > 10.e5:
     133                print 'ouch #3 chisq1 ',chisq1,' stuck > chisq0 ',chisq0
     134                break
    132135        if (chisq0-chisq1)/chisq0 < ftol:
    133136            break
     
    350353        XYZ.append(atom[cx:cx+3])
    351354    return np.array(XYZ)
     355
     356def RotateRBXYZ(Bmat,Cart,oriQ):
     357    '''rotate & transform cartesian coordinates to crystallographic ones
     358    no translation applied. To be used for numerical derivatives
     359   
     360    :param type name: description
     361   
     362    :returns: type name: description
     363   
     364    '''
     365    ''' returns crystal coordinates for atoms described by RBObj
     366    '''
     367    XYZ = np.zeros_like(Cart)
     368    for i,xyz in enumerate(Cart):
     369        X = prodQVQ(oriQ,xyz)
     370        XYZ[i] = np.inner(Bmat,X)
     371    return XYZ
    352372
    353373def UpdateRBXYZ(Bmat,RBObj,RBData,RBType):
Note: See TracChangeset for help on using the changeset viewer.