In [1]:
%matplotlib inline

In [9]:
import i3assist as i3
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np

In [4]:
# The GridSearch class holds a list of Euler objects
# describing the local orientations searched in eulerFG*
# scripts and by the MRASRCH parameter
# gs - grid search
gs = i3.GridSearch(theta_max=9., theta_step=3., psi_max=6., psi_step=3., do_180=False)
len(gs) # Let's you know how many angles you will be searching using these parameters.


Out[4]:
110

In [5]:
# The GridSearch can be iterated over to see the individual euler angles.
# Each of these can be manipulated; the individual components can be gotten;
# and the rotations can be inverted and converted to the rotation matrix 
gs = i3.GridSearch(2., 1., 2., 1.) #Short hand version of above: tMax, tStep, pMax, pStep
for euler in gs:
    print("Phi: {:f}".format(euler.phi), end=' ') # Get First Euler Angle
    print("Theta: {:f}".format(euler.theta), end=' ') # Get Second Euler Angle
    print("Psi: {:f}".format(euler.psi)) # Get Third Euler Angle
    print("Another way to print it: {:s}".format(str(euler))) # Euler objects pretty print by default
    euler.normalize() # Makes Phi and Psi in the range [-180, 180], and theta in the range [0, 180] for old I3
    print("Normalized inverse: ", euler)
    invEuler = euler.copy() # All modifications to objects happen inplace so make copies
    invEuler.invert() # Inverts the rotations
    print("Inverse rotation: ", invEuler)
    rotMat = euler.to_matrix() # Convert ZXZ euler angles to ZXZ rotation matrix
    print("Rotation matrix: ", rotMat) # prints in a line like new I3 trf format
    print(""*80, end='\n\n')


Phi: 0.000000 Theta: 0.000000 Psi: 0.000000
Another way to print it:  0.000000  0.000000  0.000000
Normalized inverse:   0.000000  0.000000  0.000000
Inverse rotation:   0.000000  0.000000  0.000000
Rotation matrix:   1.000000  0.000000  0.000000 -0.000000  1.000000  0.000000  0.000000 -0.000000  1.000000


Phi: 0.000000 Theta: 0.000000 Psi: 1.000000
Another way to print it:  0.000000  0.000000  1.000000
Normalized inverse:   0.000000  0.000000  1.000000
Inverse rotation:   0.000000  0.000000  1.000000
Rotation matrix:   0.999848  0.017452  0.000000 -0.017452  0.999848  0.000000  0.000000 -0.000000  1.000000


Phi: 0.000000 Theta: 0.000000 Psi: -1.000000
Another way to print it:  0.000000  0.000000 -1.000000
Normalized inverse:   0.000000  0.000000 -1.000000
Inverse rotation:   0.000000  0.000000 -1.000000
Rotation matrix:   0.999848 -0.017452 -0.000000  0.017452  0.999848  0.000000  0.000000 -0.000000  1.000000


Phi: 0.000000 Theta: 0.000000 Psi: 2.000000
Another way to print it:  0.000000  0.000000  2.000000
Normalized inverse:   0.000000  0.000000  2.000000
Inverse rotation:   0.000000  0.000000  2.000000
Rotation matrix:   0.999391  0.034899  0.000000 -0.034899  0.999391  0.000000  0.000000 -0.000000  1.000000


Phi: 0.000000 Theta: 0.000000 Psi: -2.000000
Another way to print it:  0.000000  0.000000 -2.000000
Normalized inverse:   0.000000  0.000000 -2.000000
Inverse rotation:   0.000000  0.000000 -2.000000
Rotation matrix:   0.999391 -0.034899 -0.000000  0.034899  0.999391  0.000000  0.000000 -0.000000  1.000000


Phi: 0.000000 Theta: 1.000000 Psi: -0.000000
Another way to print it:  0.000000  1.000000 -0.000000
Normalized inverse:   0.000000  1.000000 -0.000000
Inverse rotation:   0.000000  1.000000 -0.000000
Rotation matrix:   1.000000  0.000000 -0.000000  0.000000  0.999848  0.017452  0.000000 -0.017452  0.999848


Phi: 0.000000 Theta: 1.000000 Psi: 1.000000
Another way to print it:  0.000000  1.000000  1.000000
Normalized inverse:   0.000000  1.000000  1.000000
Inverse rotation:   0.000000  1.000000  1.000000
Rotation matrix:   0.999848  0.017450  0.000305 -0.017452  0.999695  0.017450  0.000000 -0.017452  0.999848


Phi: 0.000000 Theta: 1.000000 Psi: -1.000000
Another way to print it:  0.000000  1.000000 -1.000000
Normalized inverse:   0.000000  1.000000 -1.000000
Inverse rotation:   0.000000  1.000000 -1.000000
Rotation matrix:   0.999848 -0.017450 -0.000305  0.017452  0.999695  0.017450  0.000000 -0.017452  0.999848


Phi: 0.000000 Theta: 1.000000 Psi: 2.000000
Another way to print it:  0.000000  1.000000  2.000000
Normalized inverse:   0.000000  1.000000  2.000000
Inverse rotation:   0.000000  1.000000  2.000000
Rotation matrix:   0.999391  0.034894  0.000609 -0.034899  0.999239  0.017442  0.000000 -0.017452  0.999848


Phi: 0.000000 Theta: 1.000000 Psi: -2.000000
Another way to print it:  0.000000  1.000000 -2.000000
Normalized inverse:   0.000000  1.000000 -2.000000
Inverse rotation:   0.000000  1.000000 -2.000000
Rotation matrix:   0.999391 -0.034894 -0.000609  0.034899  0.999239  0.017442  0.000000 -0.017452  0.999848


Phi: 90.000000 Theta: 1.000000 Psi: -90.000000
Another way to print it:  90.000000  1.000000 -90.000000
Normalized inverse:   90.000000  1.000000 -90.000000
Inverse rotation:   90.000000  1.000000 -90.000000
Rotation matrix:   0.999848  0.000000 -0.017452  0.000000  1.000000  0.000000  0.017452 -0.000000  0.999848


Phi: 90.000000 Theta: 1.000000 Psi: -89.000000
Another way to print it:  90.000000  1.000000 -89.000000
Normalized inverse:   90.000000  1.000000 -89.000000
Inverse rotation:   90.000000  1.000000 -89.000000
Rotation matrix:   0.999695  0.017452 -0.017450 -0.017450  0.999848  0.000305  0.017452 -0.000000  0.999848


Phi: 90.000000 Theta: 1.000000 Psi: -91.000000
Another way to print it:  90.000000  1.000000 -91.000000
Normalized inverse:   90.000000  1.000000 -91.000000
Inverse rotation:   90.000000  1.000000 -91.000000
Rotation matrix:   0.999695 -0.017452 -0.017450  0.017450  0.999848 -0.000305  0.017452 -0.000000  0.999848


Phi: 90.000000 Theta: 1.000000 Psi: -88.000000
Another way to print it:  90.000000  1.000000 -88.000000
Normalized inverse:   90.000000  1.000000 -88.000000
Inverse rotation:   90.000000  1.000000 -88.000000
Rotation matrix:   0.999239  0.034899 -0.017442 -0.034894  0.999391  0.000609  0.017452 -0.000000  0.999848


Phi: 90.000000 Theta: 1.000000 Psi: -92.000000
Another way to print it:  90.000000  1.000000 -92.000000
Normalized inverse:   90.000000  1.000000 -92.000000
Inverse rotation:   90.000000  1.000000 -92.000000
Rotation matrix:   0.999239 -0.034899 -0.017442  0.034894  0.999391 -0.000609  0.017452 -0.000000  0.999848


Phi: 180.000000 Theta: 1.000000 Psi: -180.000000
Another way to print it:  180.000000  1.000000 -180.000000
Normalized inverse:   180.000000  1.000000 -180.000000
Inverse rotation:   180.000000  1.000000 -180.000000
Rotation matrix:   1.000000 -0.000000 -0.000000 -0.000000  0.999848 -0.017452  0.000000  0.017452  0.999848


Phi: 180.000000 Theta: 1.000000 Psi: -179.000000
Another way to print it:  180.000000  1.000000 -179.000000
Normalized inverse:   180.000000  1.000000 -179.000000
Inverse rotation:   180.000000  1.000000 -179.000000
Rotation matrix:   0.999848  0.017450 -0.000305 -0.017452  0.999695 -0.017450  0.000000  0.017452  0.999848


Phi: 180.000000 Theta: 1.000000 Psi: -181.000000
Another way to print it:  180.000000  1.000000 -181.000000
Normalized inverse:   180.000000  1.000000 -181.000000
Inverse rotation:   180.000000  1.000000 -181.000000
Rotation matrix:   0.999848 -0.017450  0.000305  0.017452  0.999695 -0.017450  0.000000  0.017452  0.999848


Phi: 180.000000 Theta: 1.000000 Psi: -178.000000
Another way to print it:  180.000000  1.000000 -178.000000
Normalized inverse:   180.000000  1.000000 -178.000000
Inverse rotation:   180.000000  1.000000 -178.000000
Rotation matrix:   0.999391  0.034894 -0.000609 -0.034899  0.999239 -0.017442  0.000000  0.017452  0.999848


Phi: 180.000000 Theta: 1.000000 Psi: -182.000000
Another way to print it:  180.000000  1.000000 -182.000000
Normalized inverse:   180.000000  1.000000 -182.000000
Inverse rotation:   180.000000  1.000000 -182.000000
Rotation matrix:   0.999391 -0.034894  0.000609  0.034899  0.999239 -0.017442  0.000000  0.017452  0.999848


Phi: 270.000000 Theta: 1.000000 Psi: 90.000000
Another way to print it:  270.000000  1.000000  90.000000
Normalized inverse:   270.000000  1.000000  90.000000
Inverse rotation:   270.000000  1.000000  90.000000
Rotation matrix:   0.999848 -0.000000  0.017452  0.000000  1.000000 -0.000000 -0.017452  0.000000  0.999848


Phi: 270.000000 Theta: 1.000000 Psi: 91.000000
Another way to print it:  270.000000  1.000000  91.000000
Normalized inverse:   270.000000  1.000000  91.000000
Inverse rotation:   270.000000  1.000000  91.000000
Rotation matrix:   0.999695  0.017452  0.017450 -0.017450  0.999848 -0.000305 -0.017452  0.000000  0.999848


Phi: 270.000000 Theta: 1.000000 Psi: 89.000000
Another way to print it:  270.000000  1.000000  89.000000
Normalized inverse:   270.000000  1.000000  89.000000
Inverse rotation:   270.000000  1.000000  89.000000
Rotation matrix:   0.999695 -0.017452  0.017450  0.017450  0.999848  0.000305 -0.017452  0.000000  0.999848


Phi: 270.000000 Theta: 1.000000 Psi: 92.000000
Another way to print it:  270.000000  1.000000  92.000000
Normalized inverse:   270.000000  1.000000  92.000000
Inverse rotation:   270.000000  1.000000  92.000000
Rotation matrix:   0.999239  0.034899  0.017442 -0.034894  0.999391 -0.000609 -0.017452  0.000000  0.999848


Phi: 270.000000 Theta: 1.000000 Psi: 88.000000
Another way to print it:  270.000000  1.000000  88.000000
Normalized inverse:   270.000000  1.000000  88.000000
Inverse rotation:   270.000000  1.000000  88.000000
Rotation matrix:   0.999239 -0.034899  0.017442  0.034894  0.999391  0.000609 -0.017452  0.000000  0.999848


Phi: 0.000000 Theta: 2.000000 Psi: -0.000000
Another way to print it:  0.000000  2.000000 -0.000000
Normalized inverse:   0.000000  2.000000 -0.000000
Inverse rotation:   0.000000  2.000000 -0.000000
Rotation matrix:   1.000000  0.000000 -0.000000  0.000000  0.999391  0.034899  0.000000 -0.034899  0.999391


Phi: 0.000000 Theta: 2.000000 Psi: 1.000000
Another way to print it:  0.000000  2.000000  1.000000
Normalized inverse:   0.000000  2.000000  1.000000
Inverse rotation:   0.000000  2.000000  1.000000
Rotation matrix:   0.999848  0.017442  0.000609 -0.017452  0.999239  0.034894  0.000000 -0.034899  0.999391


Phi: 0.000000 Theta: 2.000000 Psi: -1.000000
Another way to print it:  0.000000  2.000000 -1.000000
Normalized inverse:   0.000000  2.000000 -1.000000
Inverse rotation:   0.000000  2.000000 -1.000000
Rotation matrix:   0.999848 -0.017442 -0.000609  0.017452  0.999239  0.034894  0.000000 -0.034899  0.999391


Phi: 0.000000 Theta: 2.000000 Psi: 2.000000
Another way to print it:  0.000000  2.000000  2.000000
Normalized inverse:   0.000000  2.000000  2.000000
Inverse rotation:   0.000000  2.000000  2.000000
Rotation matrix:   0.999391  0.034878  0.001218 -0.034899  0.998782  0.034878  0.000000 -0.034899  0.999391


Phi: 0.000000 Theta: 2.000000 Psi: -2.000000
Another way to print it:  0.000000  2.000000 -2.000000
Normalized inverse:   0.000000  2.000000 -2.000000
Inverse rotation:   0.000000  2.000000 -2.000000
Rotation matrix:   0.999391 -0.034878 -0.001218  0.034899  0.998782  0.034878  0.000000 -0.034899  0.999391


Phi: 51.428571 Theta: 2.000000 Psi: -51.445589
Another way to print it:  51.428571  2.000000 -51.445589
Normalized inverse:   51.428571  2.000000 -51.445589
Inverse rotation:   51.428571  2.000000 -51.445589
Rotation matrix:   0.999628  0.000000 -0.027292  0.000594  0.999763  0.021751  0.027286 -0.021759  0.999391


Phi: 51.428571 Theta: 2.000000 Psi: -50.445589
Another way to print it:  51.428571  2.000000 -50.445589
Normalized inverse:   51.428571  2.000000 -50.445589
Inverse rotation:   51.428571  2.000000 -50.445589
Rotation matrix:   0.999486  0.017448 -0.026908 -0.016852  0.999611  0.022224  0.027286 -0.021759  0.999391


Phi: 51.428571 Theta: 2.000000 Psi: -52.445589
Another way to print it:  51.428571  2.000000 -52.445589
Normalized inverse:   51.428571  2.000000 -52.445589
Inverse rotation:   51.428571  2.000000 -52.445589
Rotation matrix:   0.999465 -0.017448 -0.027667  0.018040  0.999611  0.021272  0.027286 -0.021759  0.999391


Phi: 51.428571 Theta: 2.000000 Psi: -49.445589
Another way to print it:  51.428571  2.000000 -49.445589
Normalized inverse:   51.428571  2.000000 -49.445589
Inverse rotation:   51.428571  2.000000 -49.445589
Rotation matrix:   0.999039  0.034891 -0.026516 -0.034293  0.999154  0.022691  0.027286 -0.021759  0.999391


Phi: 51.428571 Theta: 2.000000 Psi: -53.445589
Another way to print it:  51.428571  2.000000 -53.445589
Normalized inverse:   51.428571  2.000000 -53.445589
Inverse rotation:   51.428571  2.000000 -53.445589
Rotation matrix:   0.998998 -0.034891 -0.028034  0.035480  0.999154  0.020786  0.027286 -0.021759  0.999391


Phi: 102.857143 Theta: 2.000000 Psi: -102.849571
Another way to print it:  102.857143  2.000000 -102.849571
Normalized inverse:   102.857143  2.000000 -102.849571
Inverse rotation:   102.857143  2.000000 -102.849571
Rotation matrix:   0.999421  0.000000 -0.034026 -0.000264  0.999970 -0.007761  0.034024  0.007766  0.999391


Phi: 102.857143 Theta: 2.000000 Psi: -101.849571
Another way to print it:  102.857143  2.000000 -101.849571
Normalized inverse:   102.857143  2.000000 -101.849571
Inverse rotation:   102.857143  2.000000 -101.849571
Rotation matrix:   0.999264  0.017452 -0.034156 -0.017706  0.999818 -0.007166  0.034024  0.007766  0.999391


Phi: 102.857143 Theta: 2.000000 Psi: -103.849571
Another way to print it:  102.857143  2.000000 -103.849571
Normalized inverse:   102.857143  2.000000 -103.849571
Inverse rotation:   102.857143  2.000000 -103.849571
Rotation matrix:   0.999273 -0.017452 -0.033885  0.017178  0.999818 -0.008354  0.034024  0.007766  0.999391


Phi: 102.857143 Theta: 2.000000 Psi: -100.849571
Another way to print it:  102.857143  2.000000 -100.849571
Normalized inverse:   102.857143  2.000000 -100.849571
Inverse rotation:   102.857143  2.000000 -100.849571
Rotation matrix:   0.998803  0.034898 -0.034276 -0.035143  0.999361 -0.006569  0.034024  0.007766  0.999391


Phi: 102.857143 Theta: 2.000000 Psi: -104.849571
Another way to print it:  102.857143  2.000000 -104.849571
Normalized inverse:   102.857143  2.000000 -104.849571
Inverse rotation:   102.857143  2.000000 -104.849571
Rotation matrix:   0.998821 -0.034898 -0.033734  0.034615  0.999361 -0.008944  0.034024  0.007766  0.999391


Phi: 154.285714 Theta: 2.000000 Psi: -154.272063
Another way to print it:  154.285714  2.000000 -154.272063
Normalized inverse:   154.285714  2.000000 -154.272063
Inverse rotation:   154.285714  2.000000 -154.272063
Rotation matrix:   0.999885 -0.000000 -0.015150 -0.000476  0.999506 -0.031440  0.015142  0.031443  0.999391


Phi: 154.285714 Theta: 2.000000 Psi: -153.272063
Another way to print it:  154.285714  2.000000 -153.272063
Normalized inverse:   154.285714  2.000000 -153.272063
Inverse rotation:   154.285714  2.000000 -153.272063
Rotation matrix:   0.999725  0.017444 -0.015696 -0.017927  0.999353 -0.031171  0.015142  0.031443  0.999391


Phi: 154.285714 Theta: 2.000000 Psi: -155.272063
Another way to print it:  154.285714  2.000000 -155.272063
Normalized inverse:   154.285714  2.000000 -155.272063
Inverse rotation:   154.285714  2.000000 -155.272063
Rotation matrix:   0.999741 -0.017444 -0.014599  0.016974  0.999353 -0.031699  0.015142  0.031443  0.999391


Phi: 154.285714 Theta: 2.000000 Psi: -152.272063
Another way to print it:  154.285714  2.000000 -152.272063
Normalized inverse:   154.285714  2.000000 -152.272063
Inverse rotation:   154.285714  2.000000 -152.272063
Rotation matrix:   0.999260  0.034882 -0.016238 -0.035372  0.998897 -0.030892  0.015142  0.031443  0.999391


Phi: 154.285714 Theta: 2.000000 Psi: -156.272063
Another way to print it:  154.285714  2.000000 -156.272063
Normalized inverse:   154.285714  2.000000 -156.272063
Inverse rotation:   154.285714  2.000000 -156.272063
Rotation matrix:   0.999293 -0.034882 -0.014043  0.034419  0.998897 -0.031949  0.015142  0.031443  0.999391


Phi: 205.714286 Theta: 2.000000 Psi: 154.272063
Another way to print it:  205.714286  2.000000  154.272063
Normalized inverse:   205.714286  2.000000  154.272063
Inverse rotation:   205.714286  2.000000  154.272063
Rotation matrix:   0.999885 -0.000000  0.015150  0.000476  0.999506 -0.031440 -0.015142  0.031443  0.999391


Phi: 205.714286 Theta: 2.000000 Psi: 155.272063
Another way to print it:  205.714286  2.000000  155.272063
Normalized inverse:   205.714286  2.000000  155.272063
Inverse rotation:   205.714286  2.000000  155.272063
Rotation matrix:   0.999741  0.017444  0.014599 -0.016974  0.999353 -0.031699 -0.015142  0.031443  0.999391


Phi: 205.714286 Theta: 2.000000 Psi: 153.272063
Another way to print it:  205.714286  2.000000  153.272063
Normalized inverse:   205.714286  2.000000  153.272063
Inverse rotation:   205.714286  2.000000  153.272063
Rotation matrix:   0.999725 -0.017444  0.015696  0.017927  0.999353 -0.031171 -0.015142  0.031443  0.999391


Phi: 205.714286 Theta: 2.000000 Psi: 156.272063
Another way to print it:  205.714286  2.000000  156.272063
Normalized inverse:   205.714286  2.000000  156.272063
Inverse rotation:   205.714286  2.000000  156.272063
Rotation matrix:   0.999293  0.034882  0.014043 -0.034419  0.998897 -0.031949 -0.015142  0.031443  0.999391


Phi: 205.714286 Theta: 2.000000 Psi: 152.272063
Another way to print it:  205.714286  2.000000  152.272063
Normalized inverse:   205.714286  2.000000  152.272063
Inverse rotation:   205.714286  2.000000  152.272063
Rotation matrix:   0.999260 -0.034882  0.016238  0.035372  0.998897 -0.030892 -0.015142  0.031443  0.999391


Phi: 257.142857 Theta: 2.000000 Psi: 102.849571
Another way to print it:  257.142857  2.000000  102.849571
Normalized inverse:   257.142857  2.000000  102.849571
Inverse rotation:   257.142857  2.000000  102.849571
Rotation matrix:   0.999421 -0.000000  0.034026  0.000264  0.999970 -0.007761 -0.034024  0.007766  0.999391


Phi: 257.142857 Theta: 2.000000 Psi: 103.849571
Another way to print it:  257.142857  2.000000  103.849571
Normalized inverse:   257.142857  2.000000  103.849571
Inverse rotation:   257.142857  2.000000  103.849571
Rotation matrix:   0.999273  0.017452  0.033885 -0.017178  0.999818 -0.008354 -0.034024  0.007766  0.999391


Phi: 257.142857 Theta: 2.000000 Psi: 101.849571
Another way to print it:  257.142857  2.000000  101.849571
Normalized inverse:   257.142857  2.000000  101.849571
Inverse rotation:   257.142857  2.000000  101.849571
Rotation matrix:   0.999264 -0.017452  0.034156  0.017706  0.999818 -0.007166 -0.034024  0.007766  0.999391


Phi: 257.142857 Theta: 2.000000 Psi: 104.849571
Another way to print it:  257.142857  2.000000  104.849571
Normalized inverse:   257.142857  2.000000  104.849571
Inverse rotation:   257.142857  2.000000  104.849571
Rotation matrix:   0.998821  0.034898  0.033734 -0.034615  0.999361 -0.008944 -0.034024  0.007766  0.999391


Phi: 257.142857 Theta: 2.000000 Psi: 100.849571
Another way to print it:  257.142857  2.000000  100.849571
Normalized inverse:   257.142857  2.000000  100.849571
Inverse rotation:   257.142857  2.000000  100.849571
Rotation matrix:   0.998803 -0.034898  0.034276  0.035143  0.999361 -0.006569 -0.034024  0.007766  0.999391


Phi: 308.571429 Theta: 2.000000 Psi: 51.445589
Another way to print it:  308.571429  2.000000  51.445589
Normalized inverse:   308.571429  2.000000  51.445589
Inverse rotation:   308.571429  2.000000  51.445589
Rotation matrix:   0.999628  0.000000  0.027292 -0.000594  0.999763  0.021751 -0.027286 -0.021759  0.999391


Phi: 308.571429 Theta: 2.000000 Psi: 52.445589
Another way to print it:  308.571429  2.000000  52.445589
Normalized inverse:   308.571429  2.000000  52.445589
Inverse rotation:   308.571429  2.000000  52.445589
Rotation matrix:   0.999465  0.017448  0.027667 -0.018040  0.999611  0.021272 -0.027286 -0.021759  0.999391


Phi: 308.571429 Theta: 2.000000 Psi: 50.445589
Another way to print it:  308.571429  2.000000  50.445589
Normalized inverse:   308.571429  2.000000  50.445589
Inverse rotation:   308.571429  2.000000  50.445589
Rotation matrix:   0.999486 -0.017448  0.026908  0.016852  0.999611  0.022224 -0.027286 -0.021759  0.999391


Phi: 308.571429 Theta: 2.000000 Psi: 53.445589
Another way to print it:  308.571429  2.000000  53.445589
Normalized inverse:   308.571429  2.000000  53.445589
Inverse rotation:   308.571429  2.000000  53.445589
Rotation matrix:   0.998998  0.034891  0.028034 -0.035480  0.999154  0.020786 -0.027286 -0.021759  0.999391


Phi: 308.571429 Theta: 2.000000 Psi: 49.445589
Another way to print it:  308.571429  2.000000  49.445589
Normalized inverse:   308.571429  2.000000  49.445589
Inverse rotation:   308.571429  2.000000  49.445589
Rotation matrix:   0.999039 -0.034891  0.026516  0.034293  0.999154  0.022691 -0.027286 -0.021759  0.999391



In [10]:
gs = i3.GridSearch(9., 3., 30., 1.0)
lons = []
lats = []
for i in gs:
    if len(lons) == 0:
        lons.append(i.phi)
        lats.append(90. - i.theta)
    elif lons[-1] != i.phi or lats[-1] != 90. - i.theta:
        lons.append(i.phi)
        lats.append(90. - i.theta)
    else:
        pass
f, (sp1, sp2) = plt.subplots(1, 2, figsize=(10,10))
m1 = Basemap(projection='nplaea', boundinglat=80, lon_0=0.,resolution='l', ax=sp1)
m2 = Basemap(projection='splaea', boundinglat=-1, lon_0=270., resolution='l', ax=sp2)
m1.drawparallels(np.arange(80.,90.,0.5), labels=[1,0,0,0])
m1.drawmeridians(np.arange(-180.,181.,15.), labels=[0,1,1,0])
m2.drawparallels(np.arange(-60.,90.,15.), labels=[0,1,0,0])
m2.drawmeridians(np.arange(-180.,181.,15.))
x1, y1 = m1(lons, lats)
m1.scatter(x1,y1,marker='o',color='r')
x2, y2 = m2(lons, lats)
m2.scatter(x2, y2, marker='D', color='g')
plt.show()



In [12]:
tl = i3.TransformList()
tl.from_file('test.trf')
lons = []
lats = []
clrs = []
for trf in tl:
    rot = trf.rotation
    eul = rot.to_euler()
    lons.append(eul.phi)
    lats.append(90. - eul.theta)
    clrs.append(eul.psi)
m = Basemap(projection='sinu', lon_0=0., resolution='l')
m.drawparallels(np.arange(-90., 90., 30.))
m.drawmeridians(np.arange(-180., 181., 45.))
x, y = m(lons, lats)
cax = m.scatter(x, y, s=36, alpha=1., marker='.', c=clrs, cmap=plt.get_cmap('viridis'))
plt.colorbar(cax, orientation='horizontal')
plt.title('T7 channel WT Orientations')
plt.show()



In [ ]: