From d86c93b11495bc8c37a826b0a125d5b539bdcc0e Mon Sep 17 00:00:00 2001 From: zssherman Date: Wed, 13 Dec 2023 09:22:28 -0600 Subject: [PATCH] MNT: Update int calls to remove warnings. --- tint/grid_utils.py | 2 +- tint/matching.py | 8 ++++---- tint/phase_correlation.py | 8 ++++---- tint/visualization.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tint/grid_utils.py b/tint/grid_utils.py index 9f6a919..172fa6a 100644 --- a/tint/grid_utils.py +++ b/tint/grid_utils.py @@ -45,7 +45,7 @@ def get_radar_info(grid_obj): def get_grid_alt(grid_size, alt_meters=1500): """ Returns z-index closest to alt_meters. """ - return np.int(np.round(alt_meters/grid_size[0])) + return np.int64(np.round(alt_meters/grid_size[0])) def get_vert_projection(grid, thresh=40): diff --git a/tint/matching.py b/tint/matching.py index 3ec9a6f..72418ca 100644 --- a/tint/matching.py +++ b/tint/matching.py @@ -127,10 +127,10 @@ def predict_search_extent(obj1_extent, shift, params, grid_size): x2 = shifted_center[0] + search_radius_r + 1 y1 = shifted_center[1] - search_radius_c y2 = shifted_center[1] + search_radius_c + 1 - x1 = np.int(x1) - x2 = np.int(x2) - y1 = np.int(y1) - y2 = np.int(y2) + x1 = np.int64(x1) + x2 = np.int64(x2) + y1 = np.int64(y1) + y2 = np.int64(y2) return {'x1': x1, 'x2': x2, 'y1': y1, 'y2': y2, 'center_pred': shifted_center, 'valid': True} diff --git a/tint/phase_correlation.py b/tint/phase_correlation.py index c6f7352..a9cee9f 100644 --- a/tint/phase_correlation.py +++ b/tint/phase_correlation.py @@ -19,10 +19,10 @@ def get_ambient_flow(obj_extent, img1, img2, params, grid_size): row_ub = obj_extent['obj_center'][0] + obj_extent['obj_radius'] + margin_r col_lb = obj_extent['obj_center'][1] - obj_extent['obj_radius'] - margin_c col_ub = obj_extent['obj_center'][1] + obj_extent['obj_radius'] + margin_c - row_lb = np.int(row_lb) - row_ub = np.int(row_ub) - col_lb = np.int(col_lb) - col_ub = np.int(col_ub) + row_lb = np.int64(row_lb) + row_ub = np.int64(row_ub) + col_lb = np.int64(col_lb) + col_ub = np.int64(col_ub) dims = img1.shape diff --git a/tint/visualization.py b/tint/visualization.py index 31c3d68..d0417ec 100644 --- a/tint/visualization.py +++ b/tint/visualization.py @@ -155,8 +155,8 @@ def lagrangian_view(tobj, grids, tmp_dir, uid=None, vmin=-8, vmax=64, display = pyart.graph.GridMapDisplay(grid) # Box Size - tx = np.int(np.round(row['grid_x'])) - ty = np.int(np.round(row['grid_y'])) + tx = np.int64(np.round(row['grid_x'])) + ty = np.int64(np.round(row['grid_y'])) tx_met = grid.x['data'][tx] ty_met = grid.y['data'][ty] lat = row['lat']