Example #1
0
 def test1(self):
     v = wripaca.new_doubleArray(9)
     for i, x in enumerate([1, 0, 0, 0, 1, 0, 0, 0, 1]):
         wripaca.doubleArray_setitem(v, i, x)
     assert wripaca.determinant3(v) == 1.0
Example #2
0

import sys
sys.path.append("build/lib.win-amd64-2.7")

import wripaca
print wripaca.__file__

import numpy as np
from ImageD11 import transform, gv_general

print "det(eye(3))",wripaca.determinant3( np.eye(3).ravel() )

pre = np.eye(3).ravel()
post = np.eye(3).ravel()
axis =  np.array( (0.,0.,-1.))

tth = np.array( [60, 10, 15, 20,25, 1.9555],np.float)
wvln = 0.5
eta = np.array( [90, 10,120,-20,340, -73 ],np.float)
omega = np.array([60,90,180, 60,97,  131],np.float)

def testaxisang():
    v = np.array([11.,12.,13.],np.float)
    cv = v.copy()
    axis = np.array([np.sqrt(1./3),-np.sqrt(1./3),np.sqrt(1./3)],np.float)

    for i in range(len(omega)):
        a = gv_general.rotation_axis(axis, angle=omega[i])
        rv = a.rotate_vectors( v )
        wripaca.rotate_vector_axis_angle(