@@ -196,7 +196,7 @@ def test_ek_depth_utils_group_variable_NaNs_logger_warnings(caplog):
196
196
ds_Sv = ep .calibrate .compute_Sv (ed , ** {"waveform_mode" :"CW" , "encode_mode" :"power" })
197
197
198
198
# Set first index of group variables to NaN
199
- ed ["Platform" ]["water_level" ] = np .nan # Is a scalar
199
+ ed ["Platform" ]["water_level" ]. values = np .nan # Is a scalar
200
200
ed ["Platform" ]["vertical_offset" ].values [0 ] = np .nan
201
201
ed ["Platform" ]["transducer_offset_z" ].values [0 ] = np .nan
202
202
ed ["Platform" ]["pitch" ].values [0 ] = np .nan
@@ -337,7 +337,7 @@ def test_add_depth_errors():
337
337
with pytest .raises (NotImplementedError , match = (
338
338
"`use_platform/beam_...` not implemented yet for `AZFP`."
339
339
)):
340
- ed ["Sonar" ]. attrs [ "sonar_model" ] = "AZFP"
340
+ ed ["Sonar" ] = ed [ "Sonar" ]. assign_attrs ( sonar_model = "AZFP" )
341
341
ep .consolidate .add_depth (ds_Sv , ed , use_platform_angles = True )
342
342
343
343
@@ -375,9 +375,9 @@ def test_add_depth_EK_with_platform_vertical_offsets(file, sonar_model, compute_
375
375
ds_Sv = ds_Sv .isel (range_sample = slice (0 ,5 ))
376
376
377
377
# Replace any Platform Vertical Offset NaN values with 0
378
- ed ["Platform" ]["water_level" ] = ed ["Platform" ]["water_level" ].fillna (0 )
379
- ed ["Platform" ]["vertical_offset" ] = ed ["Platform" ]["vertical_offset" ].fillna (0 )
380
- ed ["Platform" ]["transducer_offset_z" ] = ed ["Platform" ]["transducer_offset_z" ].fillna (0 )
378
+ ed ["Platform" ]["water_level" ]. values = ed ["Platform" ]["water_level" ].fillna (0 ). values
379
+ ed ["Platform" ]["vertical_offset" ]. values = ed ["Platform" ]["vertical_offset" ].fillna (0 ). values
380
+ ed ["Platform" ]["transducer_offset_z" ]. values = ed ["Platform" ]["transducer_offset_z" ].fillna (0 ). values
381
381
382
382
# Compute `depth` using platform vertical offset values
383
383
ds_Sv_with_depth = ep .consolidate .add_depth (ds_Sv , ed , use_platform_vertical_offsets = True )
@@ -431,8 +431,8 @@ def test_add_depth_EK_with_platform_angles(file, sonar_model, compute_Sv_kwargs)
431
431
ds_Sv = ep .calibrate .compute_Sv (ed , ** compute_Sv_kwargs )
432
432
433
433
# Replace any Beam Angle NaN values with 0
434
- ed ["Platform" ]["pitch" ] = ed ["Platform" ]["pitch" ].fillna (0 )
435
- ed ["Platform" ]["roll" ] = ed ["Platform" ]["roll" ].fillna (0 )
434
+ ed ["Platform" ]["pitch" ]. values = ed ["Platform" ]["pitch" ].fillna (0 ). values
435
+ ed ["Platform" ]["roll" ]. values = ed ["Platform" ]["roll" ].fillna (0 ). values
436
436
437
437
# Compute `depth` using platform angle values
438
438
ds_Sv_with_depth = ep .consolidate .add_depth (ds_Sv , ed , use_platform_angles = True )
@@ -485,9 +485,9 @@ def test_add_depth_EK_with_beam_angles(file, sonar_model, compute_Sv_kwargs):
485
485
ds_Sv = ep .calibrate .compute_Sv (ed , ** compute_Sv_kwargs )
486
486
487
487
# Replace Beam Angle NaN values
488
- ed ["Sonar/Beam_group1" ]["beam_direction_x" ] = ed ["Sonar/Beam_group1" ]["beam_direction_x" ].fillna (0 )
489
- ed ["Sonar/Beam_group1" ]["beam_direction_y" ] = ed ["Sonar/Beam_group1" ]["beam_direction_y" ].fillna (0 )
490
- ed ["Sonar/Beam_group1" ]["beam_direction_z" ] = ed ["Sonar/Beam_group1" ]["beam_direction_z" ].fillna (1 )
488
+ ed ["Sonar/Beam_group1" ]["beam_direction_x" ]. values = ed ["Sonar/Beam_group1" ]["beam_direction_x" ].fillna (0 ). values
489
+ ed ["Sonar/Beam_group1" ]["beam_direction_y" ]. values = ed ["Sonar/Beam_group1" ]["beam_direction_y" ].fillna (0 ). values
490
+ ed ["Sonar/Beam_group1" ]["beam_direction_z" ]. values = ed ["Sonar/Beam_group1" ]["beam_direction_z" ].fillna (1 ). values
491
491
492
492
# Compute `depth` using beam angle values
493
493
ds_Sv_with_depth = ep .consolidate .add_depth (ds_Sv , ed , use_beam_angles = True )
0 commit comments