bluerobotics / bluerobotics/ping-viewer

Estimate sound speed

Open
#1,003 0 comments 0 reactions 0 assignees View on GitHub
enhance good first issue good-to-have interface-feature
Dominant language
C++
Stars
64
Forks
47
PR merge metrics
No merged PRs in 30d

Description

## Summary
Use depth/pressure, water temp, and salinity to estimate sound speed.

## Additional information
- Could accept relevant variable values from user input, or telemetry, or a combination (most ROVs don't have salinity/conductivity sensors)
- Would make sonar data more accurate
- May need to add `v_sound` to logging somehow:
- Ping360 Ping Viewer integration uses a quantised scan range (highest precision is integer meters), so when analysing it would be possible to programatically determine the `v_sound` that was used for a given ping by the sample period and number of samples if necessary - I could make a python example of how to do this as part of a more general analysis example, or as a separate 'advanced' one.
- Ping1D has no sample period property in the profile messages (or in the protocol at all), but actively uses `v_sound` for calculations, so perhaps Ping Viewer could send a `get v_sound` request after every `set v_sound` command so that it's appropriately logged.
- Likely best to use the UNESCO equation, but it may be sufficient/acceptable to use the Coppens* equation (a bit older and not quite as accurate, but has fewer terms and is similar in generality) - both equations (and a few others) detailed [here](http://resource.npl.co.uk/acoustics/techguides/soundseawater/underlying-phys.html).

*(My) Python example code for Coppens here:
```python3
def coppens(D,S,T):
''' The Coppens speed-of-sound in sea-water equation [m/s].

See: resource.npl.co.uk/acoustics/techguides/soundseawater/underlying-phys.html

'D' is depth in meters [0-4000].
'S' is salinity in parts-per-thousand (ppt) [0-45].
'T' is temperature in degrees Celsius [0-35].

All input parameters can be a single number or numpy array of numbers.

'''
D = D / 1000 # ensure copy to not modify possible input array
t = T / 10
t2 = t * t
t3 = t2 * t
dS = S - 35
c_0St = 1449.05 + 45.7*t - 5.21*t2 + 0.23*t3 + (1.333 - 0.126*t + 0.009*t2)*dS
c_DSt = c_0St + (16.23 + 0.253*t)*D + (0.213 - 0.1*t)*D*D + (0.016 + 0.0002*dS)*dS*t*D
return c_DSt
```

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by reviewing the Ping360 Ping Viewer and Ping1D integration points alongside the provided Coppens example; define how depth or pressure, temperature, and salinity arrive, how v_sound is logged, and how the chosen equation and resulting sonar accuracy should be verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
desktop, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.