chianti.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:synthesizAR 作者: wtbarnes 项目源码 文件源码
def emissivity(self, density: u.cm**(-3), include_energy=False, **kwargs):
        """
        Calculate emissivity for all lines as a function of temperature and density
        """
        populations = self.level_populations(density, include_protons=kwargs.get('include_protons', True))
        if populations is None:
            return (None, None)
        wavelengths = np.fabs(self._wgfa['wavelength'])
        # Exclude 0 wavelengths which correspond to two-photon decays
        upper_levels = self._wgfa['upper_level'][wavelengths != 0*u.angstrom]
        a_values = self._wgfa['A'][wavelengths != 0*u.angstrom]
        wavelengths = wavelengths[wavelengths != 0*u.angstrom]
        if include_energy:
            energy = const.h.cgs*const.c.cgs/wavelengths.to(u.cm)
        else:
            energy = 1.*u.photon
        emissivity = populations[:, :, upper_levels - 1]*(a_values*energy)

        return wavelengths, emissivity
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号