healpix_analyse.pyramid_conv#
Pyramidal convolution on HEALPix maps: block-diagonal kernel pyramid +
HealPixDecomp, with correct NaN/weight
propagation.
See healpix_analyse.kernel_pyramid for the precise sense in which a
per-band kernel is an approximation (block-diagonal in B_K), and for
the mandatory validation step against healpix_analyse.validation.
Classes#
Module Contents#
- class healpix_analyse.pyramid_conv.HealPixPyramidConv(decomp: healpix_analyse.decomp.HealPixDecomp, kernel_pyramid: healpix_analyse.kernel_pyramid.HealPixKernelPyramid, *, mode: str = 'normalized')[source]#
Bases:
torch.nn.ModuleApply a
HealPixKernelPyramidthrough a matchedHealPixDecomp.- Parameters:
decomp (
HealPixDecomp) – Must be the same decomposition the kernel pyramid was built from (same levels, cell-id domains).kernel_pyramid (
HealPixKernelPyramid)mode (
{"normalized", "signed"}, default"normalized") –"normalized"(default): NaN/weight-aware. Internally runscompute_weighted()on the input, applies the kernel pyramid identically to the data channelqand the weight channelm, synthesizes both, and divides once –y = S(B_K q) / S(B_K m)– never band by band. This is a strict superset of plain filtering: on fully finite data with noweightsgiven,mis uniformly 1 and the division is a no-op up to floating-point round-off, so this mode is safe to use as the default even without missing data."signed": no masking at all – runs the kernel pyramid directly oncompute()/invert(). Only meaningful on fully finite input; useful for validating kernels that are not required to stay positive (signed kernels), where dividing by a synthesized weight would be the wrong operation.
- decomp#
- kernel_pyramid#
- mode = 'normalized'#
- apply_pyramid(pyramid: healpix_analyse.decomp.HealPixPyramid | healpix_analyse.decomp.HealPixWeightedPyramid) healpix_analyse.decomp.HealPixPyramid | healpix_analyse.decomp.HealPixWeightedPyramid[source]#
Apply the per-band kernels to an already-computed pyramid.
Does not synthesize or divide – use
forward()(orinvert()) for that. Accepts either a plainHealPixPyramidor aHealPixWeightedPyramid(in which case the same per-band kernels are applied to both theqandmchannels, as required for a valid normalized-convolution result).
- forward(x: ArrayLike, weights: ArrayLike | None = None, *, return_support: bool = False, restore_mask: bool = True, eps: float = 1e-08)[source]#
Convolve
xthrough the pyramid.In
"normalized"mode (default), returns the masked/weighted resulty = S(B_K q) / S(B_K m); whenreturn_support=True, also returns the synthesized support mapS(B_K m)(the post-convolution confidence/coverage, useful for diagnosing where the result is under-supported without being a per-band clip).In
"signed"mode,weights/return_supportare not accepted (raisesValueError) – there is no weight channel to report support from.