[docs]classFitPositionsImagePair(AbstractFitPositionsImagePair):""" A lens position fitter, which takes a set of positions (e.g. from a plane in the tracer) and computes \ their maximum separation, such that points which tracer closer to one another have a higher log_likelihood. Parameters ---------- data : Grid2DIrregular The (y,x) arc-second coordinates of positions which the maximum distance and log_likelihood is computed using. noise_value The noise-value assumed when computing the log likelihood. """@propertydefresidual_map(self)->aa.ArrayIrregular:residual_map=[]cost_matrix=np.linalg.norm(np.array(self.data,)[:,np.newaxis]-np.array(self.model_data,),axis=2,)data_indexes,model_indexes=linear_sum_assignment(cost_matrix)fordata_index,model_indexinzip(data_indexes,model_indexes):distance=np.sqrt(self.square_distance(self.data[data_index],self.model_data[model_index]))residual_map.append(distance)returnaa.ArrayIrregular(values=residual_map)