Commit 8e0c677
authored
Fix vector to angles for small intensities (#565)
When the intensity is very small (<1e-10), the vector to angles
calculation fails because of the masking that was used. It rounds these
numbers to zero and returns always inc=90, dec=0. To handle this, use
the arctangent instead of arcsine in the equations. This was, we can use
arctan2 which is able to handle 0 in the denominator. Add tests to make
sure this doesn't happen again. These small values appear in magnetic
microscopy and we ran into this issue in Magali.1 parent 57cdc55 commit 8e0c677
2 files changed
+19
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | | - | |
| 121 | + | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
145 | 139 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 140 | | |
151 | 141 | | |
152 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
23 | 36 | | |
24 | 37 | | |
25 | 38 | | |
| |||
0 commit comments