def sutherland_gaunt_factor(self, wavelength):
"""
Calculates the free-free gaunt factor calculations of [1]_.
The Gaunt factors of [1]_ are read in using `ChiantiPy.tools.io.gffRead`
as a function of :math:`u` and :math:`\gamma^2`. The data are interpolated
to the appropriate wavelength and temperature values using
`~scipy.ndimage.map_coordinates`.
References
----------
.. [1] Sutherland, R. S., 1998, MNRAS, `300, 321 <http://adsabs.harvard.edu/abs/1998MNRAS.300..321S>`_
"""
# calculate scaled quantities
lower_u = ch_const.planck*(1.e8*ch_const.light)/ch_const.boltzmann/np.outer(self.Temperature,wavelength)
gamma_squared = (self.Z**2)*ch_const.ryd2erg/ch_const.boltzmann/self.Temperature[:,np.newaxis]*np.ones(lower_u.shape)
# convert to index coordinates
i_lower_u = (np.log10(lower_u) + 4.)*10.
i_gamma_squared = (np.log10(gamma_squared) + 4.)*5.
# read in sutherland data
gf_sutherland_data = ch_io.gffRead()
# interpolate data to scaled quantities
gf_sutherland = map_coordinates(gf_sutherland_data['gff'],
[i_gamma_squared.flatten(), i_lower_u.flatten()]).reshape(lower_u.shape)
return np.where(gf_sutherland < 0., 0., gf_sutherland)
评论列表
文章目录