Setting Cloudy predefined abundances and applying scale factors

20 views
Skip to first unread message

Avijit Mandal

unread,
Dec 20, 2023, 2:32:18 AM12/20/23
to pyCloudy
Hi everyone!
I am trying to use GASS10 abundances for one of my input files. I have set this by using set_abun(predef='GASS10') . Now I want to change abundances of certain elements by some scale factors. In Cloudy we usually do it by
element scale factor helium = 1.4
element scale factor carbon = 5.5
element scale factor nitrogen = 2.0
element scale factor oxygen = 0.5
element scale factor neon = 0.96 
How do I obtain this in pyCloudy? 
Any guidance would be greatly appreciated.
Thank You.

Christophe Morisset

unread,
Jan 9, 2024, 11:15:06 AMJan 9
to pyCloudy
Hi,
The best is to define a dictionary containing all the abundances you want, and then change some of them. There are some abundance dictionaries, as well as depletion dictionaries, already defined in pyCloudy, see here: https://github.com/Morisset/pyCloudy/blob/master/pyCloudy/utils/physics.py

You can import one of these dic and modify what you need:

from pyCloudy.utils.physics import abunds_Bressan_2012
import copy

abunds = copy.deepcopy(abunds_Bressan_2012)
abunds['He'] += np.log10(1.4)
abunds['C'] += np.log10(5.5)

...set_abund(ab_dict=abunds)

Hope it helps,
Christophe

Reply all
Reply to author
Forward
0 new messages