matvis.gpu.gpu_beam_interpolation¶
- matvis.gpu.gpu_beam_interpolation(beam: np.ndarray | gpuarray.GPUArray, daz: float, dza: float, az: np.ndarray, za: np.ndarray, gpu_func: Callable | None = None, nthreads: int = 1024, stream=None, return_on_cpu: bool = True)[source]¶
Interpolate beam values from a regular az/za grid using GPU.
- Parameters:
beam – The beam values. The shape of this array should be
(nbeam, nax, nfeed, nza, naz)
. This is the axis ordering returned by UVBeam.interp. This array can either be real or complex. Either way, the output is complex.daz – The grid sizes in azimuth and zenith-angle respectively.
dza – The grid sizes in azimuth and zenith-angle respectively.
az – The azimuth and zenith-angle values of the sources to which to interpolate. These should be 1D arrays. They are not treated as a “grid”.
za – The azimuth and zenith-angle values of the sources to which to interpolate. These should be 1D arrays. They are not treated as a “grid”.
gpu_func – The callable, compiled GPU function to use. This is generated dynamically if not given, but can be given to avoid recompilation.
nthreads – The number of threads to use.
stream – An option GPU stream to write to.
return_on_cpu – Whether to return the result as CPU memory, or a GPUArray.
- Returns:
The beam interpolated at the sources. The shape of the array is
(nbeam, nax, nfeed, nsrc)
. The array is always complex (at single or double precision, depending on the input).- Return type:
beam_at_src