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
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ exclude: ^(notebooks/misc_notebooks|notebooks/Ross_Ice_Shelf_inversion/|notebook

repos:
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.18.0"
rev: "1.20.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]
exclude: \.md

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.9"
rev: "v0.15.20"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -23,7 +23,7 @@ repos:
exclude: \.md

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
rev: "v6.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -65,7 +65,7 @@ repos:
# # - data-science-types

- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
rev: "v2.4.2"
hooks:
- id: codespell
name: codespell
Expand All @@ -74,7 +74,7 @@ repos:
args: [--ignore-words-list, montaj]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.10.0.1"
rev: "v0.11.0.1"
hooks:
- id: shellcheck

Expand All @@ -88,13 +88,13 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.20.2"
rev: "v0.25"
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.29.3"
rev: "0.37.4"
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Here we present a gravity inversion algorithm for modelling bathymetry. This is a non-linear geometric regularized least-squares inversion. Pre-existing bathymetry measurements can be used to constrain the inversion, and a Bayesian approach, via Monte Carlo simulation, is used to estimate uncertainties and sensitivity of the inversion to the various input data and parameters.

The inversion code in `RIS_gravity_inversion` has mostly been migrated to a separate Python package, [Invert4Geom](https://github.com/mdtanker/invert4geom), while some specific functions for the synthetic tests and specific bathymetry applications are retained here.
The inversion code in `RIS_gravity_inversion` has mostly been migrated to a separate Python package, [Invert4Geom](https://github.com/mdtanker/invert4geom), while some specific functions for the synthetic tests and specific bathymetry applications are retained here.

Detailed synthetic tests applied to Antarctic bathymetry data as part of a [manuscript submitted to The Cryosphere](https://egusphere.copernicus.org/preprints/2025/egusphere-2025-2380/) have been moved to the following repository: [https://github.com/mdtanker/synthetic_bathymetry_inversion](https://github.com/mdtanker/synthetic_bathymetry_inversion)

Expand Down
2 changes: 1 addition & 1 deletion plotting/tmp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
9.698970004336019 a 5000
10.380211241711606 a 24000
11.02938377768521 a 107000
11.681241237375588 a 480000
11.681241237375588 a 480000
22 changes: 11 additions & 11 deletions src/RIS_gravity_inversion/gravity_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,9 @@ def interp1d_windows(
**kwargs,
):
if line_col is not None:
assert (
len(df[line_col].unique()) <= 1
), "Warning: provided more than 1 flight line"
assert len(df[line_col].unique()) <= 1, (
"Warning: provided more than 1 flight line"
)

if isinstance(to_interp, str):
to_interp = [to_interp]
Expand Down Expand Up @@ -835,9 +835,9 @@ def interp1d(
):
""" """
if line_col is not None:
assert (
len(df[line_col].unique()) <= 1
), "Warning: provided more than 1 flight line"
assert len(df[line_col].unique()) <= 1, (
"Warning: provided more than 1 flight line"
)

if isinstance(to_interp, str):
to_interp = [to_interp]
Expand Down Expand Up @@ -1025,7 +1025,7 @@ def calculate_misties(
past_mistie_col = None
else:
mistie_col = f"mistie_{len(cols)}"
past_mistie_col = f"mistie_{len(cols)-1}"
past_mistie_col = f"mistie_{len(cols) - 1}"
log.info("Previous mistie column: %s", past_mistie_col)

log.info("New mistie column: %s", mistie_col)
Expand Down Expand Up @@ -1439,8 +1439,8 @@ def iterative_line_levelling(
data_col = starting_data_col
mistie_col = starting_mistie_col
else:
data_col = f"{levelled_data_prefix}_{i-1}"
mistie_col = f"{mistie_prefix}_{i-1}"
data_col = f"{levelled_data_prefix}_{i - 1}"
mistie_col = f"{mistie_prefix}_{i - 1}"

# with inv_utils.HiddenPrints():
df, ints = level_lines(
Expand Down Expand Up @@ -1532,8 +1532,8 @@ def iterative_levelling_alternate(
data_col = starting_data_col
mistie_col = starting_mistie_col
else:
data_col = f"{levelled_data_prefix}_{i-1}t"
mistie_col = f"{mistie_prefix}_{i-1}t"
data_col = f"{levelled_data_prefix}_{i - 1}t"
mistie_col = f"{mistie_prefix}_{i - 1}t"

# level lines to ties
df, ints = level_lines(
Expand Down
2 changes: 1 addition & 1 deletion src/RIS_gravity_inversion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def round_to_input(num, multiple):
plt.axvline(
forward_df.forward_total.max() * p,
color=col[i],
label=f"{p*100}%",
label=f"{p * 100}%",
)
plt.xlabel("grav")
plt.ylabel("count")
Expand Down