PixelLattice

class nyx.instrument.interpolation.PixelLattice[source]

Bases: Module

The sampling lattice every pixel’s response grid is a window onto.

Parameters:
  • origin (array-like, shape (2,)) – Position of lattice node (0, 0) as [lon, lat], in radians.

  • step (array-like, shape (2,)) – Node spacing along [lon, lat], in radians.

  • offset (array-like, shape (n_pixels, 2)) – Node index of each pixel’s response window corner, [lon, lat].

  • grid_shape (tuple of int) – Response table shape (height, width) of a single pixel, with height running along longitude and width along latitude.

Attributes Summary

grid

Per-pixel response sample coordinates, shape (n_pixels, 2, grid_dim).

grid_shape

n_pixels

Number of pixels indexed.

offset

origin

shape

step

window_centers

Centre of each pixel's response window, shape (n_pixels, 2), in radians.

Methods Summary

from_grid(grid, values[, tol])

Recover the lattice underlying explicit sample coordinates.

Attributes Documentation

grid

Per-pixel response sample coordinates, shape (n_pixels, 2, grid_dim).

The explicit form from_grid() consumes.

grid_shape = <dataclasses._MISSING_TYPE object>
n_pixels

Number of pixels indexed.

offset = <dataclasses._MISSING_TYPE object>
origin = <dataclasses._MISSING_TYPE object>
shape = <dataclasses._MISSING_TYPE object>
step = <dataclasses._MISSING_TYPE object>
window_centers

Centre of each pixel’s response window, shape (n_pixels, 2), in radians.

Methods Documentation

classmethod from_grid(grid, values, tol=0.001)[source]

Recover the lattice underlying explicit sample coordinates.

Parameters:
  • grid (array-like, shape (n_pixels, 2, grid_dim)) – Radians.

  • values (array-like, shape (..., n_pixels, height, width)) – Every leading axis is checked.

  • tol (float) – Tolerance, in units of one step.

Return type:

PixelLattice

Raises:

ValueError – Unless the responses vanish on their boundary rows and columns and the sample coordinates sit on the nodes of a common lattice.

__init__(origin, step, offset, grid_shape)[source]
static __new__(cls, *args, **kwargs)