Render

diffinytrace.render.smoothed_irradiance(optical_system: SequentialOpticalSystem, sequence: List, source: LightSource, detector: Detector, smoother, num_rays: int, device=device(type='cpu'), method_ray_tracing: str = 'sobol_pow2') Tensor[source]

Calculate the smoothed irradiance on the detector using ray tracing.

Parameters:
  • optical_system (SequentialOpticalSystem) – The optical system to trace rays through.

  • sequence – The sequence of elements in the optical system.

  • source (LightSource) – The light source used for ray tracing.

  • detector (Detector) – The detector where the rays are traced to.

  • smoother – The smoother object used for smoothing the irradiance.

  • num_rays (int, optional) – The number of rays to trace. Default is 100000.

  • device (torch.device, optional) – The device to perform computations on. Default is the default device.

  • method_ray_tracing (str, optional) – The method used for ray tracing. Default is “sobol”.

Returns:

The smoothed irradiance on the detector.

Return type:

torch.Tensor

diffinytrace.render.binned_irradiance(optical_system: SequentialOpticalSystem, sequence: List, source: LightSource, detector: Detector, grid, num_rays: int, device=device(type='cpu'), method_ray_tracing: str = 'sobol_pow2') Tensor[source]

Calculate the binned irradiance on the detector using ray tracing.

Parameters:
  • optical_system (SequentialOpticalSystem) – The optical system to trace rays through.

  • sequence – The sequence of elements in the optical system.

  • source (LightSource) – The light source used for ray tracing.

  • detector (Detector) – The detector where the rays are traced to.

  • grid – The grid used for binning the irradiance.

  • num_rays (int, optional) – The number of rays to trace. Default is 100000.

  • device (torch.device, optional) – The device to perform computations on. Default is the default device.

  • method_ray_tracing (str, optional) – The method used for ray tracing. Default is “sobol”.

Returns:

The binned irradiance on the detector.

Return type:

torch.Tensor