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

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
}