def absorption_matrix(self, frequency, eps_1, mu1, npol, compute_coherent_only):
if self.specular_reflection is None and self.backscatter_coefficient is None:
self.specular_reflection = 1
if npol > 2:
raise NotImplementedError("active model is not yet implemented, need modification for the third compunant")
if isinstance(self.specular_reflection, dict): # we have a dictionary with polarization
abs_coeff = np.empty(npol*len(mu1))
abs_coeff[0::npol] = 1 - self._get_refl(self.specular_reflection['V'], mu1)
abs_coeff[1::npol] = 1 - self._get_refl(self.specular_reflection['H'], mu1)
else: # we have a scalar, both polarization are the same
abs_coeff = 1 - np.repeat(self._get_refl(self.specular_reflection, mu1), npol)
return scipy.sparse.diags(abs_coeff, 0)
评论列表
文章目录