diffrp.utils.coordinates#
- diffrp.utils.coordinates.angles_to_unit_direction(theta: Tensor, phi: Tensor)#
Convert angle tensors (theta, phi) into unit direction vectors (x, y, z).
The method is broadcastable.
Inputs angles are in radians, unlike
from_orbit.
- diffrp.utils.coordinates.latlong_grid(H, W, dtype, device)#
- diffrp.utils.coordinates.near_plane_ndc_grid(H: int, W: int, dtype: dtype, device: device)#
- diffrp.utils.coordinates.unit_direction_to_angles(L: Tensor)#
Convert a unit direction vector (…batch_dims, 3) into two angle tensors (theta, phi). Theta and phi refer to the azimuth and elevation, respectively.
Theta and phi will have one fewer dimension, shape (…batch_dims). These angles are in radians, unlike
from_orbit.
- diffrp.utils.coordinates.unit_direction_to_latlong_uv(L: Tensor)#