comnum.OwcRoom#

class comnum.OwcRoom(size_m, reflectance)#

An empty rectangular room [0, L] × [0, W] × [0, H] with Lambertian walls (Barry et al. 1993): north and south are the walls x = L and x = 0, west and east y = W and y = 0.

Parameters:
  • size_m (array_like) – (L, W, H) (m).

  • reflectance (float | dict) – one reflectivity for every surface, or a dict of north, south, east, west, ceiling, floor (missing ones: 0).

Raises:

ValueError – for an invalid parameter or input (the message names it).

Examples

>>> import comnum, numpy as np
>>> room = comnum.OwcRoom([5.0, 5.0, 3.0], 0.8)
>>> lit = room.illuminate([2.5, 2.5, 3.0], [0, 0, -1], 1.0, 1.0,
...                       bin_s=0.2e-9, partitions=[[25, 25, 15]])
>>> h = lit.impulse_responses([0.5, 1.0, 0.0], [0, 0, 1], 1e-4, np.radians(85))
>>> round(h[0].total_w() * 1e6, 2)  # the line of sight (Barry et al., Fig. 3)
1.23
illuminate(positions, directions, mode, power_w, *, bin_s, partitions)#

Carry the light of emitters to the reflecting elements, once for any number of detectors.

Parameters:
  • positions (array_like) – (3,) or (n, 3) positions (m).

  • directions (array_like) – (3,) or (n, 3) axes (see owc_direction).

  • mode (float | array_like) – the Lambertian mode (see lambertian_mode).

  • power_w (float | array_like) – the optical power (W).

  • bin_s (float) – the width of the time bins (s).

  • partitions (list[tuple[int, int, int]]) – the elements (N_x, N_y, N_z) per dimension, one partition per order of reflection.

Returns:

the light on the elements.

Return type:

OwcIllumination

Raises:

ValueError – for an invalid parameter or input (the message names it).