snf_simulations.data.fispin#
Module for loading FISPIN .tbQ output files.
Module Contents#
Functions#
Convert a simulation time string from the .tbQ file into years. |
|
Get the isotope masses from a FISPIN .tbQ output file. |
|
Load in a FISPIN .tbQ output file and extract the data. |
Data#
API#
- snf_simulations.data.fispin._UNITS_TO_YEARS#
None
- snf_simulations.data.fispin._convert_sim_time_to_years(time_str: str) float[source]#
Convert a simulation time string from the .tbQ file into years.
- snf_simulations.data.fispin.get_isotope_masses(filepath: str | pathlib.Path, time_str: str | None = None) tuple[dict[str, float], float][source]#
Get the isotope masses from a FISPIN .tbQ output file.
- Parameters:
filepath – Path to the file to load.
time_str – Specific simulation time to extract data for. If None, uses the earliest time in the file. Will raise an error if the specified string is not found in the file.
- Returns:
Dictionary of isotope masses at the specified time, where keys are isotope names and values are the mass of each isotope in kg, e.g. {“Sr90”: 5.356e-4, “Y90”: 1.3922e-7, …}. cooling_time: The cooling time in years that the masses correspond to, converted from the file time units.
- Return type:
isotope_masses
- snf_simulations.data.fispin.load_tabqfile(filepath_or_contents: str | pathlib.Path) dict[str, pandas.DataFrame][source]#
Load in a FISPIN .tbQ output file and extract the data.
- Parameters:
filepath_or_contents – Path to the file to load,
string. (or the contents of the file as a)
- Returns:
Dictionary of pandas dataframes containing the isotope data, for each time step in the file. Keys are the simulation time string values from the file, e.g. “6.000E+01 MINS” or “2.800E+01 DAYS”.