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 wallsx = Landx = 0, west and easty = Wandy = 0.- Parameters:
- 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 (seeowc_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:
- Raises:
ValueError – for an invalid parameter or input (the message names it).