Skip to content
Snippets Groups Projects

Residual diagnostics

3 files
+ 30
39
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -43,7 +43,7 @@ def calculate(reading: Reading, adjust_reference: bool = True) -> Reading:
@@ -43,7 +43,7 @@ def calculate(reading: Reading, adjust_reference: bool = True) -> Reading:
mean=mean,
mean=mean,
reference=adjust_reference and reference or None,
reference=adjust_reference and reference or None,
)
)
absoluteD, average_mark, meridian, azimuth, magnetic_azimuth = calculate_D_absolute(
absoluteD, diagnostics = calculate_D_absolute(
azimuth=reading.azimuth,
azimuth=reading.azimuth,
h_baseline=absoluteH.baseline,
h_baseline=absoluteH.baseline,
measurements=reading.measurements,
measurements=reading.measurements,
@@ -58,16 +58,6 @@ def calculate(reading: Reading, adjust_reference: bool = True) -> Reading:
@@ -58,16 +58,6 @@ def calculate(reading: Reading, adjust_reference: bool = True) -> Reading:
inclination=inclination,
inclination=inclination,
measurements=scale_measurements,
measurements=scale_measurements,
)
)
diagnostics = Diagnostics(
meridian=meridian,
mean_mark=average_mark,
magnetic_azimuth=magnetic_azimuth,
mark_azimuth=azimuth,
declination=absoluteD.absolute,
inclination=inclination,
h_component=absoluteH.absolute,
z_component=absoluteZ.absolute,
)
# create new reading object
# create new reading object
calculated = Reading(
calculated = Reading(
absolutes=[absoluteD, absoluteH, absoluteZ],
absolutes=[absoluteD, absoluteH, absoluteZ],
@@ -84,7 +74,7 @@ def calculate_D_absolute(
@@ -84,7 +74,7 @@ def calculate_D_absolute(
azimuth: float,
azimuth: float,
h_baseline: float,
h_baseline: float,
reference: Measurement,
reference: Measurement,
) -> Absolute:
) -> Tuple[Absolute, Diagnostics]:
"""Calculate D absolute.
"""Calculate D absolute.
Parameters
Parameters
@@ -125,23 +115,6 @@ def calculate_D_absolute(
@@ -125,23 +115,6 @@ def calculate_D_absolute(
for m in declination_measurements
for m in declination_measurements
]
]
)
)
# calculate south-facing meridian for diagnostics
south_meridian = np.average(
[
m.angle
+ np.degrees(
m.measurement_type.meridian
* (np.arcsin(m.residual / np.sqrt((m.h + h_baseline) ** 2 + m.e ** 2)))
)
- np.degrees(np.arctan(m.e / (m.h + h_baseline)))
for m in [
average_measurement(measurements, [t])
for t in [mt.SOUTH_UP, mt.SOUTH_DOWN]
]
]
)
mark_azimuth = azimuth
shift = 0
shift = 0
if azimuth > 180:
if azimuth > 180:
shift = -180
shift = -180
@@ -150,8 +123,8 @@ def calculate_D_absolute(
@@ -150,8 +123,8 @@ def calculate_D_absolute(
d_b = (meridian - average_mark) + azimuth + shift
d_b = (meridian - average_mark) + azimuth + shift
# calculate absolute
# calculate absolute
d_abs = d_b + np.degrees(np.arctan(reference.e / (reference.h + h_baseline)))
d_abs = d_b + np.degrees(np.arctan(reference.e / (reference.h + h_baseline)))
# for diagnostics
# for diagnostics
 
magnetic_azimuth = average_mark - mean.angle
if average_mark > 180:
if average_mark > 180:
average_mark -= 90
average_mark -= 90
if meridian > 180:
if meridian > 180:
@@ -166,10 +139,11 @@ def calculate_D_absolute(
@@ -166,10 +139,11 @@ def calculate_D_absolute(
starttime=mean.time,
starttime=mean.time,
endtime=mean.endtime,
endtime=mean.endtime,
),
),
average_mark,
Diagnostics(
south_meridian,
meridian=mean.angle,
mark_azimuth,
mean_mark=average_mark,
(average_mark - meridian),
magnetic_azimuth=magnetic_azimuth,
 
),
)
)
Loading