grid2sphere#
- diffsims.utils.kinematic_simulation_utils.grid2sphere(arr, x, dx, C)[source]#
Projects 3d array onto a sphere.
- Parameters:
- arr
np.ndarray[float], (nx,ny,nz) Input function to be projected
- x
list[np.ndarray[float]],ofshapes[(nx,), (ny,), (nz,)] Vectors defining mesh of <arr>
- dx
list[np.ndarray[float]],ofshapes[(3,), (3,), (3,)] Basis in which to orient sphere. Centre of sphere will be at C*dx[2] and mesh of output array will be defined by the first two vectors.
- C
float Radius of sphere.
- arr
- Returns:
- out
np.ndarray[float], (nx,ny) If y is the point on the line between i*dx[0]+j*dx[1] and C*dx[2] which also lies on the sphere of radius C from C*dx[2] then: out[i,j] = arr(y). Interpolation on arr is linear.
- out