vice.singlezone.func¶
Type : <function>
Default : vice._globals._DEFAULT_FUNC_
A callable object which must accept time in Gyr as the only parameter.
The value returned by this function will represent either the gas
infall history in \(M_\odot\ yr^{-1}\) (mode
== “ifr”), the
star formation history in \(M_\odot\ yr^{-1}\) (mode
== “sfr”),
or the ISM gas supply in \(M_\odot\) (mode
== “gas).
Note
The default function returns the value of 9.1 always. With a
default mode
of “ifr”, this corresponds to an infall rate of
9.1 \(M_\odot\ yr^{-1}\) at all times.
Note
Saving this functional attribute with VICE outputs requires the
package dill, an extension to pickle
in the Python standard
library. It is recommended that VICE user’s install dill
>= 0.2.0.
Note
This attribute will always be expected to accept time in Gyr as the only parameter. However, infall and star formation rates will be interpreted as having units of \(M_\odot\ yr^{-1}\) according to convention.
See also
vice.singlezone.mode
Example Code¶
>>> import math as m
>>> import vice
>>> sz = vice.singlezone(name = "example")
>>> def f(t):
if t <= 1:
return 10
else:
return 10 * m.exp(-(t - 1) / 3)
>>> sz.func = f
>>> sz.func = lambda t: 10. * m.exp(-t / 3)