This class is used to set up a system layers and perform calculations such reflectivity, transmissivity, absorptivity and electric field intensity.
It bears mentioning that the .calcA() method only needs to be provided with the "sample" system, and it will automatically determine a "reference" system and compute the absorbance by taking -log10(sample/reference). The method setLayers() creates an attribute, self.etas, and for each material called, the method copies over the permittivity array from the materials object. The setLayers() method also creates a second attribute, self.etasRef. This attribute is identical to the self.etas attribute, except that the organic adsorbate is replaced with the terminal phase. First, the method checks to see if any of the materials were created with the setBruggeman() method in the materials class. If it finds a Bruggeman layer, it will recreate the permittivity function of the material by replacing the adsorbate material with the host material. If no Bruggeman layer is present in the list of parameters, it will simply replace the penultimate phase with the ultimate phase.
This allows the .calcA() method to automatically create a reference case to use when computing absorbance instead of requiring the user to manually set up a reference case, which is error-prone. Note that this "automatic reference calculation" only works if the organic adsorbate is in the penultimate layer (or adsorbed to the ellipsoids in the Bruggeman layer, which itself is the penultimate layer.) I did this because I found that I was making errors when calculating the reference case, and unintentionally changing more parameters than simply removing the test molecule. Of couse it is still possible to calculate absorbances manually by calculating two reflectivity spectra and taking the negative log of their ratio.