From 4ba4e4ea43c19a15509a9a9379075b853a6b25c9 Mon Sep 17 00:00:00 2001 From: "Thomas A. Germer" Date: Tue, 17 Oct 2017 15:30:18 -0400 Subject: [PATCH 1/2] Add ZernikeExpansion_BRDF_Model Added the ZernikeExpansion_BRDF_Model to the code and added the documentation for it. --- code/reg_brdf.cpp | 2 + docs/classes.htm | 2 + docs/download.htm | 9 +- docs/history.htm | 9 +- docs/index.htm | 8 +- docs/zernikeexpansion.htm | 268 +++++++++++++++++++++++++++++++++++++ docs/zernikeexpansion.htm~ | 260 +++++++++++++++++++++++++++++++++++ 7 files changed, 547 insertions(+), 11 deletions(-) create mode 100644 docs/zernikeexpansion.htm create mode 100644 docs/zernikeexpansion.htm~ diff --git a/code/reg_brdf.cpp b/code/reg_brdf.cpp index 74ed7c7..a15246a 100644 --- a/code/reg_brdf.cpp +++ b/code/reg_brdf.cpp @@ -22,6 +22,7 @@ #include "transmit.h" #include "rcw.h" #include "crossrcw.h" +#include "zernikeexpansion.h" namespace SCATMECH { @@ -45,6 +46,7 @@ namespace SCATMECH { Register_Model(Transmit_BRDF_Model); Register_Model(RCW_BRDF_Model); Register_Model(CrossRCW_BRDF_Model); + Register_Model(ZernikeExpansion_BRDF_Model); } } diff --git a/docs/classes.htm b/docs/classes.htm index 9258499..b4774e9 100644 --- a/docs/classes.htm +++ b/docs/classes.htm @@ -257,6 +257,8 @@

Surface Scattering Models

  • class RCW_BRDF_Model
  • class CrossRCW_BRDF_Model
  • +
  • class ZernikeExpansion_BRDF_Model
  • + diff --git a/docs/download.htm b/docs/download.htm index 2051825..b72c536 100644 --- a/docs/download.htm +++ b/docs/download.htm @@ -22,9 +22,9 @@

    Download

    Download:

    -

    Download release Version 7.01 as - SCATMECH-7.01.zip or - SCATMECH-7.01.tar.gz

    +

    Download release Version 7.10 as + SCATMECH-7.10.zip or + SCATMECH-7.10.tar.gz

    To download the latest pre-release version of the library, go to GitHub SCATMECH repository and choose Clone or Download.

    @@ -40,9 +40,6 @@

    For More Information

    Website Comments

    -Current SCATMECH version: 7.00 (January 2015)
    -This page first online: Version 1.00 (March 2000)
    -This page last modified: Version 7.00 (January 2015)








































    diff --git a/docs/history.htm b/docs/history.htm index d25d03e..ce50863 100644 --- a/docs/history.htm +++ b/docs/history.htm @@ -18,6 +18,8 @@

    Version History


    - + +

    Version 7.10 (October 2017)

    + + The model ZernikeExpansion_BRDF_Model was added. + +

    Version 7.01 (September 2017)

    diff --git a/docs/index.htm b/docs/index.htm index c065c9f..ca4a331 100644 --- a/docs/index.htm +++ b/docs/index.htm @@ -48,7 +48,7 @@

    SCATMECH:

    Current Version

    -

    Download version 7.01 (September 2017)
    +

    Download version 7.10 (October 2017)
    See version history

    Author

    @@ -112,9 +112,9 @@

    For More Information

    Website Comments

    -Current SCATMECH version: 7.01 (September 2017)
    -This page first online: Version 1.00 (March 2000)
    -This page last modified: Version 7.01 (September 2017)
    +Current SCATMECH version: 7.10 (October 2017)
    +This page first online: Version 1.00 (March 2000)
    +This page last modified: Version 7.10 (October 2017)








































    diff --git a/docs/zernikeexpansion.htm b/docs/zernikeexpansion.htm new file mode 100644 index 0000000..2bcf90a --- /dev/null +++ b/docs/zernikeexpansion.htm @@ -0,0 +1,268 @@ + + + + + + SCATMECH: ZernikeExpansion_BRDF_Model + + + + + + + + + + + + + + + +
    + + +

    class ZernikeExpansion_BRDF_Model

    + + +
    + +

    The class ZernikeExpansion_BRDF_Model is a + phenomenological model that is based on the work of + Koenderink and van Doorn and extended to account for the + full Mueller matrix BRDF. The Mueller matrix BRDF is treated + as the sum of surface scattering modes, which are related to + the Zernike polynomials. The set of surface scattering modes is complete for valid + scattering functions obeying reciprocity. See + the references below for a complete + description, including a link to data taken for sintered + polytetrafluoroethylene (PTFE), which can be used for this + model. +

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterData + TypeDescriptionDefault
    lambdadoubleWavelength of the light in vacuum [µm].
    + (Inherited from BRDF_Model.)
    0.532
    typeint + Indicates whether the light is incident from above the + substrate or from within the substrate and whether the + scattering is evaluated in reflection or transmission. + The choices are:
    + 0 : Light is incident from the above the substrate, and scattering is evaluated in reflection.
    + 1 : Light is incident from the above the substrate, and scattering is evaluated in transmission.
    + 2 : Light is incident from the within the substrate, and scattering is evaluated in reflection.
    + 3 : Light is incident from the within the substrate, and scattering is evaluated in transmission.
    + For 1, 2, and 3, the substrate must be non-absorbing.
    + (Inherited from BRDF_Model).
    + NOTE: Only type=0 is implemented by this model. +
    0
    substratedielectric_functionThe + optical constants of the substrate, expressed as a + complex number (n,k) or, optionally, as a function of + wavelength.
    + (Inherited from BRDF_Model.)
    + NOTE: This parameter is ignored by this model
    (4.05,0.05)
    coefficientfilestd::stringName of the CSV file containing the list of coefficients. The description of this + file is given below.blank
    scaleTableA scaling factor $r(\lambda)$, usually the diffuse reflectance. + 1
    + +

    See also:

    +
    + +

    + SCATMECH Home,   + Conventions,   + BRDF_Model,   +

    + + +

    J. J. Koenderink + and A. J. van Doorn, "Phenomenological description of + bidirectional surface reflection," + J. Opt. Soc. Am. A. 15, 2903–2912 (1998).

    +

    T. A. Germer, "Full four-dimensional and reciprocal Mueller matrix bidirectional reflectance distribution function of sintered polytetrafluoroethylene," Appl. Opt., in press (2017).

    + +

    T. A. Germer, “Supplementary Data for ‘Full four-dimensional and reciprocal Mueller matrix bidirectional reflectance distribution function of sintered polytetrafluoroethylene,’ ” figshare (2017)

    + +

    Include file:

    + +
    +#include "zernikeexpansion.h"
    +
    +

    Source code:

    + +
    +zernikeexpansion.cpp
    +
    + +
    + +

    Description of Coefficient File

    + +

    + The paper by Germer (see above) shows that the Mueller matrix BRDF elements in the xyxy basis can be expressed as an expansion based upon the Zernike polynomials. + The unpolarized 11 element is given by + \begin{equation} + f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir})=r(\lambda) \sum_{nmkp} a_{11,nm}^{kp}\lambda^p I_{nm}^{k}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}), + \end{equation} + where $\phi_{\rm ir}$ is the azimuthal scattering angle $\phi_{\rm s}$, $\lambda$ is the wavelength, + \begin{equation} + I_{nm}^{k}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir})= \frac{1}{2\pi}\left[\frac{(n+1)(m+1)}{A_{nm}^k}\right]^{1/2} + \left[R_n^k\left(\sqrt{2}\sin\frac{\theta_{\rm i}}{2}\right)R_m^k\left(\sqrt{2}\sin\frac{\theta_{\rm r}}{2}\right)+\right. + \left.R_m^k\left(\sqrt{2}\sin\frac{\theta_{\rm i}}{2}\right)R_n^k\left(\sqrt{2}\sin\frac{\theta_{\rm r}}{2}\right)\right] + \cos k\Delta\phi_{\rm ir}, + \end{equation} + \begin{equation} + A_{nm}^k= + \left\{\begin{array}{ll} + 4 & \mbox{if $(n=0)$ or $((n=m)$ and $(k=0))$}\\ + 2 & \mbox{if $((n=m)$ or $(k=0))$}\\ + 1 & \mbox{otherwise,} + \end{array}\right. + \end{equation} + and the radial Zernike polynomials are given by + \begin{equation} + R_n^m(\rho) = \sum_{s=0}^{(n-\vert m \vert)/2}(-1)^s\frac{(n-s)!}{s!\left(\frac{n+m}{2}-s\right)!\left(\frac{n-m}{2}-s\right)!}\rho^{n-2s}. + \end{equation} + The parameter $r(\lambda)$ is a scaling factor that accounts for the wavelength dependence of the directional-hemispherical reflectance. The model parameter scale + is used to store $r(\lambda)$. + + The other diagonal elements are given by + \begin{equation} + f_{{\rm r},ii}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir})= f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}) \sum_{nmklp} a_{ii,nm}^{klp}\lambda^p H_{nm}^{kl}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}), + \end{equation} + where + \begin{equation} + H_{nm}^{kl}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}) = \frac{ + K_n^k(\theta_{\rm i},\phi_{\rm i})K_m^l(\theta_{\rm r},\phi_{\rm r})+K_n^k(\theta_{\rm r},\phi_{\rm r})K_m^l(\theta_{\rm i},\phi_{\rm i}) + }{(2+2\delta_{nm}\delta_{kl})^{1/2}}. + \end{equation} + + The upper-diagonal elements are given by + \begin{equation} + f_{{\rm r},ij}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}) = f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}) \sum_{nkmlp} a_{ij,nm}^{klp}\lambda^p K_n^k(\theta_{\rm i},\phi_{\rm i})K_m^l(\theta_{\rm r},\phi_{\rm r}), + \end{equation} + and the lower-diagonal elements are given by + \begin{equation} + f_{{\rm r},ji}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}) = \pm f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}) \sum_{nkmlp} a_{ij,nm}^{klp}\lambda^p K_m^l(\theta_{\rm i},\phi_{\rm i})K_n^k(\theta_{\rm r},\phi_{\rm r}), + \end{equation} + where + \begin{equation} + K_n^k(\theta,\phi)=\sqrt{\frac{n+1}{\pi}}R_n^k\left(\sqrt{2}\sin\frac{\theta}{2}\right){\rm az}_k(\phi), + \label{eq:zp} + \end{equation} + and where + \begin{equation} + {\rm az}_k(\phi)=\left\{ + \begin{array}{ll} + -\sin k\phi, & k<0\\ + 1/\sqrt{2}, & k=0\\ + \cos k\phi, & k>0. + \end{array} + \right. + \end{equation} +

    + +

    The file containing the coefficients is a column-separated-variable (CSV) file with eight columns:

    + +
      +
    • 1. Mueller matrix index (1-based), $i$, where the Mueller matrix is $M_{ij}$.
    • +
    • 2. Mueller matrix index (1-based), $j$, where the Mueller matrix is $M_{ij}$.
    • +
    • 3. Zernike radial order $m$
    • +
    • 4. Zernike radial order $n$
    • +
    • 5. Zernike azimuthal order $k$
    • +
    • 6. Zernike azimuthal order $l$
    • +
    • 7. Power of $\lambda$, $p$ (where $\lambda$ is assumed to be in the common length unit, usually micrometers)
    • +
    • 8. Coefficient, $a_{ij,mn}^{klp}$
    • +
    + +

    Coefficient files appropriate for sintered PTFE are included in the supplementary data for the paper.

    +

    + +
    + +

    Top of Page

    + + + +
    +

    For More Information

    + +

    +SCATMECH Technical Information and Questions
    +Sensor Science Division Home Page
    +Sensor Science Division Inquiries
    +Website Comments + +

    +Current SCATMECH version: 7.10 (January 2017)
    +This page first online: Version 7.10 (October 2017)
    +This page last modified: Version 7.10 (October 2017)
    + +



















    +



















    + +

    + + + diff --git a/docs/zernikeexpansion.htm~ b/docs/zernikeexpansion.htm~ new file mode 100644 index 0000000..63dcd38 --- /dev/null +++ b/docs/zernikeexpansion.htm~ @@ -0,0 +1,260 @@ + + + + + + SCATMECH: ZernikeExpansion_BRDF_Model + + + + + + + + + + + + + + + +
    + + +

    class ZernikeExpansion_BRDF_Model

    + + +
    + +

    The class ZernikeExpansion_BRDF_Model is a phenomenological model that is based on the work of + Koenderink and van Doorn and extended to account for the full Mueller matrix BRDF. See the references below + for a complete description, including a link to data taken for sintered polytetrafluoroethylene (PTFE), which can be used for this model. +

    + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterData + TypeDescriptionDefault
    lambdadoubleWavelength of the light in vacuum [µm].
    + (Inherited from BRDF_Model.)
    0.532
    typeint + Indicates whether the light is incident from above the + substrate or from within the substrate and whether the + scattering is evaluated in reflection or transmission. + The choices are:
    + 0 : Light is incident from the above the substrate, and scattering is evaluated in reflection.
    + 1 : Light is incident from the above the substrate, and scattering is evaluated in transmission.
    + 2 : Light is incident from the within the substrate, and scattering is evaluated in reflection.
    + 3 : Light is incident from the within the substrate, and scattering is evaluated in transmission.
    + For 1, 2, and 3, the substrate must be non-absorbing.
    + (Inherited from BRDF_Model).
    + NOTE: Only type=0 is implemented by this model. +
    0
    substratedielectric_functionThe + optical constants of the substrate, expressed as a + complex number (n,k) or, optionally, as a function of + wavelength.
    + (Inherited from BRDF_Model.)
    + NOTE: This parameter is ignored by this model
    (4.05,0.05)
    coefficientfilestd::stringName of the CSV file containing the list of coefficients. The description of this + file is given below.blank
    scaleTableA scaling factor $r(\lambda)$, usually the diffuse reflectance. + 1
    + +

    See also:

    +
    + +

    + SCATMECH Home,   + Conventions,   + BRDF_Model,   +

    + + +

    J. J. Koenderink + and A. J. van Doorn, "Phenomenological description of + bidirectional surface reflection," + J. Opt. Soc. Am. A. 15, 2903–2912 (1998).

    +

    T. A. Germer, "Full four-dimensional and reciprocal Mueller matrix bidirectional reflectance distribution function of sintered polytetrafluoroethylene," Appl. Opt., in press (2017).

    + +

    T. A. Germer, “Supplementary Data for ‘Full four-dimensional and reciprocal Mueller matrix bidirectional reflectance distribution function of sintered polytetrafluoroethylene,’ ” figshare (2017)

    + +

    Include file:

    + +
    +#include "zernikeexpansion.h"
    +
    +

    Source code:

    + +
    +zernikeexpansion.cpp
    +
    + +
    + +

    Description of Coefficient File

    + +

    + The paper by Germer (see above) shows that the Mueller matrix BRDF elements in the xyxy basis can be expressed as an expansion based upon the Zernike polynomials. + The unpolarized 11 element is given by + \begin{equation} + f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir})=r(\lambda) \sum_{nmkp} a_{11,nm}^{kp}\lambda^p I_{nm}^{k}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}), + \end{equation} + where $\phi_{\rm ir}$ is the azimuthal scattering angle $\phi_{\rm s}$, $\lambda$ is the wavelength, + \begin{equation} + I_{nm}^{k}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir})= \frac{1}{2\pi}\left[\frac{(n+1)(m+1)}{A_{nm}^k}\right]^{1/2} + \left[R_n^k\left(\sqrt{2}\sin\frac{\theta_{\rm i}}{2}\right)R_m^k\left(\sqrt{2}\sin\frac{\theta_{\rm r}}{2}\right)+\right. + \left.R_m^k\left(\sqrt{2}\sin\frac{\theta_{\rm i}}{2}\right)R_n^k\left(\sqrt{2}\sin\frac{\theta_{\rm r}}{2}\right)\right] + \cos k\Delta\phi_{\rm ir}, + \end{equation} + \begin{equation} + A_{nm}^k= + \left\{\begin{array}{ll} + 4 & \mbox{if $(n=0)$ or $((n=m)$ and $(k=0))$}\\ + 2 & \mbox{if $((n=m)$ or $(k=0))$}\\ + 1 & \mbox{otherwise,} + \end{array}\right. + \end{equation} + and the radial Zernike polynomials are given by + \begin{equation} + R_n^m(\rho) = \sum_{s=0}^{(n-\vert m \vert)/2}(-1)^s\frac{(n-s)!}{s!\left(\frac{n+m}{2}-s\right)!\left(\frac{n-m}{2}-s\right)!}\rho^{n-2s}. + \end{equation} + The parameter $r(\lambda)$ is a scaling factor that accounts for the wavelength dependence of the directional-hemispherical reflectance. The model parameter scale + is used to store $r(\lambda)$. + + The other diagonal elements are given by + \begin{equation} + f_{{\rm r},ii}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir})= f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}) \sum_{nmklp} a_{ii,nm}^{klp}\lambda^p H_{nm}^{kl}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}), + \end{equation} + where + \begin{equation} + H_{nm}^{kl}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}) = \frac{ + K_n^k(\theta_{\rm i},\phi_{\rm i})K_m^l(\theta_{\rm r},\phi_{\rm r})+K_n^k(\theta_{\rm r},\phi_{\rm r})K_m^l(\theta_{\rm i},\phi_{\rm i}) + }{(2+2\delta_{nm}\delta_{kl})^{1/2}}. + \end{equation} + + The upper-diagonal elements are given by + \begin{equation} + f_{{\rm r},ij}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}) = f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}) \sum_{nkmlp} a_{ij,nm}^{klp}\lambda^p K_n^k(\theta_{\rm i},\phi_{\rm i})K_m^l(\theta_{\rm r},\phi_{\rm r}), + \end{equation} + and the lower-diagonal elements are given by + \begin{equation} + f_{{\rm r},ji}(\theta_{\rm i},\phi_{\rm i},\theta_{\rm r},\phi_{\rm r}) = \pm f_{{\rm r},11}(\theta_{\rm i},\theta_{\rm r},\Delta\phi_{\rm ir}) \sum_{nkmlp} a_{ij,nm}^{klp}\lambda^p K_m^l(\theta_{\rm i},\phi_{\rm i})K_n^k(\theta_{\rm r},\phi_{\rm r}), + \end{equation} + where + \begin{equation} + K_n^k(\theta,\phi)=\sqrt{\frac{n+1}{\pi}}R_n^k\left(\sqrt{2}\sin\frac{\theta}{2}\right){\rm az}_k(\phi), + \label{eq:zp} + \end{equation} + and where + \begin{equation} + {\rm az}_k(\phi)=\left\{ + \begin{array}{ll} + -\sin k\phi, & k<0\\ + 1/\sqrt{2}, & k=0\\ + \cos k\phi, & k>0. + \end{array} + \right. + \end{equation} +

    + +

    The file containing the coefficients is a column-separated-variable (CSV) file with eight columns:

    + +
      +
    • 1. Mueller matrix index (1-based), $i$, where the Mueller matrix is $M_{ij}$.
    • +
    • 2. Mueller matrix index (1-based), $j$, where the Mueller matrix is $M_{ij}$.
    • +
    • 3. Zernike radial order $m$
    • +
    • 4. Zernike radial order $n$
    • +
    • 5. Zernike azimuthal order $k$
    • +
    • 6. Zernike azimuthal order $l$
    • +
    • 7. Power of $\lambda$, $p$ (where $\lambda$ is assumed to be in the common length unit, usually micrometers)
    • +
    • 8. Coefficient, $a_{ij,mn}^{klp}$
    • +
    + +

    Coefficient files appropriate for sintered PTFE are included in the supplementary data for the paper.

    +

    + +
    + +

    Top of Page

    + + + +
    +

    For More Information

    + +

    +SCATMECH Technical Information and Questions
    +Sensor Science Division Home Page
    +Sensor Science Division Inquiries
    +Website Comments + +

    +Current SCATMECH version: 7.10 (January 2017)
    +This page first online: Version 7.10 (October 2017)
    +This page last modified: Version 7.10 (October 2017)
    + +



















    +



















    + +

    + + + From 6d71f349a998a81bb18bbbdefb47bd235673a8a9 Mon Sep 17 00:00:00 2001 From: "Thomas A. Germer" Date: Wed, 18 Oct 2017 09:27:09 -0400 Subject: [PATCH 2/2] Polish ZernikeExpansion_BRDF_Model code --- code/zernikeexpansion.cpp | 47 ++++++++++++++++++++++++++++----------- code/zernikeexpansion.h | 4 ++-- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/code/zernikeexpansion.cpp b/code/zernikeexpansion.cpp index 068f393..2b21f1a 100644 --- a/code/zernikeexpansion.cpp +++ b/code/zernikeexpansion.cpp @@ -16,6 +16,13 @@ using namespace std; using namespace SCATMECH; +//// +//// ZernikeExpansion_BRDF_Model implements the model described in +//// T.A. Germer, "Full four-dimensional and reciprocal Mueller matrix +//// bidirectional reflectance distribution function of +//// sintered polytetrafluoroethylene," Appl. Opt., in press (2017). +//// + namespace SCATMECH { /// @@ -52,11 +59,19 @@ void ZernikeExpansion_BRDF_Model::setup() // The model uses the xyxy basis, rather than the default psps model_cs = xyxy; + // This code does not accept anything for transmission mode or for + // radiation upwelling in the material + throw_transmission(); + throw_backward(); + + // Check that coefficientfile has been specified + if (coefficientfile.size() == 0) throw("No coefficient file specified"); + // Open the coefficient file ifstream_with_comments cfile(coefficientfile.c_str()); // Throw exception if the coefficient file doesn't open - if (!cfile) error("Cannot open coefficient file."); + if (!cfile) error(string("Cannot open coefficient file '") + coefficientfile + string("'")); // Clear the list of coefficients coeff.clear(); @@ -95,11 +110,15 @@ void ZernikeExpansion_BRDF_Model::setup() // If there was a failure, then throw an exception if (sline.fail()) error("Error reading a line in coefficient file"); + // Check some ranges... + if (i < 1 || i > 4) error("i = " + to_string(i) + " out of range in coefficient file"); + if (j < 1 || j > 4) error("j = " + to_string(j) + " out of range in coefficient file"); + if (p < 0 || p > 4) error("p = " + to_string(p) + " out of range in coefficient file"); + // Push the coefficient onto the list of coefficients coeff.push_back(Coefficient(i,j,n,m,k,l,p,c)); } } - return; } MuellerMatrix ZernikeExpansion_BRDF_Model::mueller() @@ -108,11 +127,6 @@ MuellerMatrix ZernikeExpansion_BRDF_Model::mueller() // routines that use SETUP(); - // This code does not accept anything for transmission mode or for - // radiation upwelling in the material - throw_transmission(); - throw_backward(); - // Start the sum with zero MuellerMatrix result = MuellerZero(); double brdf = 0; @@ -123,6 +137,14 @@ MuellerMatrix ZernikeExpansion_BRDF_Model::mueller() double phii = pi-rotation; double phir = phis-rotation; + // Create a table of powers of lambda + double lambdapower[5]; + lambdapower[0] = 1.; + lambdapower[1] = lambda; + lambdapower[2] = lambdapower[1] * lambda; + lambdapower[3] = lambdapower[2] * lambda; + lambdapower[4] = lambdapower[3] * lambda; + // Iterate through all the coefficients... for (list::iterator q=coeff.begin();q!=coeff.end();++q) { short i = q->i; @@ -134,8 +156,7 @@ MuellerMatrix ZernikeExpansion_BRDF_Model::mueller() short p = q->p; double coeff = q->coeff; - // The following just evaluates lambda^p - double power = p==0?1.:p==1?lambda:p==2?sqr(lambda):p==3?sqr(lambda):pow(lambda,p); + double power = lambdapower[p]; if (i==1&&j==1) { // The basis set for the unpolarized BRDF... @@ -148,7 +169,7 @@ MuellerMatrix ZernikeExpansion_BRDF_Model::mueller() result[i-1][j-1] += coeff * prefact * (Radial_Zernike_Polynomial(n,k,rhoi)*Radial_Zernike_Polynomial(m,l,rhor)*az(k,phii)*az(l,phir) + Radial_Zernike_Polynomial(m,l,rhoi)*Radial_Zernike_Polynomial(n,k,rhor)*az(k,phir)*az(l,phii)); } else if (i