diff --git a/geomagio/algorithm/SqDistAlgorithm.py b/geomagio/algorithm/SqDistAlgorithm.py index 4dc5087a230367e817f1dacaa4991d7523455d20..e2106c0fa1b83f92307b10f47ed3b311adca3ea8 100644 --- a/geomagio/algorithm/SqDistAlgorithm.py +++ b/geomagio/algorithm/SqDistAlgorithm.py @@ -461,7 +461,7 @@ class SqDistAlgorithm(Algorithm): # to White et al. (USGS SIR 2014-5045). fom = 10 ** (-3 / 20.0) # halve power at corner frequency omg = np.pi / np.float64(smooth) # corner angular frequency - sig = np.sqrt(-2 * np.log(fom) / omg ** 2) + np.finfo(float).eps # sig>0 + sig = np.sqrt(-2 * np.log(fom) / omg**2) + np.finfo(float).eps # sig>0 ts = np.linspace( np.max((-m, -3 * np.round(sig))), np.min((m, 3 * np.round(sig))), @@ -536,7 +536,7 @@ class SqDistAlgorithm(Algorithm): # when forecasting, grow sigma=sqrt(var) like a prediction # interval; sumc2 and jstep will be reset with the next # valid observation - phiJminus1 = phiJminus1 + phi ** jstep + phiJminus1 = phiJminus1 + phi**jstep jstep = jstep + 1 sumc2 = ( sumc2 diff --git a/geomagio/geomag_types.py b/geomagio/geomag_types.py index a50e2804e5baf21454dbdaf22f75254c51bd70ff..9a181bcd29aeb60fd1aa8e9ee52167ea0dedf602 100644 --- a/geomagio/geomag_types.py +++ b/geomagio/geomag_types.py @@ -1,4 +1,4 @@ -from typing_extensions import Literal +from typing import Literal DataInterval = Literal["tenhertz", "second", "minute", "hour", "day", "month"] DataType = Literal[ diff --git a/geomagio/residual/Calculation.py b/geomagio/residual/Calculation.py index fe1ab1c1ed48706ddb343a0282daec9842c69fe7..d6d820446db64c3526662cd4dff1f4be35a7653b 100644 --- a/geomagio/residual/Calculation.py +++ b/geomagio/residual/Calculation.py @@ -1,5 +1,4 @@ -from typing import List, Tuple -from typing_extensions import Literal +from typing import List, Literal, Tuple import numpy as np @@ -116,7 +115,7 @@ def calculate_D_absolute( m.angle + np.degrees( m.measurement_type.meridian - * (np.arcsin(m.residual / np.sqrt((m.h + h_baseline) ** 2 + m.e ** 2))) + * (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 declination_measurements @@ -168,7 +167,7 @@ def calculate_HZ_absolutes( inclination_radians = np.radians(inclination) h_abs = corrected_f * np.cos(inclination_radians) z_abs = corrected_f * np.sin(inclination_radians) - h_b = np.sqrt(h_abs ** 2 - mean.e ** 2) - mean.h + h_b = np.sqrt(h_abs**2 - mean.e**2) - mean.h z_b = z_abs - mean.z # adjust absolutes to reference measurement if reference: diff --git a/geomagio/residual/Reading.py b/geomagio/residual/Reading.py index 437da4992fd3bac827861ff3340c3743b530c143..101ba4b4b7ed3c7e36024e6c8234b03cb1aea55c 100644 --- a/geomagio/residual/Reading.py +++ b/geomagio/residual/Reading.py @@ -1,5 +1,4 @@ -from typing import Dict, List, Optional, Tuple -from typing_extensions import Literal +from typing import Dict, List, Literal, Optional, Tuple import numpy as np from obspy import Stream, UTCDateTime @@ -187,7 +186,7 @@ def get_ordinates( d_ord = d_abs - d_bas z_ord = z_abs - z_bas e_ord = h_abs * np.radians(d_ord) - h_ord = np.sqrt(h_ord ** 2 - e_ord ** 2) + h_ord = np.sqrt(h_ord**2 - e_ord**2) return (h_ord, e_ord, z_ord)