Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert_allclose(res, np.array([0.98, 1.05]), 0.01, 0.01)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([2.05, 2.95, 4.05, 4.95]),
"linear",
variogram_models.linear_variogram_model,
True,
)
assert_allclose(res, np.array([0.98, 1.05]), 0.01, 0.01)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([1.0, 2.8284271, 5.1961524, 8.0]),
"power",
variogram_models.power_variogram_model,
False,
)
assert_allclose(res, np.array([1.0, 1.5, 0.0]), 0.001, 0.001)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([1.0, 1.4142, 1.7321, 2.0]),
"power",
variogram_models.power_variogram_model,
False,
)
assert_allclose(res, np.array([1.0, 0.5, 0.0]), 0.001, 0.001)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([1.2642, 1.7293, 1.9004, 1.9634]),
assert_allclose(res, np.array([0.98, 1.05]), 0.01, 0.01)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([1.0, 2.8284271, 5.1961524, 8.0]),
"power",
variogram_models.power_variogram_model,
False,
)
assert_allclose(res, np.array([1.0, 1.5, 0.0]), 0.001, 0.001)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([1.0, 1.4142, 1.7321, 2.0]),
"power",
variogram_models.power_variogram_model,
False,
)
assert_allclose(res, np.array([1.0, 0.5, 0.0]), 0.001, 0.001)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([1.2642, 1.7293, 1.9004, 1.9634]),
"exponential",
variogram_models.exponential_variogram_model,
False,
)
assert_allclose(res, np.array([2.0, 3.0, 0.0]), 0.001, 0.001)
res = core._calculate_variogram_model(
np.array([1.0, 2.0, 3.0, 4.0]),
np.array([0.5769, 1.4872, 1.9065, 1.9914]),
Default is False (off).
enable_plotting : boolean, optional
Enables plotting to display variogram. Default is False (off).
References
----------
.. [1] P.K. Kitanidis, Introduction to Geostatistcs: Applications in
Hydrogeology, (Cambridge University Press, 1997) 272 p.
"""
UNBIAS = True # This can be changed to remove the unbiasedness condition
# Really for testing purposes only...
eps = 1.0e-10 # Cutoff for comparison to zero
variogram_dict = {
"linear": variogram_models.linear_variogram_model,
"power": variogram_models.power_variogram_model,
"gaussian": variogram_models.gaussian_variogram_model,
"spherical": variogram_models.spherical_variogram_model,
"exponential": variogram_models.exponential_variogram_model,
"hole-effect": variogram_models.hole_effect_variogram_model,
}
def __init__(
self,
x,
y,
z,
variogram_model="linear",
variogram_parameters=None,
variogram_function=None,
nlags=6,
weight=False,
coordinates are interpreted as on a plane ('euclidean') or as
coordinates on a sphere ('geographic'). In case of geographic
coordinates, x is interpreted as longitude and y as latitude
coordinates, both given in degree. Longitudes are expected in
[0, 360] and latitudes in [-90, 90]. Default is 'euclidean'.
References
----------
.. [1] P.K. Kitanidis, Introduction to Geostatistcs: Applications in
Hydrogeology, (Cambridge University Press, 1997) 272 p.
"""
eps = 1.0e-10 # Cutoff for comparison to zero
variogram_dict = {
"linear": variogram_models.linear_variogram_model,
"power": variogram_models.power_variogram_model,
"gaussian": variogram_models.gaussian_variogram_model,
"spherical": variogram_models.spherical_variogram_model,
"exponential": variogram_models.exponential_variogram_model,
"hole-effect": variogram_models.hole_effect_variogram_model,
}
def __init__(
self,
x,
y,
z,
variogram_model="linear",
variogram_parameters=None,
variogram_function=None,
nlags=6,
weight=False,
Default is False (off).
enable_plotting : boolean, optional
Enables plotting to display variogram. Default is False (off).
References
----------
.. [1] P.K. Kitanidis, Introduction to Geostatistcs: Applications in
Hydrogeology, (Cambridge University Press, 1997) 272 p.
"""
UNBIAS = True # This can be changed to remove the unbiasedness condition
# Really for testing purposes only...
eps = 1.0e-10 # Cutoff for comparison to zero
variogram_dict = {
"linear": variogram_models.linear_variogram_model,
"power": variogram_models.power_variogram_model,
"gaussian": variogram_models.gaussian_variogram_model,
"spherical": variogram_models.spherical_variogram_model,
"exponential": variogram_models.exponential_variogram_model,
"hole-effect": variogram_models.hole_effect_variogram_model,
}
def __init__(
self,
x,
y,
z,
val,
variogram_model="linear",
variogram_parameters=None,
variogram_function=None,
nlags=6,
verbose : bool, optional
Enables program text output to monitor kriging process.
Default is False (off).
enable_plotting : bool, optional
Enables plotting to display variogram. Default is False (off).
References
----------
.. [1] P.K. Kitanidis, Introduction to Geostatistcs: Applications in
Hydrogeology, (Cambridge University Press, 1997) 272 p.
"""
eps = 1.0e-10 # Cutoff for comparison to zero
variogram_dict = {
"linear": variogram_models.linear_variogram_model,
"power": variogram_models.power_variogram_model,
"gaussian": variogram_models.gaussian_variogram_model,
"spherical": variogram_models.spherical_variogram_model,
"exponential": variogram_models.exponential_variogram_model,
"hole-effect": variogram_models.hole_effect_variogram_model,
}
def __init__(
self,
x,
y,
z,
val,
variogram_model="linear",
variogram_parameters=None,
variogram_function=None,
nlags=6,