diff --git a/KISSY/scripts/graph_belts.py b/KISSY/scripts/graph_belts.py index 924db73..fe67a22 100755 --- a/KISSY/scripts/graph_belts.py +++ b/KISSY/scripts/graph_belts.py @@ -192,8 +192,13 @@ def interpolate_2d(target_x, target_y, source_x, source_y, source_data): # and ensure we don't exceed array bounds x_indices = np.searchsorted(source_x, x) - 1 y_indices = np.searchsorted(source_y, y) - 1 - x_indices = max(0, min(len(source_x) - 2, x_indices)) - y_indices = max(0, min(len(source_y) - 2, y_indices)) + x_indices = max(0, min(len(source_x) - 1, x_indices)) + y_indices = max(0, min(len(source_y) - 1, y_indices)) + + if x_indices == len(source_x) - 2: + x_indices -= 1 + if y_indices == len(source_y) - 2: + y_indices -= 1 x1, x2 = source_x[x_indices], source_x[x_indices + 1] y1, y2 = source_y[y_indices], source_y[y_indices + 1] diff --git a/README.md b/README.md index f8fdc6c..dc86ae9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If needed, refer to [my IS graphs documentation](./docs/input_shaper.md) for tip | Belts graphs | X graphs | Y graphs | Vibrations measurement | |:----------------:|:------------:|:------------:|:---------------------:| -| ![](./docs/images/resonances_belts_example.png) | ![](./docs/images/resonances_x_example.png) | ![](./docs/images/resonances_y_example.png) | ![](./docs/images/vibrations_example.png) | +| ![](./docs/images/belts_example.png) | ![](./docs/images/X_example.png) | ![](./docs/images/Y_example.png) | ![](./docs/images/vibrations_example.png) | ## Installation diff --git a/docs/images/X_example.png b/docs/images/X_example.png new file mode 100644 index 0000000..55db2c8 Binary files /dev/null and b/docs/images/X_example.png differ diff --git a/docs/images/Y_example.png b/docs/images/Y_example.png new file mode 100644 index 0000000..0b0b874 Binary files /dev/null and b/docs/images/Y_example.png differ diff --git a/docs/images/belts_example.png b/docs/images/belts_example.png new file mode 100644 index 0000000..7aaf5f1 Binary files /dev/null and b/docs/images/belts_example.png differ diff --git a/docs/images/resonances_belts_example.png b/docs/images/resonances_belts_example.png deleted file mode 100644 index 38de9f2..0000000 Binary files a/docs/images/resonances_belts_example.png and /dev/null differ diff --git a/docs/images/resonances_x_example.png b/docs/images/resonances_x_example.png deleted file mode 100644 index 6d6c538..0000000 Binary files a/docs/images/resonances_x_example.png and /dev/null differ diff --git a/docs/images/resonances_y_example.png b/docs/images/resonances_y_example.png deleted file mode 100644 index 86fe46f..0000000 Binary files a/docs/images/resonances_y_example.png and /dev/null differ