vice.singlezone.Zin¶
Type : real number, <function>
, or dataframe
Default : 0.0
The metallicity of gas inflow. Numbers and functions apply to all
elements tracked by the simulation. Functions must accept time in Gyr
as the only parameter. A dictionary or a dataframe
can also be
passed, allowing real numbers and functions to be assigned on an
element-by-element basis.
Tip
The easiest way to switch this attribute to a dataframe is by
passing an empty python dictionary {}
.
Note
Inflow masses due to primordial abundances and metal-rich infall are treated independently of one another. For this reason, if a helium-rich infall is required, the difference between the desired helium abundance and the primordial abundance \(\Delta Y\) should be specified as opposed to the total abundance.
Note
Dictionaries will be automatically converted into a dataframe
.
Note
Saving functional attributes 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.
Example Code¶
>>> import vice
>>> sz = vice.singlezone(name = "example")
>>> sz.Zin = 0.001
>>> def f(t):
return 0.001 * (t / 5)
>>> sz.Zin = lambda t: 0.001 * (t / 5)
>>> sz.Zin = {}
>>> sz.Zin
vice.dataframe{
sr -------------> 0.0
fe -------------> 0.0
o --------------> 0.0
}
>>> sz.Zin["o"] = 0.001
>>> sz.Zin["fe"] = lambda t: 1.0e-04 * (t / 5)
>>> sz.Zin
vice.dataframe{
sr -------------> 0.0
fe -------------> <function main.<__lambda__>(t)>
o --------------> 0.001
}