Skip to content

Commit

Permalink
change test ping_time selection to be based on index
Browse files Browse the repository at this point in the history
  • Loading branch information
leewujung committed Aug 12, 2023
1 parent 8c9e8ff commit ad17757
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions echopype/tests/convert/test_convert_ek80.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,23 @@ def test_convert_ek80_complex_matlab(ek80_path):
# Test complex parsed data
ds_matlab = loadmat(ek80_matlab_path_bb)
assert np.array_equal(
echodata["Sonar/Beam_group1"].backscatter_r.sel(
channel='WBT 549762-15 ES70-7C', ping_time='2017-09-12T23:49:10.722999808'
).dropna('range_sample').squeeze().values[1:, :], # squeeze remove ping_time dimension
np.real(
ds_matlab['data']['echodata'][0][0][0, 0]['complexsamples']
(
echodata["Sonar/Beam_group1"].backscatter_r
.sel(channel='WBT 549762-15 ES70-7C')
.isel(ping_time=0)
.dropna('range_sample').squeeze().values[1:, :] # squeeze remove ping_time dimension
),
np.real(
ds_matlab['data']['echodata'][0][0][0, 0]['complexsamples']
), # real part
)
assert np.array_equal(
echodata["Sonar/Beam_group1"].backscatter_i.sel(
channel='WBT 549762-15 ES70-7C', ping_time='2017-09-12T23:49:10.722999808'
).dropna('range_sample').squeeze().values[1:, :], # squeeze remove ping_time dimension
(
echodata["Sonar/Beam_group1"].backscatter_i
.sel(channel='WBT 549762-15 ES70-7C')
.isel(ping_time=0)
.dropna('range_sample').squeeze().values[1:, :] # squeeze remove ping_time dimension
),
np.imag(
ds_matlab['data']['echodata'][0][0][0, 0]['complexsamples']
), # imag part
Expand Down

0 comments on commit ad17757

Please sign in to comment.