sonarcal 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,18 @@
1
+ name: Build documentation
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ permissions:
7
+ contents: write
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: 3.x
16
+ - run: pip install mkdocs mkdocstrings[python] mkdocs-material
17
+ - run: mkdocs gh-deploy --force --clean --verbose
18
+
@@ -0,0 +1,145 @@
1
+ name: Build and publish sonarcal
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ # test:
7
+ # strategy:
8
+ # matrix:
9
+ # os: [ubuntu-latest, windows-latest, macos-latest]
10
+ # python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
11
+
12
+ # runs-on: ${{ matrix.os }}
13
+ # steps:
14
+ # - name: Checkout sonarcal
15
+ # uses: actions/checkout@v4
16
+ # - name: Set up Python ${{ matrix.python-version }}
17
+ # uses: actions/setup-python@v5
18
+ # with:
19
+ # python-version: ${{ matrix.python-version }}
20
+ # - name: Install packages
21
+ # run: |
22
+ # python -m pip install --upgrade pip
23
+ # python -m pip install .[dev] # NOTE: [dev] includes pytest
24
+ # - name: Run tests with pytest
25
+ # run: python -m pytest -v -s
26
+
27
+ build:
28
+ name: Build distribution
29
+ runs-on: ubuntu-latest
30
+ # needs: test
31
+
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Set up Python
35
+ uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.x"
38
+ - name: Install pypa/build
39
+ run: >-
40
+ python3 -m
41
+ pip install
42
+ build
43
+ --user
44
+ - name: Get history and tags for SCM versioning to work
45
+ run: |
46
+ git branch
47
+ git fetch --prune --unshallow
48
+ git fetch --depth=1 origin +refs/tags/*:refs/tags/*
49
+ - name: Build a binary wheel and a source tarball
50
+ run: python3 -m build
51
+ - name: Store the distribution packages
52
+ uses: actions/upload-artifact@v4
53
+ with:
54
+ name: python-package-distributions
55
+ path: dist/
56
+
57
+ publish-to-pypi:
58
+ name: >-
59
+ Publish sonarcal to PyPI
60
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
61
+ needs:
62
+ - build
63
+ runs-on: ubuntu-latest
64
+ environment:
65
+ name: pypi
66
+ url: https://pypi.org/p/sonarcal
67
+ permissions:
68
+ id-token: write # IMPORTANT: mandatory for trusted publishing
69
+
70
+ steps:
71
+ - name: Download all the dists
72
+ uses: actions/download-artifact@v4
73
+ with:
74
+ name: python-package-distributions
75
+ path: dist/
76
+ - name: Publish distribution to PyPI
77
+ uses: pypa/gh-action-pypi-publish@release/v1
78
+
79
+ github-release:
80
+ name: >-
81
+ Sign the Python distribution with Sigstore
82
+ and upload them to GitHub Release
83
+ needs:
84
+ - publish-to-pypi
85
+ runs-on: ubuntu-latest
86
+
87
+ permissions:
88
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
89
+ id-token: write # IMPORTANT: mandatory for sigstore
90
+
91
+ steps:
92
+ - name: Download all the dists
93
+ uses: actions/download-artifact@v4
94
+ with:
95
+ name: python-package-distributions
96
+ path: dist/
97
+ - name: Sign the dists with Sigstore
98
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
99
+ with:
100
+ inputs: >-
101
+ ./dist/*.tar.gz
102
+ ./dist/*.whl
103
+ - name: Create GitHub Release
104
+ env:
105
+ GITHUB_TOKEN: ${{ github.token }}
106
+ run: >-
107
+ gh release create
108
+ '${{ github.ref_name }}'
109
+ --repo '${{ github.repository }}'
110
+ --notes ""
111
+ - name: Upload artifact signatures to GitHub Release
112
+ env:
113
+ GITHUB_TOKEN: ${{ github.token }}
114
+ # Upload to GitHub Release using the `gh` CLI.
115
+ # `dist/` contains the built packages, and the
116
+ # sigstore-produced signatures and certificates.
117
+ run: >-
118
+ gh release upload
119
+ '${{ github.ref_name }}' dist/**
120
+ --repo '${{ github.repository }}'
121
+
122
+ publish-to-testpypi:
123
+ name: Publish sonarcal to TestPyPI
124
+ needs:
125
+ - build
126
+ runs-on: ubuntu-latest
127
+
128
+ environment:
129
+ name: testpypi
130
+ url: https://test.pypi.org/p/sonarcal
131
+
132
+ permissions:
133
+ id-token: write # IMPORTANT: mandatory for trusted publishing
134
+
135
+ steps:
136
+ - name: Download all the dists
137
+ uses: actions/download-artifact@v4
138
+ with:
139
+ name: python-package-distributions
140
+ path: dist/
141
+ - name: Publish distribution to TestPyPI
142
+ uses: pypa/gh-action-pypi-publish@release/v1
143
+ with:
144
+ verbose: true
145
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,3 @@
1
+
2
+ /src/sonarcal/__pycache__
3
+ /dist
sonarcal-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Aqulayd LIMITED
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,81 @@
1
+ Metadata-Version: 2.4
2
+ Name: sonarcal
3
+ Version: 0.1.0
4
+ Summary: Software to facilitate standard-sphere calibration of omni-directional sonars
5
+ Project-URL: Homepage, https://github.com/Aqualyd-Limited/sonarCal
6
+ Project-URL: Issues, https://github.com/Aqualyd-Limited/sonarCal/issues
7
+ Project-URL: Documentation, https://Aqualyd-Limited/sonarCal
8
+ Project-URL: Repository, https://github.com/Aqualyd-Limited/sonarCal
9
+ Project-URL: Discussions, https://github.com/Aqualyd-Limited/sonarCal/discussions
10
+ Author: Gavin Macaulay
11
+ License: MIT License
12
+
13
+ Copyright (c) 2025 Aqulayd LIMITED
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ License-File: LICENSE
33
+ Keywords: acoustic,calibration,sonar
34
+ Classifier: Development Status :: 3 - Alpha
35
+ Classifier: Intended Audience :: Science/Research
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Programming Language :: Python :: 3.14
43
+ Classifier: Topic :: Scientific/Engineering
44
+ Requires-Python: >=3.11
45
+ Requires-Dist: h5py
46
+ Requires-Dist: humanize
47
+ Requires-Dist: matplotlib
48
+ Requires-Dist: numpy
49
+ Requires-Dist: pandas
50
+ Requires-Dist: pillow
51
+ Requires-Dist: platformdirs
52
+ Requires-Dist: scipy
53
+ Provides-Extra: dev
54
+ Requires-Dist: mkdocs-material; extra == 'dev'
55
+ Requires-Dist: mkdocstrings[python]; extra == 'dev'
56
+ Requires-Dist: pytest; extra == 'dev'
57
+ Requires-Dist: twine; extra == 'dev'
58
+ Description-Content-Type: text/markdown
59
+
60
+
61
+ This repository contains a Python packages to assist with the calibration of ship-mounted fisheries omni-sonar systems.
62
+
63
+ _This package is under active development_
64
+
65
+ # Installation
66
+
67
+ Install using pip:
68
+
69
+ ```
70
+ pip install sonarcal
71
+ ```
72
+
73
+ or upgrade:
74
+
75
+ ```
76
+ pip install sonarcal --upgrade
77
+ ```
78
+
79
+ # Documentation
80
+
81
+ The user and technical manuals are available [here](https://aqualyd-limited.github.io/sonarCal/).
@@ -0,0 +1,22 @@
1
+
2
+ This repository contains a Python packages to assist with the calibration of ship-mounted fisheries omni-sonar systems.
3
+
4
+ _This package is under active development_
5
+
6
+ # Installation
7
+
8
+ Install using pip:
9
+
10
+ ```
11
+ pip install sonarcal
12
+ ```
13
+
14
+ or upgrade:
15
+
16
+ ```
17
+ pip install sonarcal --upgrade
18
+ ```
19
+
20
+ # Documentation
21
+
22
+ The user and technical manuals are available [here](https://aqualyd-limited.github.io/sonarCal/).
Binary file
@@ -0,0 +1,24 @@
1
+ # User Manual
2
+ This will be the documentation for the program.
3
+
4
+ ## How to use
5
+
6
+ ![Main screen](assets/screenshot.png){ align=right }
7
+ /// caption
8
+ The main operation screen.
9
+ ///
10
+
11
+
12
+ ![](assets/Beam_example.png){ align=right }
13
+ /// caption
14
+ The seconday display of ping amplitudes.
15
+ ///
16
+
17
+ ## Configuration
18
+
19
+ some text
20
+
21
+ ## Export of data
22
+
23
+ some text
24
+
@@ -0,0 +1,6 @@
1
+ # Technical Manual
2
+
3
+ This will be the technical documentation for the program and
4
+ include API documentation if appropriate.
5
+
6
+ ## Adding support for other sonars
@@ -0,0 +1,85 @@
1
+ site_name: sonarcal
2
+ repo_url: https://github.com/Aqualyd-Limited/sonarCal
3
+ edit_uri: edit/main/docs/
4
+ site_url: https://Aqualyd-Limited.github.io/sonarCal
5
+
6
+ nav:
7
+ - User Manual: index.md
8
+ - Technical Manual: technical.md
9
+
10
+ theme:
11
+ name: material
12
+ logo: assets/sonarcal_logo.png
13
+ favicon: assets/sonarcal_logo.png
14
+ icon:
15
+ repo: fontawesome/brands/github
16
+ features:
17
+ - navigation.top
18
+ - content.action.view
19
+ - content.code.copy
20
+ - search.suggest
21
+ - search.highlight
22
+ - search.share
23
+ palette:
24
+ # Palette toggle for automatic mode
25
+ - media: "(prefers-color-scheme)"
26
+ toggle:
27
+ icon: material/brightness-auto
28
+ name: Switch to light mode
29
+
30
+ # Palette toggle for light mode
31
+ - media: "(prefers-color-scheme: light)"
32
+ scheme: default
33
+ primary: amber
34
+ toggle:
35
+ icon: material/brightness-7
36
+ name: Switch to dark mode
37
+
38
+ # Palette toggle for dark mode
39
+ - media: "(prefers-color-scheme: dark)"
40
+ scheme: slate
41
+ primary: blue grey
42
+ toggle:
43
+ icon: material/brightness-4
44
+ name: Switch to system preference
45
+
46
+ plugins:
47
+ - search
48
+ - autorefs
49
+ - mkdocstrings:
50
+ handlers:
51
+ python:
52
+ paths: [src]
53
+ options:
54
+ docstring_style: numpy
55
+ show_submodules: false
56
+ show_symbol_type_heading: true
57
+ merge_init_into_class: true
58
+ show_bases: true
59
+ inherited_members: true
60
+ show_root_heading: true
61
+ show_root_toc_entry: false
62
+ show_source: true
63
+ heading_level: 3
64
+ filters:
65
+ - "!^_"
66
+
67
+ watch:
68
+ - ./docs
69
+
70
+ markdown_extensions:
71
+ - attr_list
72
+ - md_in_html
73
+ - pymdownx.blocks.caption
74
+ - footnotes
75
+ - tables
76
+ - pymdownx.highlight:
77
+ anchor_linenums: true
78
+ line_spans: __span
79
+ pygments_lang_class: true
80
+ - pymdownx.inlinehilite
81
+ - pymdownx.snippets
82
+ - pymdownx.superfences
83
+ - admonition
84
+ - pymdownx.details
85
+
@@ -0,0 +1,69 @@
1
+ [build-system]
2
+ requires = ["hatchling", 'hatch-vcs']
3
+ build-backend = "hatchling.build"
4
+
5
+ [tool.hatch.build.targets.wheel]
6
+ packages = ["src/sonarcal"]
7
+
8
+ [project]
9
+ name = 'sonarcal'
10
+ license = {file = "LICENSE"}
11
+ keywords = ["acoustic", "sonar", "calibration"]
12
+ authors = [
13
+ { name="Gavin Macaulay"}
14
+ ]
15
+ description = 'Software to facilitate standard-sphere calibration of omni-directional sonars'
16
+ readme = "README.md"
17
+ requires-python = ">=3.11"
18
+ dependencies = [
19
+ "numpy",
20
+ "scipy",
21
+ "matplotlib",
22
+ "pandas",
23
+ "humanize",
24
+ "h5py",
25
+ "Pillow",
26
+ "platformdirs"
27
+ ]
28
+ classifiers = [
29
+ 'Development Status :: 3 - Alpha',
30
+ 'Intended Audience :: Science/Research',
31
+ 'License :: OSI Approved :: MIT License',
32
+ 'Operating System :: OS Independent',
33
+ 'Programming Language :: Python :: 3',
34
+ 'Programming Language :: Python :: 3.11',
35
+ 'Programming Language :: Python :: 3.12',
36
+ 'Programming Language :: Python :: 3.13',
37
+ 'Programming Language :: Python :: 3.14',
38
+ 'Topic :: Scientific/Engineering',
39
+ ]
40
+ dynamic = [ 'version']
41
+
42
+ [project.scripts]
43
+ sonarcal = "sonarcal.controller:main"
44
+
45
+ [tool.hatch.version]
46
+ source = 'vcs'
47
+
48
+ [tool.hatch.version.raw-options]
49
+ local_scheme = "no-local-version" # otherwise the non-tagged version is not accepted by testpypi
50
+
51
+ [tool.pytest.ini_options]
52
+ testpaths = ['tests',]
53
+ addopts = ["--import-mode=importlib",]
54
+
55
+ [project.optional-dependencies]
56
+ dev = [
57
+ "mkdocstrings[python]",
58
+ "mkdocs-material",
59
+ "twine",
60
+ "pytest",
61
+ ]
62
+
63
+
64
+ [project.urls]
65
+ Homepage = 'https://github.com/Aqualyd-Limited/sonarCal'
66
+ Issues = 'https://github.com/Aqualyd-Limited/sonarCal/issues'
67
+ Documentation = 'https://Aqualyd-Limited/sonarCal'
68
+ Repository = 'https://github.com/Aqualyd-Limited/sonarCal'
69
+ Discussions = 'https://github.com/Aqualyd-Limited/sonarCal/discussions'
File without changes
@@ -0,0 +1,4 @@
1
+ """Provides a command line interface to the calibration program."""
2
+ from sonarcal import controller
3
+
4
+ controller.main()
@@ -0,0 +1,7 @@
1
+ import pandas as pd
2
+
3
+ def calculate_gain(sphere_ts):
4
+ """Calculate the beam calibration gain and other stats."""
5
+ df = pd.DataFrame(sphere_ts, columns=['timestamp', 'ts', 'range'])
6
+ return (df['ts'].mean(), df['ts'].std(), df['range'].mean(), len(df))
7
+
@@ -0,0 +1,19 @@
1
+ import pandas as pd
2
+
3
+ class calibrationData():
4
+ """Storage for sonar caliration results."""
5
+
6
+ def __init__(self):
7
+ self.data = pd.DataFrame(columns=['Time', 'Gain (dB)', 'RMS (dB)', 'Range (m)', 'Echoes'])
8
+ self.data.index.name = 'Beam'
9
+
10
+ def update(self, beam: int, timestamp: str, gain: float, rms: float, r: float, num: int):
11
+ self.data.loc[beam] = (timestamp, gain, rms, r, num)
12
+
13
+ def remove(self, beams: list[int]):
14
+ """Remove data for given beam."""
15
+ self.data.drop(index=beams, inplace=True)
16
+
17
+ def df(self):
18
+ return self.data # eventually return a better form of the data?
19
+