HealSparse has support for basic arithmetic operations between maps, including sum, product, min/max, and and/or/xor bitwise operations for integer maps. In addition, there is general support for any numpy
universal function. It is important to note that map operations are complicated by the fact that any given maps may not have the same pixel coverage. Therefore, map operations can be done either with "union" (where the final map has a valid pixel list that is the union of the input maps) or "intersection" (where the final map has a valid pixel list that is the intersection of the input maps). In the case of "union" operations, the maps that do not have coverage at a given point will be filled with an appropriate value (for example, 0 for summation and 1 for products).
Arithmetic operations with a constant are very simple, and are handled with the default Python operations, supporting copy or in-place operations.
Operations between maps can be done with either "union" or "intersection" mode. The basic operations supported are sum
, product
, min
, max
, or
, and
, xor
, and ufunc
. Note that or
, and
:, and xor
operations are only supported for integer maps. Note that operations between maps are only supported if they have the same nside_sparse
resolution and data type. In all cases, the function name is operation_union()
or operation_intersection()
. For example,