vice.mirror

[DEPRECATED]

Obtain an instance of the vice.singlezone class given only an instance of the vice.output class or the path to the output. The returned object will have the same parameters as that which produced the output, allowing re-simulation with whatever modifications the user desires.

Signature: vice.mirror(arg)

Deprecated since version 1.1.0: Users should instead call vice.singlezone.from_output to achieve this functionality.

Parameters

argstr or output

Either the path to the output (type str) or the output object itself.

Returns

objsinglezone

A new singlezone object, with the same parameters as that which produced the output.

Raises

  • ImportError
    • The output has encoded functional attributes and the user does not have dill installed.

  • UserWarning
    • The output was produced with functional attributes, but was ran on a system without dill, and they have thus been lost.

Note

Saving and reinstancing functional simulation parameters from VICE outputs requires dill, an extenstion to pickle in the python standard library. It is recommended that VICE users install dill >= 0.2.0.

Example Code

>>> out = vice.output("example")
>>> new = vice.mirror(out)
>>> new
vice.singlezone{
        name -----------> onezonemodel
        func -----------> <function _DEFAULT_FUNC_ at 0x1085a6ae8>
        mode -----------> ifr
        verbose --------> False
        elements -------> ('fe', 'sr', 'o')
        IMF ------------> kroupa
        eta ------------> 2.5
        enhancement ----> 1.0
        Zin ------------> 0.0
        recycling ------> continuous
        delay ----------> 0.15
        RIa ------------> plaw
        Mg0 ------------> 6000000000.0
        smoothing ------> 0.0
        tau_ia ---------> 1.5
        tau_star -------> 2.0
        schmidt --------> False
        schmidt_index --> 0.5
        MgSchmidt ------> 6000000000.0
        dt -------------> 0.01
        m_upper --------> 100.0
        m_lower --------> 0.08
        Z_solar --------> 0.014
        bins -----------> [-3, -2.95, -2.9, ... , 0.9, 0.95, 1]
}
>>> import numpy as np
>>> new.run(np.linspace(0, 10, 1001))