nifty8.re.refine.healpix_field module#

class RefinementHPField(chart: nifty8.re.refine.chart.HEALPixChart, kernel: Callable | None = None, dtype=None, skip0: bool = False)[source]#

Bases: LazyModel

__call__(xi, kernel=None, *, skip0=None, **kwargs)[source]#

See RefinementField.apply.

__init__(chart: HEALPixChart, kernel: Callable | None = None, dtype=None, skip0: bool = False)[source]#

Initialize an Iterative Charted Refinement (ICR) field for a HEALPix map with a radial extent.

Parameters:
  • chart – HEALPix coordinate chart with which to iteratively refine.

  • kernel – Covariance kernel of the refinement field.

  • dtype – Data-type of the excitations which to add during refining.

  • skip0 – Whether to skip the first refinement level. This is useful to e.g.

static apply(xi, chart: HEALPixChart, kernel: Callable | RefinementMatrices, *, skip0: bool = False, coerce_fine_kernel: bool = False, _refine: Callable | None = None, precision=None)[source]#

Static method to apply a refinement field given some excitations, a chart and a kernel.

Parameters:
  • xi – Latent parameters which to use for refining.

  • chart – Chart with which to refine the non-HEALPix axis.

  • kernel – Covariance kernel with which to build the refinement matrices.

  • skip0 – Whether to skip the first refinement level.

  • coerce_fine_kernel – Whether to coerce the refinement matrices at scales at which the kernel matrix becomes singular or numerically highly unstable.

  • precision – See JAX’s precision.

property chart#

Associated HEALPixChart with which to iteratively refine.

property domain#

Yields the ShapeWithDtype of the primals.

property dtype#

Yields the data-type of the excitations.

property kernel#

Yields the kernel specified during initialization or throw a TypeError.

matrices(kernel: Callable | None = None, depth: int | None = None, skip0: bool | None = None, *, coerce_fine_kernel: bool = False, atol: float | None = None, rtol: float | None = None, which: str | None = 'dist', mat_buffer_size: int | None = None, _verbosity: int = 0) RefinementMatrices[source]#

Computes the refinement matrices namely the optimal linear filter and the square root of the information propagator (a.k.a. the square root of the fine covariance matrix for the excitations) for all refinement levels and all pixel indices in the coordinate chart.

Parameters:
  • kernel – Covariance kernel of the refinement field if not specified during initialization.

  • depth – Maximum refinement depth if different to the one of the HEALPixChart.

  • skip0 – Whether to skip the first refinement level.

  • coerce_fine_kernel – Whether to coerce the refinement matrices at scales at which the kernel matrix becomes singular or numerically highly unstable.

  • atol – Absolute tolerance of the element-wise difference between distance matrices up to which refinement matrices are merged.

  • rtol – Relative tolerance of the element-wise difference between distance matrices up to which refinement matrices are merged.

  • which ('cov' or 'dist') – Type of the matrix for which the unique instances shall be found. If the covariance matrices (cov) are “uniquified”, then the procedure depends on the kernel used. If the distance matrices (dist) are “uniquified”, then the search for redundancies becomes independent of the kernel. For a fixed charting, the latter can always be done ahead of time while it might be easier to set sensible atol and rtol parameters for the latter.

Note

Finding duplicates in the distance matrices is computationally expensive if there are only few of them. However, if the chart is kept fixed, then this one time investment might still be worth it though.

property skip0#

Whether to skip the zeroth refinement