rayoptics.raytr.sampler module

Various generators and utilities for producing 2d distributions

grid_ray_generator(grid_rng)[source]

Generator function to produce a 2d square regular grid.

Parameters:
  • grid_rng – start, stop, num

  • start – 2d numpy array of lower left grid coords

  • stop – 2d numpy array of upper right grid coords

  • num – the number of samples along each axis

A sample input might be:

grid_start = np.array([-1., -1.]) grid_stop = np.array([1., 1.]) grid_rng = grid_start, grid_stop, num_rays

csd_grid_ray_generator(grid_rng)[source]
polar_grid_ray_generator(grid_rng)[source]
phi(d)[source]
R_2_quasi_random_generator(n)[source]

A 2d sequence based on a R**2 quasi-random sequence

See The Unreasonable Effectiveness of Quasirandom Sequences <http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/ >

concentric_sample_disk(u, offset=True)[source]

Map a 2d unit square sample to the unit disk.

create_generator(sampler, *sampler_args, mapper=None, **kwargs)[source]