Sphere

class iadpython.sphere.Sphere(d_sphere, d_sample, d_third=0, r_third=0, d_detector=0, r_detector=0, r_std=0.99, r_wall=0.99, refl=True)[source]

Bases: object

Container class for a three-port integrating sphere.

For a reflection measurement, the third port is the diameter of through which the light enters to hit the sample. For a transmission measurement this is the port that might allow unscattered transmission to leave. In either case, the reflectance from this port is assumed to be zero.

By default, the sample port is on top (z=-R), the third port is on the bottom (z=R) and the detector is on the side (x=R)

- d

diameter of integrating sphere [mm]

- r_wall

reflectivity of the wall

- a_wall

fraction of the sphere that is walls (relative

- r_std

reflectivity of the standard used with the sphere

- sample

port object representing sample port

- third

port object for empty port in reflection sphere or the standard port in transmission sphere

- detector

port object representing detector port

- x

x-coordinate of photon on wall

- y

y-coordinate of photon on wall

- z

z-coordinate of photon on wall

Example:

>>> import iadpython as iad
>>> s = iad.Sphere(200, 20)
>>> print(s)

Attributes Summary

a_wall

Getter property for detector port diameter.

d

Getter property for sphere diameter.

r_std

Getter property for reflectance standard.

r_wall

Getter property for wall reflectivity.

Methods Summary

MR(sample_ur1[, sample_uru, R_u, f_u, f_w])

Determine the value of MR due to multiple bounces in the sphere.

MT(sample_ut1, sample_uru[, T_u, f_u])

Determine the measured transmission (MT) due to multiple bounces in the sphere.

do_N_photons_gain(N[, double])

Do a Monte Carlo simulation with N photons.

do_N_photons_gain_array(N[, num_trials, double])

Do a Monte Carlo simulation with N photons.

do_N_photons_raw_array(N[, num_trials, double])

Do a Monte Carlo simulation with N photons.

do_one_photon([double, weight])

Bounce photon inside sphere until it leaves.

gain([sample_uru, third_uru])

Determine gain on detector due to multiple bounces in the sphere.

pdetector()

Print the detector power.

uniform()

Generate a point uniformly distributed on the surface of a sphere.

Attributes Documentation

a_wall

Getter property for detector port diameter.

d

Getter property for sphere diameter.

r_std

Getter property for reflectance standard.

r_wall

Getter property for wall reflectivity.

Methods Documentation

MR(sample_ur1, sample_uru=None, R_u=0, f_u=1, f_w=0)[source]

Determine the value of MR due to multiple bounces in the sphere.

Parameters:
  • sample_ur1 – The reflectance of the sample for normal illumination.

  • sample_uru – The reflectance of the sample for diffuse illumination.

  • R_u (optional) – The unscattered reflectance from the sample.

  • f_u (optional) – The fraction of unscattered reflected light collected.

  • f_w (optional) – The fraction of light that hits the sphere wall first.

Returns:

float – The calibrated measured reflection

MT(sample_ut1, sample_uru, T_u=0, f_u=1)[source]

Determine the measured transmission (MT) due to multiple bounces in the sphere.

The f_u variable describes the fraction of unscattered transmission that is collected by the sphere. It is equivalent to the -C option for the iad program and the default is that all the unscattered transmission is collected (because the third port is blocked). If the third port allows unscattered light to leave the sphere then it should be set to zero.

Parameters:
  • sample_ut1 – The transmission of the sample for normal illumination.

  • sample_uru – The reflectance of the sample for diffuse illumination.

  • T_u (optional) – The unscattered transmission of the sample.

  • f_u (optional) – The fraction of unscattered transmission collected.

Returns:

float – The calculated measured transmission (MT) value.

do_N_photons_gain(N, double=False)[source]

Do a Monte Carlo simulation with N photons.

do_N_photons_gain_array(N, num_trials=10, double=False)[source]

Do a Monte Carlo simulation with N photons.

do_N_photons_raw_array(N, num_trials=10, double=False)[source]

Do a Monte Carlo simulation with N photons.

do_one_photon(double=False, weight=1)[source]

Bounce photon inside sphere until it leaves.

The photon can leave through the third port, the detector port, the sample port (transmitted/absorbed by the sample), or be absorbed by the sphere walls.

This routine keeps propagating a photon until the weight drops to zero unless double is True

If double is True then

gain(sample_uru=None, third_uru=None)[source]

Determine gain on detector due to multiple bounces in the sphere.

If UX1 is the power passing through the sample UT1 or the power reflected by the sample UR1, then power falling on the detector port will be

P_detector = a_detector * gain * UX1 * P_0

where P_0 is the incident light. The power detected will be reduced by the reflectivity of the detector

P_detected = (1-r_detector) * P_detector

pdetector()[source]

Print the detector power.

uniform()[source]

Generate a point uniformly distributed on the surface of a sphere.

Using Gaussian distribution for all three coordinates ensures a uniform distribution on the surface of the sphere. See

https://math.stackexchange.com/questions/1585975

Returns:

(x, y, z) for a random point on the sphere’s surface.