Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dipole broadcasting #76

Merged
merged 33 commits into from
Oct 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ba5d0d6
simplify broadcasting operation.
jcapriot Oct 15, 2024
00460b5
fix em wholespace dipoles
jcapriot Oct 15, 2024
d9748f2
static wholespace checks
jcapriot Oct 16, 2024
3113e01
simplify some functions
jcapriot Oct 16, 2024
ce61771
make dipoles work with scalar time/frequency
jcapriot Oct 16, 2024
f6e3fea
improve gravity tests
jcapriot Oct 16, 2024
03c97d1
a few small gravity simplifications
jcapriot Oct 17, 2024
e65a0c0
make cart to cyl transforms broadcast
jcapriot Oct 17, 2024
066ad5b
make planewave broadcast
jcapriot Oct 17, 2024
91d864f
add a reference file for ward and hohmann's unaltered formulas
jcapriot Oct 17, 2024
f1c1d9e
add some tests
jcapriot Oct 17, 2024
1f9e325
add sympy to test environment
jcapriot Oct 17, 2024
4b06788
fix spatial test
jcapriot Oct 17, 2024
46b8c75
update prism tests
jcapriot Oct 17, 2024
fce5699
improve gravity and magnetic prism tests
jcapriot Oct 17, 2024
314dad0
fix up some more tests
jcapriot Oct 18, 2024
22bec11
Adds a LineSegment class for a wholespace
jcapriot Oct 18, 2024
cea3683
fix wholespace and add orientation tests
jcapriot Oct 19, 2024
f399142
fix sign for linecurrent
jcapriot Oct 19, 2024
fc4ce09
Improve circular loop tests.
jcapriot Oct 19, 2024
7589516
assert allclose instead of allequal
jcapriot Oct 19, 2024
cbd6082
fix for 3.10 syntax
jcapriot Oct 19, 2024
1a1e164
more 3.10 fixes
jcapriot Oct 19, 2024
8e6f342
add import
jcapriot Oct 19, 2024
9ddf838
loosen test slightly
jcapriot Oct 19, 2024
ff25b91
add some numerical accuracy protection for the circular loop B-field
jcapriot Oct 21, 2024
9b3ee89
update test
jcapriot Oct 21, 2024
b2b7431
add small rho approximations for circular loop
jcapriot Oct 21, 2024
3990a58
use k_sq to check for small argument.
jcapriot Oct 21, 2024
7cea582
update codecov upload version
jcapriot Oct 21, 2024
9d0564a
Make LineCurrentFreeSpace the same as LineCurrentWholeSpace
jcapriot Oct 22, 2024
89f779e
rename test files
jcapriot Oct 22, 2024
87af1b7
Revert "rename test files"
jcapriot Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revert "rename test files"
This reverts commit 89f779e.
jcapriot committed Oct 22, 2024
commit 87af1b7221c769527e15bec74a2f03ec1e5444a2
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Unchanged files with check annotations Beta

def rho(self, value):
try:
value = float(value)
except:
raise TypeError(f"resistivity must be a number, got {type(value)}")

Check warning on line 77 in geoana/em/base.py

Codecov / codecov/patch

geoana/em/base.py#L76-L77

Added lines #L76 - L77 were not covered by tests
self.sigma = 1/value
B = rot.apply(B, inverse=True).reshape(xyz.shape)
if coordinates.lower() == "cylindrical":
B = cartesian_to_cylindrical(xyz, B)

Check warning on line 769 in geoana/em/static/wholespace.py

Codecov / codecov/patch

geoana/em/static/wholespace.py#L769

Added line #L769 was not covered by tests
return B
return self.current/(4 * np.pi * self.sigma * r)
# if I was a closed loop, return 0
if np.all(self.nodes[-1] == self.nodes[0]):
return np.zeros_like(xyz[..., 0])

Check warning on line 856 in geoana/em/static/wholespace.py

Codecov / codecov/patch

geoana/em/static/wholespace.py#L856

Added line #L856 was not covered by tests
r_A = np.linalg.norm(xyz - self.nodes[-1], axis=-1)
r_B = np.linalg.norm(xyz - self.nodes[0], axis=-1)
return self.current / (4 * np.pi * self.sigma) * (r_vec/r**3)
# if I was a closed loop, return 0
if np.all(self.nodes[-1] == self.nodes[0]):
return np.zeros_like(xyz)

Check warning on line 1057 in geoana/em/static/wholespace.py

Codecov / codecov/patch

geoana/em/static/wholespace.py#L1057

Added line #L1057 was not covered by tests
# otherwise, current leaks out at the ends!
r_vec_A = xyz - self.nodes[-1]
r_vec_B = xyz - self.nodes[0]