Skip to content

Commit bbc3a82

Browse files
committed
Updates
- Add help file into wheel - Improve readme by adding screenshots
1 parent c56fe3e commit bbc3a82

6 files changed

Lines changed: 95 additions & 80 deletions

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ Install from pypi:
1212
pip install spherets
1313
```
1414

15-
and run the GUI from a termainal with `spherets`.
15+
and run the GUI from a termainal (type `spherets`) to get the main window:
16+
17+
![main](docs/main%20screen.png "Main screen")
18+
19+
TS values are shown in a separate window:
20+
21+
![results](docs/plot%20screen.png "Results window")
1622

1723
The underlying target strength functions are also available, for example:
1824

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,78 @@
1-
<!--
2-
Copyright 2014 Gavin Macaulay
3-
4-
This file is part of SphereTS.
5-
6-
SphereTS is free software: you can redistribute it and/or modify
7-
it under the terms of the GNU General Public License as published by
8-
the Free Software Foundation, either version 3 of the License, or
9-
(at your option) any later version.
10-
11-
SphereTS is distributed in the hope that it will be useful,
12-
but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
GNU General Public License for more details.
15-
16-
You should have received a copy of the GNU General Public License
17-
along with SphereTS. If not, see <http://www.gnu.org/licenses/>.
18-
-->
19-
<h2>Sphere TS calculator</h2>
20-
<p>This program calculates the target strength (TS) of acoustic calibration spheres.</p>
21-
22-
<p>Developed by Gavin Macaulay.</p>
23-
24-
<h3>Instructions</h3>
25-
26-
<li>Set the appropriate sphere and environmental properties.
27-
<li>Choose the desired spot frequencies and frequency sweep limits.
28-
<li>Click on the <b>Calculate</b> button to produce a plot of the sphere TS.
29-
30-
<p>The TS will then be calculated over the frequency sweep range and plotted
31-
in a separate window. Both the averaged and unaveraged TS are plotted. </p>
32-
33-
<p>The TS at the spot frequencies will be shown in
34-
a box in the plot window. The spot frequencies are always averaged. If the averaging
35-
bandwidth would cause the frequency to be less than zero, it is truncated
36-
at zero and the average TS value is flagged with an asterisk.</p>
37-
38-
<h3>Methods</h3>
39-
40-
<p>The sphere target strength is calculated using equations 6-9 of MacLennan (1981) between
41-
the given start and stop frequencies. An averaged
42-
TS is also calculated via a linear mean over the frequencies within
43-
the given bandwidth. The frequency resolution is set automatically to give a smooth plot in a short computation time.</p>
44-
45-
<p>In addition, the bandwidth averaged TS at spot frequencies is calculated.
46-
This is done independently of the frequency sweep calculation.</p>
47-
48-
<p>When the <em>Calculate from T,S, and D</em> option is ticked, the water sound
49-
speed and density are calculated using the <a href="http://www.teos-10.org">TEOS-10</a> formulation.</p>
50-
51-
<h3>Acknowledgements</h3>
52-
53-
The style and functioning of this program was modelled on the Matlab code
54-
developed by Dezchang Chu, NOAA.
55-
56-
<h3>References</h3>
57-
58-
<p>MacLennan, D.N., 1981. The Theory of Solid Spheres
59-
as Sonar Calibration Targets. Scottish Fisheries Research
60-
Report No. 22, Department of Agriculture and Fisheries for Scotland.</p>
61-
62-
<h3>Copyright</h3>
63-
64-
<p>Copyright 2025 Gavin Macaulay</p>
65-
66-
<p>This program is free software: you can redistribute it and/or modify
67-
it under the terms of the GNU General Public License as published by
68-
the Free Software Foundation, either version 3 of the License, or
69-
(at your option) any later version.</p>
70-
71-
<p>This program is distributed in the hope that it will be useful,
72-
but WITHOUT ANY WARRANTY; without even the implied warranty of
73-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74-
GNU General Public License for more details.</p>
75-
76-
<p>You should have received a copy of the GNU General Public License
77-
along with with this program. If not, see
78-
<a href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>.</p>
1+
<!--
2+
Copyright 2014 Gavin Macaulay
3+
4+
This file is part of SphereTS.
5+
6+
SphereTS is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation, either version 3 of the License, or
9+
(at your option) any later version.
10+
11+
SphereTS is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with SphereTS. If not, see <http://www.gnu.org/licenses/>.
18+
-->
19+
<h2>Sphere TS calculator</h2>
20+
<p>This program calculates the target strength (TS) of acoustic calibration spheres.</p>
21+
22+
<p>Developed by Gavin Macaulay.</p>
23+
24+
<h3>Instructions</h3>
25+
26+
<li>Set the appropriate sphere and environmental properties.
27+
<li>Choose the desired spot frequencies and frequency sweep limits.
28+
<li>Click on the <b>Calculate</b> button to produce a plot of the sphere TS.
29+
30+
<p>The TS will then be calculated over the frequency sweep range and plotted
31+
in a separate window. Both the averaged and unaveraged TS are plotted. </p>
32+
33+
<p>The TS at the spot frequencies will be shown in
34+
a box in the plot window. The spot frequencies are always averaged. If the averaging
35+
bandwidth would cause the frequency to be less than zero, it is truncated
36+
at zero and the average TS value is flagged with an asterisk.</p>
37+
38+
<h3>Methods</h3>
39+
40+
<p>The sphere target strength is calculated using equations 6-9 of MacLennan (1981) between
41+
the given start and stop frequencies. An averaged
42+
TS is also calculated via a linear mean over the frequencies within
43+
the given bandwidth. The frequency resolution is set automatically to give a smooth plot in a short computation time.</p>
44+
45+
<p>In addition, the bandwidth averaged TS at spot frequencies is calculated.
46+
This is done independently of the frequency sweep calculation.</p>
47+
48+
<p>When the <em>Calculate from T,S, and D</em> option is ticked, the water sound
49+
speed and density are calculated using the <a href="http://www.teos-10.org">TEOS-10</a> formulation.</p>
50+
51+
<h3>Acknowledgements</h3>
52+
53+
The style and functioning of this program was modelled on the Matlab code
54+
developed by Dezchang Chu, NOAA.
55+
56+
<h3>References</h3>
57+
58+
<p>MacLennan, D.N., 1981. The Theory of Solid Spheres
59+
as Sonar Calibration Targets. Scottish Fisheries Research
60+
Report No. 22, Department of Agriculture and Fisheries for Scotland.</p>
61+
62+
<h3>Copyright</h3>
63+
64+
<p>Copyright 2025 Gavin Macaulay</p>
65+
66+
<p>This program is free software: you can redistribute it and/or modify
67+
it under the terms of the GNU General Public License as published by
68+
the Free Software Foundation, either version 3 of the License, or
69+
(at your option) any later version.</p>
70+
71+
<p>This program is distributed in the hope that it will be useful,
72+
but WITHOUT ANY WARRANTY; without even the implied warranty of
73+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74+
GNU General Public License for more details.</p>
75+
76+
<p>You should have received a copy of the GNU General Public License
77+
along with with this program. If not, see
78+
<a href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>.</p>

docs/main screen.png

34 KB
Loading

docs/plot screen.png

62.1 KB
Loading

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ build-backend = "hatchling.build"
55
[tool.hatch.build.targets.wheel]
66
packages = ["src/sphereTS"]
77

8+
[tool.hatch.build.targets.sdist.force-include]
9+
"docs" = "docs"
10+
11+
[tool.hatch.build.targets.wheel.force-include]
12+
"docs" = "sphereTS/docs"
13+
814
[project]
915
name = "sphereTS"
1016
keywords = ["acoustic", "sphere", "calibration", "fisheries"]

src/sphereTS/sphere_ts_gui.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# Add unittests
2626

2727
import sys
28+
from pathlib import Path
2829
from .sphere_ts import freq_response, calculate_ts_table, material_properties, water_properties
2930

3031
import matplotlib.pyplot as plt
@@ -44,10 +45,11 @@ class AboutDialog(HasTraits):
4445
html-formatted text.
4546
"""
4647

47-
helpFile = 'about.html'
48+
helpFile = Path(__file__).parent/'docs'/'about.html'
4849
about_text = Str()
4950
view = View(Item('about_text', editor=HTMLEditor(), show_label=False),
5051
resizable=True, title='About',
52+
width=500, height=700,
5153
buttons=[OKButton])
5254

5355
def load_help_text(self):
@@ -67,6 +69,7 @@ class EK60Dialog(HasTraits):
6769
view = View(Item('html_text',
6870
editor=HTMLEditor(format_text=False), show_label=False),
6971
title='EK60',
72+
width=500, height=700,
7073
buttons=[OKButton],
7174
resizable=True)
7275

0 commit comments

Comments
 (0)