original_docstring: 
          Returns a Surface-class element based on an input-array of
          Surface-class elements.
          The array must be shaped in the form:
              SRFchoices = [  [ weighting-factor   ,   Surface-class element ],
                              [ weighting-factor   ,   Surface-class element ],
                          ...]
  
          ATTENTION: the .legexpansion()-function of the combined surface-class
          element is no longer related to its legcoefs (which are set to 0.)
                     since the individual legexpansions of the combined surface-
                     class elements are possibly evaluated with a different
                     a-parameter of the generalized scattering angle! This does
                     not affect any calculations, since the evaluation is
                     only based on the use of the .legexpansion()-function.
          
docstring: Returns a Surface-class element based on an input-array of
  Surface-class elements.
  The array must be shaped in the form:
  SRFchoices = [  [ weighting-factor   ,   Surface-class element ],
  [ weighting-factor   ,   Surface-class element ],
  ]
  
  the .legexpansion()-function of the combined surface-class
  element is no longer related to its legcoefs (which are set to 0.)
  since the individual legexpansions of the combined surface
  class elements are possibly evaluated with a different
  a-parameter of the generalized scattering angle. This does
  not affect any calculations, since the evaluation is
  only based on the use of the .legexpansion()-function.
docstring_tokens: Returns a Surface - class element based on an input - array of Surface - class elements . The array must be shaped in the form : SRFchoices = [ [ weighting - factor Surface - class element ] [ weighting - factor Surface - class element ] ] the . legexpansion () - function of the combined surface - class element is no longer related to its legcoefs ( which are set to 0 . ) since the individual legexpansions of the combined surface class elements are possibly evaluated with a different a - parameter of the generalized scattering angle . This does not affect any calculations since the evaluation is only based on the use of the . legexpansion () - function .
code: def _SRFcombiner(self):
          """
          Returns a Surface-class element based on an input-array of
          Surface-class elements.
          The array must be shaped in the form:
              SRFchoices = [  [ weighting-factor   ,   Surface-class element ],
                              [ weighting-factor   ,   Surface-class element ],
                          ...]
  
          ATTENTION: the .legexpansion()-function of the combined surface-class
          element is no longer related to its legcoefs (which are set to 0.)
                     since the individual legexpansions of the combined surface-
                     class elements are possibly evaluated with a different
                     a-parameter of the generalized scattering angle! This does
                     not affect any calculations, since the evaluation is
                     only based on the use of the .legexpansion()-function.
          """
  
          class BRDFfunction(Surface):
              """
              dummy-Surface-class object used to generate
              linear-combinations of BRDF-functions
              """
  
              def __init__(self, **kwargs):
                  super(BRDFfunction, self).__init__(**kwargs)
                  self._set_function()
                  self._set_legcoefficients()
  
              def _set_function(self):
                  """def phase function as sympy object for later evaluation"""
                  self._func = 0.
  
              def _set_legcoefficients(self):
                  self.legcoefs = 0.
  
          # initialize a combined phase-function class element
          SRFcomb = BRDFfunction(NormBRDf=self.NormBRDF)
          # set ncoefs of the combined volume-class element to the maximum
          SRFcomb.ncoefs = max([SRF[1].ncoefs for SRF in self.SRFchoices])
          #   number of coefficients within the chosen functions.
          #   (this is necessary for correct evaluation of fn-coefficients)
  
          # find BRDF functions with equal a parameters
          equals = [np.where((np.array([VV[1].a for VV in self.SRFchoices]) ==
                              tuple(V[1].a)).all(axis=1))[0]
                    for V in self.SRFchoices]
  
          # evaluate index of BRDF-functions that have equal a parameter
  
          # find phase functions where a-parameter is equal
          equal_a = list({tuple(row) for row in equals})
  
          # evaluation of combined expansion in legendre-polynomials
          dummylegexpansion = []
          for i in range(0, len(equal_a)):
  
              SRFdummy = BRDFfunction()
              # select SRF choices where a parameter is equal
              SRFequal = np.take(self.SRFchoices, equal_a[i], axis=0)
              # set ncoefs to the maximum number within the choices
              # with equal a-parameter
              SRFdummy.ncoefs = max([SRF[1].ncoefs for SRF in SRFequal])
              # loop over phase-functions with equal a-parameter
              for SRF in SRFequal:
  
                  # set parameters based on chosen phase-functions and evaluate
                  # combined legendre-expansion
                  SRFdummy.a = SRF[1].a
                  SRFdummy.NormBRDF = SRF[1].NormBRDF
                  SRFdummy._func = SRFdummy._func + SRF[1]._func * SRF[0]
                  SRFdummy.legcoefs += SRF[1].legcoefs * SRF[0]
  
              dummylegexpansion = dummylegexpansion + [SRFdummy.legexpansion]
  
          # combine legendre-expansions for each a-parameter based on given
          # combined legendre-coefficients
          SRFcomb.legexpansion = lambda t_0, t_ex, p_0, p_ex, geometry: np.sum(
              [lexp(t_0, t_ex, p_0, p_ex, geometry)
               for lexp in dummylegexpansion])
  
          for SRF in self.SRFchoices:
              # set parameters based on chosen classes to define analytic
              # function representation
              SRFcomb._func = SRFcomb._func + SRF[1]._func * SRF[0]
          return SRFcomb
code_tokens: def _SRFcombiner ( self ) : class BRDFfunction ( Surface ) : """
              dummy-Surface-class object used to generate
              linear-combinations of BRDF-functions
              """ def __init__ ( self , ** kwargs ) : super ( BRDFfunction , self ) . __init__ ( ** kwargs ) self . _set_function ( ) self . _set_legcoefficients ( ) def _set_function ( self ) : """def phase function as sympy object for later evaluation""" self . _func = 0. def _set_legcoefficients ( self ) : self . legcoefs = 0. SRFcomb = BRDFfunction ( NormBRDf = self . NormBRDF ) SRFcomb . ncoefs = max ( [ SRF [ 1 ] . ncoefs for SRF in self . SRFchoices ] ) equals = [ np . where ( ( np . array ( [ VV [ 1 ] . a for VV in self . SRFchoices ] ) == tuple ( V [ 1 ] . a ) ) . all ( axis = 1 ) ) [ 0 ] for V in self . SRFchoices ] equal_a = list ( { tuple ( row ) for row in equals } ) dummylegexpansion = [ ] for i in range ( 0 , len ( equal_a ) ) : SRFdummy = BRDFfunction ( ) SRFequal = np . take ( self . SRFchoices , equal_a [ i ] , axis = 0 ) SRFdummy . ncoefs = max ( [ SRF [ 1 ] . ncoefs for SRF in SRFequal ] ) for SRF in SRFequal : SRFdummy . a = SRF [ 1 ] . a SRFdummy . NormBRDF = SRF [ 1 ] . NormBRDF SRFdummy . _func = SRFdummy . _func + SRF [ 1 ] . _func * SRF [ 0 ] SRFdummy . legcoefs += SRF [ 1 ] . legcoefs * SRF [ 0 ] dummylegexpansion = dummylegexpansion + [ SRFdummy . legexpansion ] SRFcomb . legexpansion = lambda t_0 , t_ex , p_0 , p_ex , geometry : np . sum ( [ lexp ( t_0 , t_ex , p_0 , p_ex , geometry ) for lexp in dummylegexpansion ] ) for SRF in self . SRFchoices : SRFcomb . _func = SRFcomb . _func + SRF [ 1 ] . _func * SRF [ 0 ] return SRFcomb
short_docstring: Returns a Surface-class element based on an input-array of
  Surface-class elements.
short_docstring_tokens: Returns a Surface - class element based on an input - array of Surface - class elements .
comment: """
          Returns a Surface-class element based on an input-array of
          Surface-class elements.
          The array must be shaped in the form:
              SRFchoices = [  [ weighting-factor   ,   Surface-class element ],
                              [ weighting-factor   ,   Surface-class element ],
                          ...]
  
          ATTENTION: the .legexpansion()-function of the combined surface-class
          element is no longer related to its legcoefs (which are set to 0.)
                     since the individual legexpansions of the combined surface-
                     class elements are possibly evaluated with a different
                     a-parameter of the generalized scattering angle! This does
                     not affect any calculations, since the evaluation is
                     only based on the use of the .legexpansion()-function.
          """$SEP$"""
              dummy-Surface-class object used to generate
              linear-combinations of BRDF-functions
              """$SEP$"""def phase function as sympy object for later evaluation"""$SEP$# initialize a combined phase-function class element$SEP$# set ncoefs of the combined volume-class element to the maximum$SEP$#   number of coefficients within the chosen functions.$SEP$#   (this is necessary for correct evaluation of fn-coefficients)$SEP$# find BRDF functions with equal a parameters$SEP$# evaluate index of BRDF-functions that have equal a parameter$SEP$# find phase functions where a-parameter is equal$SEP$# evaluation of combined expansion in legendre-polynomials$SEP$# select SRF choices where a parameter is equal$SEP$# set ncoefs to the maximum number within the choices$SEP$# with equal a-parameter$SEP$# loop over phase-functions with equal a-parameter$SEP$# set parameters based on chosen phase-functions and evaluate$SEP$# combined legendre-expansion$SEP$# combine legendre-expansions for each a-parameter based on given$SEP$# combined legendre-coefficients$SEP$# set parameters based on chosen classes to define analytic$SEP$# function representation