accept_array_or_map#
- sunkit_image.utils.accept_array_or_map(*, arg_name: str, output_to_map=True) Callable[[Callable], Callable] [source]#
Decorator that allows a function to accept an array or a
sunpy.map.GenericMap
as an argument.This can be applied to functions that:
Take a single array or map as input
Return a single array that has the same pixel coordinates as the input array.
- Parameters:
arg_name (
str
) – Name of data/map argument in function signature.output_to_map (
bool
, optional) – IfTrue
(the default), convert the function return to a map if a map is given as input. For this to work the decorated function must return an array where pixels have the same coordinates as the input map data.