vice.mdf

Obtain a fromfile object from a VICE output containing the metallicity distribution function of stars.

Signature: vice.mdf(name)

Parameters

namestr

The full or relative path to the output directory. The ‘.vice’ extension is not required.

Returns

mdffromfile [VICE dataframe derived class]

A subclass of the VICE dataframe designed to handle simulation output.

Raises

  • IOError [Only occurs if the output has been altered]
    • The output file is not found.

    • The output file is not formatted correctly.

    • Other VICE output files are missing from the output.

Notes

VICE normalizes metallicity distribution functions to a probability density, meaning that the area under the distribution is always equal to one. The value of the distribution in some bin times that bin’s width denotes the fraction of stars with metallicities in that bin.

Note

For abundances [X/H] and abundance ratios [X/Y] that in the simulation never achieve a value in the user-specified binspace, the distribution will be NaN in all bins.

Note

For an output under a given name, the metallicity distribution function is stored in an ascii text file under name.vice/mdf.out. This allows users to open these files without VICE if necessary.

See also

vice.core.dataframe.fromfile

Example Code

>>> import vice
>>> example = vice.mdf("example")
>>> example.keys()
        [“dn/d[sr/h],”,
        “dn/d[sr/fe],”
        “bin_edge_left,”
        “dn/d[o/h],”
        “dn/d[o/fe],”
        “dn/d[fe/h],”
        “bin_edge_right,”
        “dn/d[o/sr]”]
>>> example["bin_edge_left"][:10]
        [-3.0, -2.95, -2.9, -2.85, -2.8, -2.75, -2.7, -2.65, -2.6, -2.55]
>>> example[60]
        vice.dataframe{
                bin_edge_left --> 0.0
                bin_edge_right -> 0.05
                dn/d[fe/h] -----> 0.0
                dn/d[sr/h] -----> 0.0
                dn/d[o/h] ------> 0.0
                dn/d[sr/fe] ----> 0.06001488
                dn/d[o/fe] -----> 0.4337209
                dn/d[o/sr] -----> 0.0
        }