so3grid
This module provides a deterministic low-dispersion grid on SO3.
SO3Grid
Low-dispersion SO3 grid.
This approach was introduced by Generating Uniform Incremental Grids on SO3 Using the Hopf Fibration, Yershova, 2010. We only generate the base grid (i.e., up to and including Section 5.2 of the paper), since we only need a fixed size set.
Implementation roughly based on https://github.com/zhonge/cryodrgn
Source code in sdfest/initialization/so3grid.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
__init__(resol)
Construct the SO3 grid.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resol |
int
|
The resolution of the grid. Coarsest possible grid for 0. |
required |
Source code in sdfest/initialization/so3grid.py
18 19 20 21 22 23 24 25 26 |
|
hopf_to_index(psi, theta, phi)
Convert hopf coordinate to index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phi |
[0, 2pi) |
required | |
theta |
[0, pi] |
required | |
psi |
[0, 2pi) |
required |
Returns: Grid index of closest point in grid.
Source code in sdfest/initialization/so3grid.py
32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
index_to_hopf(index)
Convert index to hopf coordinates.
Psi: [0,2pi) Theta: [0, pi] Phi: [0, 2pi)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int
|
The index of the grid point. |
required |
Returns: Tuple of psi, theta, phi.
Source code in sdfest/initialization/so3grid.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
index_to_quat(index)
Convert index to quaternion.
Returns:
Type | Description |
---|---|
array
|
Array of shape (4,), containing the normalized quaternion corresponding |
array
|
to the index. |
Source code in sdfest/initialization/so3grid.py
81 82 83 84 85 86 87 88 89 |
|
num_cells()
Return the number of points in the grid.
Source code in sdfest/initialization/so3grid.py
28 29 30 |
|
quat_to_index(quaternion)
Convert quaternion to index.
Will convert quaternion to Hopf coordinates and look up closest Hopf coordinate. Closest means, closest in Hopf coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
quaternion |
array
|
Array of shape (4,), containing a normalized quaternion. The order of the quaternion is (x, y, z, w). |
required |
Returns: The index of the closest (in Hopf coordinates) point.
Source code in sdfest/initialization/so3grid.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|