Whether aiapy.psf uses the GPU/cupy or not is opaque
Currently, in aiapy.psf.psf
and aiapy.psf.deconvolve
, cupy is used if it is installed and if use_gpu
is set to True
. This is a bit opaque to users and is somewhat dangerous as it potentially means a result is dependent on someone's environment and this may be very non-obvious.
Perhaps a better solution should be to use cupy only if the input map data is a cupy array. This would make it much more clear to users they are using cupy. This is slightly more tricky for the PSF calculation as there is no input array, but maybe the current interface would suffice for that function.
This may also require an upstream fix in sunpy that allows map data to be a cupy array.