#NEWLINE# def hseq_profile( w , z , temperature , mstar , mu = 2.279 ) : #NEWLINE# #INDENT# '\n    Compute the new (normalized) density profile\n    corresponding to a given temperature profile\n\n    Parameters\n    ----------\n    w : float\n        The cylindrical radius at which to compute the profile (in cm)\n    z : np.ndarray\n        The z coordinates of the cells at radius w (in cm)\n    temperature : np.ndarray\n        The temperatures in the cells (in K)\n    mstar : float\n        The mass of the star (in g)\n    ' #NEWLINE# from hyperion.util.constants import G , m_h , k #NEWLINE# from .. util.integrate import integrate , integrate_subset #NEWLINE# integrand = ( ( z / temperature ) / ( ( ( w ** 2 ) + ( z ** 2 ) ) ** 1.5 ) ) #NEWLINE# i = np . array ( [ integrate_subset ( z , integrand , 0.0 , zmax ) for zmax in z ] ) #NEWLINE# i [ ( z < 0 ) ] = ( - i [ ( z < 0 ) ] ) #NEWLINE# factor = ( ( ( ( G * mstar ) * mu ) * m_h ) / k ) #NEWLINE# density = ( np . exp ( ( ( - i ) * factor ) ) / temperature ) #NEWLINE# density = ( density / integrate ( z , density ) ) #NEWLINE# return density