def directionalK(kx,ky, indices):
'''Function that provides the K values at a given direction dictated by the indices'''
kx_grid,ky_grid = torch.meshgrid(kx,kx, indexing='ij')
k_grid = torch.sqrt(kx_grid**2 + ky_grid**2)
k_grid[...,:len(k_grid)//2] *=-1
y,x = indices
diag = x - len(k_grid)//2