CloudyInput.set_star: use of lumi_unit and lumi_value

131 views
Skip to first unread message

Nell Byler

unread,
Dec 4, 2013, 1:41:58 PM12/4/13
to pycl...@googlegroups.com
1. Luminosity case, setting incident radiation field with Q and R_inner
c_input = pc.CloudyInput('/folder/model_name_Q')
c_input.set_star(SED = 'table star "user_defined_grid.mod" ', SED_params = 'age=3e6 zmet=1', lumi_unit = 'Q(H)', lumi_value = '46.547')

2. Intensity case, setting incident radiation field with U, the ionization parameter and also setting R_inner
c_input = pc.CloudyInput('/folder/model_name_U')
c_input.set_star(SED = 'table star "user_defined_grid.mod" ', SED_params = 'age=3e6 zmet=1', lumi_unit = 'ionization parameter', lumi_value = '0.512')

Keeping all other input parameters the same (i.e. constant density at 30 cm^-3, setting inner radius to 0.01 pc, spherical geometry, etc.) produces different pyCloudy model objects despite the fact that cloudy itself behaves the same (in terms of exact same output emission line spectrum - the only difference is how I've set the strength of the incident radiation field).


model_Q = pc.CloudyModel('/folder/model_name_Q')
model_U = pc.CloudyModel('/folder/model_name_U')

model_Q.print_stats()
......
......
.....
<log U> = -3.08

model_U.print_stats()
.....
.....
.....
warng CloudyModel: No U computed

mod_Q.log_U and mod_Q.log_U_mean are defined, but mod_U.log_U and mod_U.log_U_mean are not.

Just wondering if I am missing something about how to input U vs Q.....maybe this is just an oversight - R_inner and nH are defined in both, and it would be a trivial calculation (especially since Phi is defined in the U case). I ask because it is useful if one has been using U to define their models but would like to know / calculate the stromgren radius.

I've been using cloudy for a while but I've only just started to explore pyCloudy- it seems like an extremely useful tool, so thanks for all your work!

Christophe Morisset

unread,
Dec 4, 2013, 5:32:17 PM12/4/13
to pycl...@googlegroups.com
You're totally right, that's a bug. 
U was computed as Q0/4.pi.r**2.nH.c. When the luminosity is defined using Phi (as in ionization parameter), Q0 is unknown and logU also.
I changed this so that Phi is always defined, and U is obtained as Phi0 * (r0/r)**2 / (nH c).
I just uploaded a new version of pyCloudy: 0.8.34 with this bug corrected.
Thanks a lot for the feedback, hope you will enjoy pyCloudy.
Christophe
Reply all
Reply to author
Forward
0 new messages