Skip to content
Snippets Groups Projects
Commit e3024b2f authored by xiyehu2's avatar xiyehu2
Browse files

added skipping case consideration in get_rearrange_paths

parent d36659dc
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ from typing import Dict, Tuple, Any, List
import numpy as np
from scipy.interpolate import interp1d
from AWG import *
import cupy as cp
# import cupy as cp
import scipy.optimize as spopt
......@@ -319,6 +319,8 @@ def get_rearrange_paths(
:param t_idx: indices of tweezer positions in target pattern.
:returns: 2d numpy array containing moving path trajectories
"""
if len(f_idx) < len(t_idx):
return np.array([])
cm = abs(np.subtract.outer(f_idx, t_idx))
row, col = spopt.linear_sum_assignment(cm)
return np.stack([f_idx[row], t_idx]).T
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment