@@ -746,18 +746,17 @@ def ashraeiam(aoi, b=0.05):
746746def physicaliam (aoi , n = 1.526 , K = 4. , L = 0.002 ):
747747 '''
748748 Determine the incidence angle modifier using refractive index,
749- glazing thickness , and extinction coefficient
749+ extinction coefficient , and glazing thickness.
750750
751751 physicaliam calculates the incidence angle modifier as described in
752752 De Soto et al. "Improvement and validation of a model for
753753 photovoltaic array performance", section 3. The calculation is based
754- upon a physical model of absorbtion and transmission through a
755- cover. Required information includes, incident angle, cover
756- extinction coefficient, cover thickness
754+ on a physical model of absorbtion and transmission through a
755+ cover.
757756
758757 Note: The authors of this function believe that eqn. 14 in [1] is
759758 incorrect. This function uses the following equation in its place:
760- theta_r = arcsin(1/n * sin(theta ))
759+ theta_r = arcsin(1/n * sin(aoi ))
761760
762761 Parameters
763762 ----------
@@ -788,14 +787,8 @@ def physicaliam(aoi, n=1.526, K=4., L=0.002):
788787
789788 Returns
790789 -------
791- IAM : numeric
792- The incident angle modifier as specified in eqns. 14-16 of [1].
793- IAM is a column vector with the same number of elements as the
794- largest input vector.
795-
796- Theta must be a numeric scalar or vector. For any values of
797- theta where abs(aoi)>90, IAM is set to 0. For any values of aoi
798- where -90 < aoi < 0, theta is set to abs(aoi) and evaluated.
790+ iam : numeric
791+ The incident angle modifier
799792
800793 References
801794 ----------
@@ -816,6 +809,11 @@ def physicaliam(aoi, n=1.526, K=4., L=0.002):
816809 '''
817810 zeroang = 1e-06
818811
812+ # hold a new reference to the input aoi object since we're going to
813+ # overwrite the aoi reference below, but we'll need it for the
814+ # series check at the end of the function
815+ aoi_input = aoi
816+
819817 aoi = np .where (aoi == 0 , zeroang , aoi )
820818
821819 # angle of reflection
@@ -849,8 +847,8 @@ def physicaliam(aoi, n=1.526, K=4., L=0.002):
849847 # for light coming from behind the plane, none can enter the module
850848 iam = np .where (aoi > 90 , 0 , iam )
851849
852- if isinstance (aoi , pd .Series ):
853- iam = pd .Series (iam , index = aoi .index )
850+ if isinstance (aoi_input , pd .Series ):
851+ iam = pd .Series (iam , index = aoi_input .index )
854852
855853 return iam
856854
0 commit comments