Skip to content

Commit

Permalink
- replace akkimainterpolator with linearinterpolator to avoid unexpec…
Browse files Browse the repository at this point in the history
…ted interpolation

- fix wrong has_rangess variable name
  • Loading branch information
peter-urban committed Dec 20, 2024
1 parent 139f94f commit 522eea3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def add_ping_param(self, name, x_reference, y_reference, vec_x_val, vec_y_val):
vec_y_val = averaged_y_vals

# convert to to represent indices
vec_y_val = theping.tools.vectorinterpolators.AkimaInterpolator(
vec_y_val = theping.tools.vectorinterpolators.LinearInterpolator(
vec_x_val, vec_y_val, extrapolation_mode="nearest"
)(comp_vec_x_val)

Expand Down Expand Up @@ -192,7 +192,7 @@ def get_ping_param(self, name, use_x_coordinates=False):

case "Range (m)":
assert (
self.has_rangess
self.has_ranges
), "ERROR: Ranges values not initialized for ech data, call set_range_extent method"

for nr, (indice, p) in enumerate(zip(x_indices, param)):
Expand Down Expand Up @@ -481,10 +481,10 @@ def get_filtered_by_y_extent(self, vec_x_val, vec_min_y, vec_max_y):
vec_x_val = vec_x_val[arg]

# convert to to represent indices
vec_min_y = theping.tools.vectorinterpolators.AkimaInterpolator(
vec_min_y = theping.tools.vectorinterpolators.LinearInterpolator(
vec_x_val, vec_min_y, extrapolation_mode="nearest"
)(self.vec_x_val)
vec_max_y = theping.tools.vectorinterpolators.AkimaInterpolator(
vec_max_y = theping.tools.vectorinterpolators.LinearInterpolator(
vec_x_val, vec_max_y, extrapolation_mode="nearest"
)(self.vec_x_val)

Expand Down Expand Up @@ -1008,7 +1008,7 @@ def get_extent_layers(self, nr, axis_name=None):

case "Range (m)":
assert (
self.has_rangess
self.has_ranges
), "ERROR: Ranges values not initialized for ech data, call set_range_extent method"

extents[key] = self.y_indice_to_range_interpolator[nr]([layer.i0[nr] - 0.5, layer.i1[nr] - 0.5])
Expand Down Expand Up @@ -1044,7 +1044,7 @@ def get_limits_layers(self, nr, axis_name=None):

case "Range (m)":
assert (
self.has_rangess
self.has_ranges
), "ERROR: Ranges values not initialized for ech data, call set_range_extent method"

extents[key] = self.y_indice_to_range_interpolator[nr]([layer.i0[nr], layer.i1[nr] - 1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def __init__(self, echodata, vec_x_val, vec_min_y, vec_max_y):
vec_x_val = vec_x_val[arg]

# convert to to represent indices
vec_min_y = theping.tools.vectorinterpolators.AkimaInterpolator(vec_x_val, vec_min_y, extrapolation_mode = 'nearest')(echodata.vec_x_val)
vec_max_y = theping.tools.vectorinterpolators.AkimaInterpolator(vec_x_val, vec_max_y, extrapolation_mode = 'nearest')(echodata.vec_x_val)
#vec_min_y = theping.tools.vectorinterpolators.AkimaInterpolator(vec_x_val, vec_min_y, extrapolation_mode = 'nearest')(echodata.vec_x_val)
#vec_max_y = theping.tools.vectorinterpolators.AkimaInterpolator(vec_x_val, vec_max_y, extrapolation_mode = 'nearest')(echodata.vec_x_val)
vec_min_y = theping.tools.vectorinterpolators.LinearInterpolator(vec_x_val, vec_min_y, extrapolation_mode = 'nearest')(echodata.vec_x_val)
vec_max_y = theping.tools.vectorinterpolators.LinearInterpolator(vec_x_val, vec_max_y, extrapolation_mode = 'nearest')(echodata.vec_x_val)

self.echodata = echodata
# create layer indices representing the range (i1 = last element +1_
Expand Down

0 comments on commit 522eea3

Please sign in to comment.