Sample
- class iadpython.ad.Sample(a=0, b=1, g=0, d=1, n=1, n_above=1, n_below=1, quad_pts=4)[source]
Bases:
object
Container class for details of a sample.
Most things can be changed after creation by assigning to an element.
The angle of incidence is assumed to be perpendicular to the surface. This is stored as the cosine of the angle and therefore to change it to 60° from the normal, one does
Example:
sample.nu_0 = 0.5
To avoid needing to calculate the quadrature angles each time a calculation is done, the Sample object stores the quadrature angles as well as the redistribution function. A bit of trouble is taken to ensure that these values get updated when something changes e.g., the anisotropy, the angle of incidence, or the number of quadrature points.
- - a
albedo
- - b
optical thickness
- - b
physical thickness [mm]
- - g
scattering anisotropy [-]
- - n
index of refraction of sample
- - n_above
index of refraction of slide above
- - n_below
index of refraction of slide below
- - quad_pts
number of quadrature points
Attributes Summary
Getter property for anisotropy.
Getter property for index of refraction.
Getter property for number of quadrature points.
Methods Summary
UX1_and_UXU
(R, T)Calculate total reflected and transmitted fluxes from matrices.
Reduced albedo in delta-M approximation.
as_array
()Return details as an array.
Reduced thickness in delta-M approximation.
Initialize basic details as an array.
mu_a
()Absorption coefficient for the sample.
mu_s
()Scattering coefficient for the sample.
mu_sp
()Reduced scattering coefficient for the sample.
nu_c
()Cosine of critical angle in the sample.
prmatrix
(a[, title])Print matrix and sums.
rt
()Find the total reflected and transmitted flux for a sample.
Total reflection and transmission.
Find unscattered r and t.
Find unscattered r and t.
Calculate the correct set of quadrature points.
wrarray
(a[, title])Print diagonal array as matric with sums.
wrmatrix
(a[, title])Print matrix and sums.
Attributes Documentation
- g
Getter property for anisotropy.
- n
Getter property for index of refraction.
- quad_pts
Getter property for number of quadrature points.
Methods Documentation
- UX1_and_UXU(R, T)[source]
Calculate total reflected and transmitted fluxes from matrices.
The trick here is that the integration must be done over the fluxes that leave the sample. This is not much of an issue for the transmitted fluxes because they are zero. However, the internal reflected fluxes will not be zero and should be excluded from the sums.
- rt()[source]
Find the total reflected and transmitted flux for a sample.
This is extended so that arrays can be handled.
- rt_matrices()[source]
Total reflection and transmission.
This is the top level routine for accessing the adding-doubling algorithm. By passing the optical paramters characteristic of the sample, this routine will do what it must to return the total reflection and transmission for collimated and diffuse irradiance.
This routine has three different components based on if zero, one, or two boundary layers must be included. If the index of refraction of the sample and the top and bottom slides are all one, then no boundaries need to be included. If the top and bottom slides are identical, then some simplifications can be made and some time saved as a consequence. If the top and bottom slides are different, then the full red carpet treatment is required.
Since the calculation time increases for each of these cases we test for matched boundaries first. If the boundaries are matched then don’t bother with boundaries for the top and bottom. Just calculate the integrated reflection and transmission. Similarly, if the top and bottom slides are similar, then quickly calculate these.
- update_quadrature()[source]
Calculate the correct set of quadrature points.
This returns the quadrature angles using Radau quadrature over the interval 0 to 1 if there is no critical angle for total internal reflection in the self. If there is a critical angle whose cosine is ‘nu_c’ then Radau quadrature points are chosen from 0 to ‘nu_c’ and Radau quadrature points over the interval ‘nu_c’ to 1.
Now we need to include three angles, the critical angle, the cone angle, and perpendicular. Now the important angles are the ones in the self. So we calculate the cosine of the critical angle in the sample and cosine of the cone angle in the self.
The critical angle will always be greater than the cone angle in the sample and therefore the cosine of the critical angle will always be less than the cosine of the cone angle. Thus we will integrate from zero to the cosine of the critical angle (using Gaussian quadrature to avoid either endpoint) then from the critical angle to the cone angle (using Radau quadrature so that the cosine angle will be included) and finally from the cone angle to 1 (again using Radau quadrature so that 1 will be included).