Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
a5fbbd45
Commit
a5fbbd45
authored
4 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
Account for azimuth shift, create default residual
parent
8093845a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
geomagio/residual/Calculation.py
+11
-6
11 additions, 6 deletions
geomagio/residual/Calculation.py
geomagio/residual/Measurement.py
+1
-1
1 addition, 1 deletion
geomagio/residual/Measurement.py
with
12 additions
and
7 deletions
geomagio/residual/Calculation.py
+
11
−
6
View file @
a5fbbd45
...
...
@@ -34,7 +34,7 @@ def calculate(reading: Reading) -> Reading:
inclination
,
f
,
mean
=
calculate_I
(
hemisphere
=
reading
.
hemisphere
,
measurements
=
reading
.
measurements
)
corrected_f
=
f
+
reading
.
pier_correction
# TODO: should this be returned?
corrected_f
=
f
+
reading
.
pier_correction
# calculate absolutes
absoluteH
,
absoluteZ
=
calculate_HZ_absolutes
(
corrected_f
=
corrected_f
,
inclination
=
inclination
,
mean
=
mean
,
reference
=
reference
...
...
@@ -46,11 +46,14 @@ def calculate(reading: Reading) -> Reading:
reference
=
reference
,
)
# calculate scale
scale_value
=
calculate_scale_value
(
corrected_f
=
corrected_f
,
inclination
=
inclination
,
measurements
=
reading
[
mt
.
NORTH_DOWN_SCALE
],
)
if
len
(
reading
[
mt
.
NORTH_DOWN_SCALE
])
>
0
:
scale_value
=
calculate_scale_value
(
corrected_f
=
corrected_f
,
inclination
=
inclination
,
measurements
=
reading
[
mt
.
NORTH_DOWN_SCALE
],
)
else
:
scale_value
=
None
# create new reading object
calculated
=
Reading
(
absolutes
=
[
absoluteD
,
absoluteH
,
absoluteZ
],
...
...
@@ -105,6 +108,8 @@ def calculate_D_absolute(
for
m
in
declination_measurements
]
)
if
azimuth
>
180
:
azimuth
-=
180
# add subtract average mark angle from average meridian angle and add
# azimuth to get the declination baseline
d_b
=
(
meridian
-
average_mark
)
+
azimuth
...
...
This diff is collapsed.
Click to expand it.
geomagio/residual/Measurement.py
+
1
−
1
View file @
a5fbbd45
...
...
@@ -87,7 +87,7 @@ def measurement_index(
def
safe_average
(
l
:
List
[
Optional
[
float
]]):
values
=
l
and
[
f
for
f
in
l
if
f
]
or
None
return
values
and
numpy
.
nanmean
(
values
)
or
None
return
values
and
numpy
.
nanmean
(
values
)
or
0.0
def
safe_max
(
l
:
List
[
Optional
[
float
]]):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment