Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sec23
korte
pymagglobal
Commits
363c02c8
Commit
363c02c8
authored
May 14, 2021
by
Maximilian Schanner
Browse files
Add gradients for uncertainty handling.
parent
fa3f0f56
Changes
1
Hide whitespace changes
Inline
Side-by-side
pymagglobal/utils.py
View file @
363c02c8
...
...
@@ -39,6 +39,32 @@ def _nicelabel(label):
return
fr
'$
{
parts
[
0
]
}
$
{
parts
[
1
]
}
'
def
grad_d
(
n
,
e
,
z
):
'''Calculate the gradient of D.
'''
res
=
np
.
column_stack
((
-
e
,
n
,
np
.
zeros_like
(
n
)))
res
/=
(
n
**
2
+
e
**
2
)[:,
np
.
newaxis
]
return
np
.
rad2deg
(
res
)
def
grad_i
(
n
,
e
,
z
):
'''Calculate the gradient of I.
'''
res
=
-
np
.
column_stack
((
n
,
e
,
z
))
\
*
z
[:,
np
.
newaxis
]
res
/=
(
n
**
2
+
e
**
2
+
z
**
2
)[:,
np
.
newaxis
]
res
[:,
2
]
+=
1.
res
/=
np
.
sqrt
(
n
**
2
+
e
**
2
)[:,
np
.
newaxis
]
return
np
.
rad2deg
(
res
)
def
grad_f
(
n
,
e
,
z
):
'''Calculate the gradient of F '''
res
=
np
.
column_stack
((
n
,
e
,
z
))
res
/=
np
.
sqrt
(
n
**
2
+
e
**
2
+
z
**
2
)[:,
np
.
newaxis
]
return
res
def
nez2dif
(
n
,
e
,
z
):
'''Transform the magnetic field components north, east and vertically
downward to declination, inclination and intensity.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment