Ray tracing acoustic propagation model
Project description
rtrs
3D Underwater acoustic ray tracing with arbitrary Cartesian receiver coordinates, geometry independent broadband beam tracing, and Python bindings.
Features
- Exclusively 3D ray / beam tracing
- Efficient wideband beam tracing using Gaussian beams (ray geometry is traced as frequency independent, then the beam influence is calculated at receiver coordinates for each frequency)
- Python bindings via pyo3 (No IO files)
- Cartesian receiver representation for grids and arrays
- Surface (vacuum) and bottom (rigid, lossy acoustic, lossy elastic) reflections
- 3D sound speed profiles ( $c(x,y,z)$ )
- 2D bathymetry ( $b(x,y)$ )
- Optional IO with json files
- Parallel processing over the number of rays / beams with rayon
- Optional no-ray-path mode to reduce memory and output size
- Euler and RK2 integration methods
- Input validation
Installing, Building, and Running
There are 3 main ways to use rtrs: directly with Rust and Cargo, with Python bindings, or using CLI with the pre-built binary and JSON input files (Not covered here). The first step is to clone the repository and navigate to the project directory:
git clone https://github.com/fincb/rtrs.git
cd rtrs
Rust, Cargo, and are required for all methods, Python is also required for the Python bindings. The recommended way (for linux and macos) to install Rust and Cargo is with rustup:
curl https://sh.rustup.rs -sSf | sh
Then check:
rustc --version
cargo --version
rustup --version
Building the Docs
- Primary docs via
cargo doc(guides and API together) - JSON schema:
docs/schema/simulation-config.schema.json
The primary documentation is built with cargo doc (guides and API together). To build the docs locally, run:
cargo doc --no-deps --features python
Or to open the docs in the browser after building:
cargo doc --no-deps --features python --open
The generated docs include user-facing guide pages under rtrs::guides:
rtrs::guides::install_and_buildrtrs::guides::input_referencertrs::guides::output_referencertrs::guides::python_usage
The json schema can be found here docs/schema/simulation-config.schema.json.
Rust & Cargo Build and Run
Build with cargo (the resulting binary will be in target/release/):
cargo build --release
Run with a JSON input file (compiles and runs in release mode):
cargo run --release <path_to_input_file>.json
Python Bindings Normal Build and Run
Set up a virtual environment and install dependencies:
python -m venv --prompt rtrs .venv
source .venv/bin/activate
pip install -e .
or with conda:
conda activate <env_name>
pip install -e .
Then in a Python script the package can be imported and used:
import rtrs
env = # <Dictionary with environment parameters>
result = rtrs.run_simulation(env)
Python Bindings with plotting for examples
For running the examples with plotting, install the viz extra dependencies:
python -m venv --prompt rtrs .venv
source .venv/bin/activate
pip install -e ".[viz]"
or with conda:
conda activate <env_name>
pip install -e ".[viz]"
Python Bindings with Development Mode
Useful for testing changes to the Rust code without needing to reinstall the package after every change. The dev extra also includes maturin as a dependency for building the Rust extension.
Set up a virtual environment and install dependencies:
python -m venv --prompt rtrs .venv
source .venv/bin/activate
pip install -e ".[dev]"
or with conda:
conda activate <env_name>
pip install -e ".[dev]"
For plotting and development, install both extras:
pip install -e ".[dev,viz]"
Build the Rust extension into the active environment and to rebuild after any changes to the Rust code:
maturin develop --release
See examples/ for usage with and without python bindings. Note that in the examples which do not use the python bindings, the program is compiled and run in release mode with cargo from within a python script.
Future PyPI Release
When published to PyPI, the package can be installed with:
pip install rtrs
Hopefully, pre-built wheels are distributed per platform and Python version via GitHub Actions using maturin-action, so no Rust toolchain is required.
Possible Future Features
- Low frequency correction
- Performance improvements
- Multiple sources and Source directivity patterns
- Delay and amplitude output
Name
The name "rtrs" means ray tracing rust (rs after the rust file extension .rs). The name in text is always all in lower case matching the name in code rtrs.
License
MIT License. See LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rtrs-0.2.3.tar.gz.
File metadata
- Download URL: rtrs-0.2.3.tar.gz
- Upload date:
- Size: 6.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57b370d62a3ea367fb2eebf0ce32ed29ae1d5997d3e9633a1ba4856679cc3571
|
|
| MD5 |
b7919f68dc466a233d4d38688c6628c3
|
|
| BLAKE2b-256 |
af928e09bb863dea3b90d1d0daa42ac014031dc25a228be371e66df7e7189ee5
|
Provenance
The following attestation bundles were made for rtrs-0.2.3.tar.gz:
Publisher:
release.yml on UoL-SignalProcessingGroup/rtrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtrs-0.2.3.tar.gz -
Subject digest:
57b370d62a3ea367fb2eebf0ce32ed29ae1d5997d3e9633a1ba4856679cc3571 - Sigstore transparency entry: 2021180934
- Sigstore integration time:
-
Permalink:
UoL-SignalProcessingGroup/rtrs@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/UoL-SignalProcessingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rtrs-0.2.3-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: rtrs-0.2.3-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 484.5 kB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73a6445176cd5ce8231e7d2ea3d733921158ab9327caea477b48224ea071afe7
|
|
| MD5 |
1773e657d5ce0a775e519e6d433c6a84
|
|
| BLAKE2b-256 |
ac651ba8b985e357697e685bbbcd31ae9ac85b777c24c61f3f058968dd8c6aa1
|
Provenance
The following attestation bundles were made for rtrs-0.2.3-cp314-cp314-macosx_11_0_arm64.whl:
Publisher:
release.yml on UoL-SignalProcessingGroup/rtrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtrs-0.2.3-cp314-cp314-macosx_11_0_arm64.whl -
Subject digest:
73a6445176cd5ce8231e7d2ea3d733921158ab9327caea477b48224ea071afe7 - Sigstore transparency entry: 2021181018
- Sigstore integration time:
-
Permalink:
UoL-SignalProcessingGroup/rtrs@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/UoL-SignalProcessingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rtrs-0.2.3-cp314-cp314-macosx_10_12_x86_64.whl.
File metadata
- Download URL: rtrs-0.2.3-cp314-cp314-macosx_10_12_x86_64.whl
- Upload date:
- Size: 503.5 kB
- Tags: CPython 3.14, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d0babf9be5b068c6bb1b24db13f77d76be58c985fcbf755426ea473662e9de5
|
|
| MD5 |
6e02500bd06505acd6daa51cfe1e6a5e
|
|
| BLAKE2b-256 |
42cb6ee83fb259c1c72631f55868f9243471c4587eb5e7b739712b6347726b58
|
Provenance
The following attestation bundles were made for rtrs-0.2.3-cp314-cp314-macosx_10_12_x86_64.whl:
Publisher:
release.yml on UoL-SignalProcessingGroup/rtrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtrs-0.2.3-cp314-cp314-macosx_10_12_x86_64.whl -
Subject digest:
7d0babf9be5b068c6bb1b24db13f77d76be58c985fcbf755426ea473662e9de5 - Sigstore transparency entry: 2021181238
- Sigstore integration time:
-
Permalink:
UoL-SignalProcessingGroup/rtrs@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/UoL-SignalProcessingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rtrs-0.2.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: rtrs-0.2.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 377.5 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a639dfa2f714618371dff55ceb91797284eddac3e333cd8fe8ebe823ac2c442f
|
|
| MD5 |
542376ad02f87965385d40a7aae3b654
|
|
| BLAKE2b-256 |
49fa3f18a9d87c2cb90cc725bcd30b498542459d5c9e6b4fcd8062cd94c4aad8
|
Provenance
The following attestation bundles were made for rtrs-0.2.3-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on UoL-SignalProcessingGroup/rtrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtrs-0.2.3-cp312-cp312-win_amd64.whl -
Subject digest:
a639dfa2f714618371dff55ceb91797284eddac3e333cd8fe8ebe823ac2c442f - Sigstore transparency entry: 2020990597
- Sigstore integration time:
-
Permalink:
UoL-SignalProcessingGroup/rtrs@2d6a52ab0fda364a43850ea5d4893c4ae4495209 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/UoL-SignalProcessingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2d6a52ab0fda364a43850ea5d4893c4ae4495209 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rtrs-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rtrs-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 563.6 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff13ac7986c693fa02043512569c763cef932225823a5098716e166d294dc81
|
|
| MD5 |
73e843c97566e4a130a41139f0c6bbcb
|
|
| BLAKE2b-256 |
b967cc440a25be3b200abfb2b502c196ab80a57bb0ca947808c044d2f93181f1
|
Provenance
The following attestation bundles were made for rtrs-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on UoL-SignalProcessingGroup/rtrs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rtrs-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fff13ac7986c693fa02043512569c763cef932225823a5098716e166d294dc81 - Sigstore transparency entry: 2021181094
- Sigstore integration time:
-
Permalink:
UoL-SignalProcessingGroup/rtrs@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/UoL-SignalProcessingGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fa9d8c57432a9d02067094ae6ef85accd0e4683 -
Trigger Event:
push
-
Statement type: