diff --git a/geomagio/residual/Calculation.py b/geomagio/residual/Calculation.py index 6d58c05401ee6d50655b478fb980321c4496b1ec..b4564260a52a6aabfccd93d6cc6669171e3d2fb1 100644 --- a/geomagio/residual/Calculation.py +++ b/geomagio/residual/Calculation.py @@ -41,18 +41,14 @@ def calculate(reading: Reading, adjust_reference: bool = True) -> Reading: mean=i_mean, reference=adjust_reference and reference or None, ) - absoluteD, d_mean, m_mean = calculate_D_absolute( + absoluteD, meridian = calculate_D_absolute( azimuth=reading.azimuth, h_baseline=absoluteH.baseline, measurements=reading.measurements, reference=adjust_reference and reference or None, ) # populate diagnostics object with averaged measurements - diagnostics = Diagnostics( - inclination_measurement=i_mean, - declination_measurement=d_mean, - mark_measurement=m_mean, - ) + diagnostics = Diagnostics(inclination=inclination, meridian=meridian,) # calculate scale scale_value = None scale_measurements = reading[mt.NORTH_DOWN_SCALE] @@ -137,8 +133,7 @@ def calculate_D_absolute( starttime=mean.time, endtime=mean.endtime, ), - mean, - average_mark, + meridian, ) diff --git a/geomagio/residual/Diagnostics.py b/geomagio/residual/Diagnostics.py index 7cd1bde862bcf895d8c3243fd0f48a782905583e..fd9dac1c9e515e1e1033f5fb8735272ee15e1d57 100644 --- a/geomagio/residual/Diagnostics.py +++ b/geomagio/residual/Diagnostics.py @@ -9,11 +9,9 @@ class Diagnostics(BaseModel): Attributes ---------- - inclination_measurement: Average of inclination measurements - declination_measurement: Average of declination measurements - mark_measurement: Average of mark measurements + inclination: Average of inclination measurements + meridian: Calculated meridian value """ - inclination_measurement: Measurement - declination_measurement: Measurement - mark_measurement: Measurement + inclination: float + meridian: float diff --git a/geomagio/residual/SpreadsheetAbsolutesFactory.py b/geomagio/residual/SpreadsheetAbsolutesFactory.py index 84d3aefafdd5c74803815e2e4c3b6d4bcf000be9..ea0f300a242a5038d83fd52eaa7ae7851bc98807 100644 --- a/geomagio/residual/SpreadsheetAbsolutesFactory.py +++ b/geomagio/residual/SpreadsheetAbsolutesFactory.py @@ -306,7 +306,7 @@ class SpreadsheetAbsolutesFactory(object): metadata=metadata, pier_correction=metadata["pier_correction"], scale_value=numpy.degrees(metadata["scale_value"]), - diagnostics=self._parse_diagnostics(measurements), + diagnostics=self._parse_diagnostics(calculation_sheet), ) def _parse_absolutes( @@ -410,19 +410,11 @@ class SpreadsheetAbsolutesFactory(object): "precision": measurement_sheet["H8"].value, } - def _parse_diagnostics(self, measurements: List[Measurement],) -> Diagnostics: + def _parse_diagnostics(self, sheet: openpyxl.worksheet,) -> Diagnostics: """ Gather diagnostics from list of measurements """ - return Diagnostics( - inclination_measurement=average_measurement( - measurements, INCLINATION_TYPES - ), - declination_measurement=average_measurement( - measurements, DECLINATION_TYPES - ), - mark_measurement=average_measurement(measurements, MARK_TYPES), - ) + return Diagnostics(inclination=sheet["H40"].value, meridian=sheet["E36"].value,) def convert_precision(angle, precision="DMS"):