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.
This attribute quantifies only the metallicity of gas inflow in excess
of that which is produced by the big bang. For example, even when this
attribute is set to 0 for helium, its abundance by mass in accreting
gas will still be given by vice.primordial["he"]
. If the element in
question was not produced during big bang nucleosynthesis (i.e.
vice.primordial["x"] = 0
for some element “x”), then the same
numerical solution applies and this attribute quantifies the total
abundance by mass in the inflow.
New in version 1.3.1: In previous versions, the primordial abundance by mass of each element was included in the numerical calculation of the inflow metallicity but was not recorded in the output. That is, an inflow metallicity of zero for helium meant that its abundance in infalling gas was exactly the primordial abundance. With this patch, this book-keeping is adjusted to account for this, and outputs will reflect a non-zero abundance in primordial gas.
Tip
The easiest way to switch this attribute to a dataframe is by
passing an empty python dictionary {}
.
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
}