{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "# How to Store Simulations to HDF\n", "\n", "You can ask TARDIS to store the state of each iteration of the simulation you are running. We show examples of how this is done:" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Initialize the simulation with the `tardis_example.yml` configuration file." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from tardis import run_tardis\n", "from tardis.io.atom_data import download_atom_data\n", "\n", "# We download the atomic data needed to run the simulation\n", "download_atom_data('kurucz_cd23_chianti_H_He')\n", "\n", "# We run the simulation\n", "simulation = run_tardis('tardis_example.yml')" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "You can now use the `to_hdf` method, to save properties to a HDF file.\n", "\n", "#### Parameters \n", "\n", "`file_path`: Path where the HDF file should be stored. (Required) \n", "`path`: Path inside the HDF store to store the elements. (Optional) \n", "`name`: Name of the group inside HDF store, under which properties will be saved.(Optional)\n", "`overwrite`: If the HDF file already exists, do you overwrite the existing file (Optional, default `False`)\n", "\n", "