Closed emiliom closed 1 month ago
Merging #1205 (43e44cd) into dev (9dfe5ba) will increase coverage by
15.77%
. Report is 3 commits behind head on dev. The diff coverage is97.61%
.
@@ Coverage Diff @@
## dev #1205 +/- ##
===========================================
+ Coverage 77.08% 92.85% +15.77%
===========================================
Files 67 3 -64
Lines 5921 196 -5725
===========================================
- Hits 4564 182 -4382
+ Misses 1357 14 -1343
Flag | Coverage Δ | |
---|---|---|
unittests | 92.85% <97.61%> (+15.77%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Files | Coverage Δ | |
---|---|---|
echopype/consolidate/api.py | 94.95% <97.61%> (+1.13%) |
:arrow_up: |
... and 64 files with indirect coverage changes
:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!
Notes to self for creating mock EchoData
data for testing the new functionality. Here's the minimal code needed to create a bare EchoData
object that has just the elements needed by consolidate.add_depth
: a sonar_model
attribute and the "Platform" and "Sonar/Beam_group1" groups.
from datatree import DataTree
import xarray as xr
from echopype.echodata.echodata import EchoData
ed = EchoData(sonar_model="EK80")
ds1 = xr.Dataset(dict(bar=("x", [1, 2])))
ds2 = xr.Dataset(dict(bar=("x", [10, 20])))
tree = DataTree.from_dict({'Platform': ds1, 'Sonar/Beam_group1': ds2}, name='root')
ed._set_tree(tree)
Added a test function to generate mock EchoData object with only the variables (and one attribute) required by consolidate.add_depth
. This function partially populates only the Platform
, Sonar
and Sonar/Beam_group1
groups, plus root by default. Also added a test (test_add_depth_from_echodata_mock
) that uses this mock data, together with a mock Sv Dataset.
@ctuguinay : This is also related to #1152. Let's talk through this.
We'll close this now because it'll be superseded by #1319 .
Overhaul
consolidate.add_depth
to enable using data from EchoData object. Addresses #790. See the echopype documentation for reference on several of the variables.Rotations are performed using scipy.spatial.transform.Rotation.
Notes and caveats:
depth
variable for the sample EK80 file, so I suspect something isn't working properly.tilt_x/y
variables are not handled. Only standard SONAR-netCDF4 variables are used. It assumes that tilt_x/y variables have already been transformed into pitch & roll. I'll create a new issue for this.TransducerAlphaX/Y/Z
variables are in degrees. We're currently interpreting them as a unit vector when mapping them tobeam_direction_x/y/z
. A conversion will need to be implemented inset_groups_ek80
(and ek60?). I'll create a new issue for this. For the sample file (below), it's not an issue b/c allTransducerAlphaX/Y/Z
values are zero. I couldn't find an EK80 file withTransducerAlphaX/Y/Z
values that are not all zero.pitch
,roll
, andvertical_offset
.vertical_offset
(based onheave
) is also suspicious b/c values are close to zero.water_level
(0) +vertical_offset
is supposed to be the positive distance from the ship origin.