Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023-2025 Mira Geoscience
Copyright (c) 2022-2026 Mira Geoscience

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README-dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ Here is a suggestion for some plugins you can install in PyCharm.

Copyright
^^^^^^^^^
Copyright (c) 2023-2025 Mira Geoscience Ltd.
Copyright (c) 2022-2026 Mira Geoscience Ltd.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ License
^^^^^^^
MIT License

Copyright (c) 2023-2024 Mira Geoscience
Copyright (c) 2022-2026 Mira Geoscience

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils-assets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2022-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2022-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/driver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/driver/data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/driver/driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/driver/params.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/modelling/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/modelling/plates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/param_sweeps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/param_sweeps/driver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/param_sweeps/generate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2024-2025 Mira Geoscience Ltd. '
# Copyright (c) 2024-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/conversions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/formatters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/importing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/iterables.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/locations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
33 changes: 32 additions & 1 deletion geoapps_utils/utils/numerical.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand All @@ -11,6 +11,7 @@
from __future__ import annotations

import numpy as np
from scipy.sparse import csr_matrix, diags
from scipy.spatial import cKDTree


Expand Down Expand Up @@ -202,3 +203,33 @@ def fit_circle(x_val: np.ndarray, y_val) -> tuple[float, float, float]:
radius = (coef[0] ** 2.0 + coef[1] ** 2.0 + coef[2]) ** 0.5

return radius, coef[0], coef[1]


def inverse_weighted_operator(
values: np.ndarray,
col_indices: np.ndarray,
shape: tuple,
power: float,
threshold: float,
) -> csr_matrix:
"""
Create an inverse distance weighted sparse matrix.

:param values: Distance values.
:param col_indices: Column indices for the sparse matrix.
:param shape: Shape of the sparse matrix.
:param power: Power for the inverse distance weighting.
:param threshold: Threshold to avoid singularities.

:return: Inverse distance weighted sparse matrix.
"""
weights = (values**power + threshold) ** -1
n_vals_row = weights.shape[0] // shape[0]
row_ids = np.repeat(np.arange(shape[0]), n_vals_row)
inv_dist_op = csr_matrix(
(weights, (row_ids, col_indices)),
shape=shape,
)
# Normalize the rows
row_sum = np.asarray(inv_dist_op.sum(axis=1)).flatten() ** -1.0
return diags(row_sum) @ inv_dist_op
2 changes: 1 addition & 1 deletion geoapps_utils/utils/plotting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2023-2025 Mira Geoscience Ltd. '
# Copyright (c) 2022-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
2 changes: 1 addition & 1 deletion geoapps_utils/utils/reference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2024-2025 Mira Geoscience Ltd. '
# Copyright (c) 2024-2026 Mira Geoscience Ltd. '
# '
# This file is part of geoapps-utils package. '
# '
Expand Down
Loading
Loading