plenoptic.data.polar_angle#

plenoptic.data.polar_angle(size, phase=0.0, origin=None, direction='clockwise', device=None)[source]#

Make polar angle matrix (in radians).

Compute a matrix of given size containing samples of the polar angle (in radians, increasing in user-defined direction from the X-axis, ranging from -pi to pi), relative to given phase, about the given origin pixel.

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.

  • phase (float (default: 0.0)) – The phase of the polar angle function (in radians, clockwise from the X-axis).

  • origin (int | tuple[float, float] | 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.

  • direction (Literal['clockwise', 'counter-clockwise'] (default: 'clockwise')) – Whether the angle increases in a clockwise or counter-clockwise direction from the x-axis. The standard mathematical convention is to increase counter-clockwise, so that 90 degrees corresponds to the positive y-axis.

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

Return type:

Tensor

Returns:

res – The polar angle matrix.

Raises:

ValueError – If direction takes an illegal value.