cherab.phix.observer.thin_lens_ccd.ThinLensCCDArray._generate_rays#
- ThinLensCCDArray._generate_rays(ix, iy, template, ray_samples)#
Generate a list of Rays that sample over the sensitivity of the pixel. This method must return a list of tuples, with each tuple containing a Ray object and a corresponding weighting, typically the projected area/direction cosine. In this class, the weight will be:
\[wight := \frac{R^2\cos^4\theta}{2d^2},\]where \(R\) is the lens radius, \(\theta\) is the angle between a ray vector and the normal vector to image sensor, and \(d\) is the distance between the image sensor and the lens. \(R\) and \(d\) are calculated as folows:
\[ \begin{align}\begin{aligned}R &= \frac{f}{F}\\d &= \left(\frac{1}{f} - \frac{1}{W}\right)^{-1}.\end{aligned}\end{align} \]Where \(f\) is the focal length, \(F\) is the f-number, and \(W\) is the working distance.
- Parameters:
ix (int) – Pixel x index.
iy (int) – Pixel y index.
template (
Ray) – The template ray from which all rays should be generated.ray_samples (int) – The number of rays to be generated. This is not used in this class. The number of rays is determined by
per_pixel_samples
- Returns:
A list of tuples of (ray, weight)
- Return type:
list[tuple[
Ray, float]]