Commit 92c69ff
authored
Refactor code to have a single
Refactor the ellipsoid code to have a single `Ellipsoid` class that can
represent any type of ellipsoid. Ditch the specific classes for each
ellipsoid type and the `create_ellipsoid` function. Update the forward
modelling code for gravity and magnetics. Make use of an extra rotation
matrix that aligns the x, y, z local coordinate system to the
ellipsoid's semiaxes in decreasing order, so `a >= b >= c`. Modify the
analytic solutions for oblate ellipsoids in such way that they are
defined by `a == b > c` (instead of `a < b == c` as Takahashi et al. and
Clark et al. do). Make rotation angles and `center` as optional
arguments for the `Ellipsoid` class. Fix numerical instabilities of
triaxial ellipsoids when they approximate prolate or oblate ellipsoids
(when two semiaxes lengths are close enough to each other). Update the
tests and add a few more for the new bits of code.
**Relevant issues/PRs:**
Part of #594Ellipsoid class (#616)1 parent 676414d commit 92c69ff
File tree
12 files changed
+1325
-1721
lines changed- doc/api
- harmonica
- _forward/ellipsoids
- tests/ellipsoids
12 files changed
+1325
-1721
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 94 | + | |
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
| |||
174 | 170 | | |
175 | 171 | | |
176 | 172 | | |
177 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 19 | + | |
28 | 20 | | |
29 | 21 | | |
30 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 11 | + | |
18 | 12 | | |
19 | 13 | | |
0 commit comments