plenoptic.data.polar_radius#

plenoptic.data.polar_radius(size, exponent=1.0, origin=None, device=None)[source]#

Make distance-from-origin (r) matrix.

Compute a matrix of given size containing samples of a radial ramp function, raised to given exponent, centered at given origin.

Parameters:
  • size (int | tuple[int, int]) – If an int, we assume the image should be of dimensions (size, size). if a tuple, must be a 2-tuple of ints specifying the dimensions.

  • exponent (float (default: 1.0)) – The exponent of the radial ramp function.

  • origin (int | tuple[int, int] | None (default: None)) – The center of the image. if an int, we assume the origin is at (origin, origin). if a tuple, must be a 2-tuple of ints specifying the origin (where (0, 0) is the upper left). if None, we assume the origin lies at the center of the matrix, (size+1)/2.

  • device (str | device | None (default: None)) – The device to create this tensor on.

Return type:

Tensor

Returns:

radius – The polar radius matrix.