pysep.io.iso package

Submodules

pysep.io.iso.read module

Author: Thomas M. Boudreaux Created: February 2021 Last Modified: March 2021

Module for reading one or many iso files

Functions

read_iso(str) -> Tuple[pandas.DataFrame, dict]

read a dsep iso file into a pandas dataframe and extract the meta data from the header of that iso file.

load_iso_models(str) -> Tuple[List[pandas.DataFrame], list[dict]]

read all .iso files in a directory and load their dataframes and metadata into two lists

pysep.io.iso.read.load_iso_models(path: str)

Sometimes you have a path with many iso files and it would just be helpful to quickly read in all of them. Thats what load_iso_models does. Given some path with a minimum of 1 iso file this function wll load all iso files contents and meta data into two lists of length n where n is the number of iso files total.

Parameters

path (str) – path to directory which contains iso files

Returns

  • isos (list of pandas.DataFrames) – list of dataframes, one data frame for every iso file in path

  • metas (list of dicts) – list of meta data (M, X, Z). One meta data dictionary for every iso file in path

pysep.io.iso.read.read_iso(path: str) Tuple[pandas.core.frame.DataFrame, dict]

Parse a dsep iso file into a pandas dataframe and a dictionary of its metadata. The metadata is parsed from the first line of the iso file and includes the mass in solar masses, hydrogen mass fracion, and metal mass fraction. These are indexed in the meta dictionary (returned as the second element of the tuple) as ‘M’, ‘X’, and ‘Z’ respectivly.

Parameters

path (str) – path to iso file to load

Returns

  • iso (pandas.DataFrame) – Dataframe including all the information loaded from the iso file

  • metadata (dict) – Dictionary containing the stellar mass in solar mass units, hydrogen mass fraction, and metal mass fraction. These are indexed as ‘M’, ‘X’, and ‘Z’ respectivly.

Module contents

Submodule for handeling dsep iso modules. This includes reading a single iso file and reading a directory full of iso files