CoolDwarf.model.mesa package

Submodules

CoolDwarf.model.mesa.mesa module

mesa.py – MESA MOD file parser

This module contains a function to parse MESA MOD files. The function reads the file and extracts the metadata and data sections. Due to the format of the MESA MOD files, the metadata section is read line by line, while the data section is read as a fixed-width file. The data is then stored in a pandas DataFrame. Finally, because MESA uses D instead of E for scientific notation, the function replaces D with E in the data section.

Dependencies

  • pandas

Example usage

>>> from CoolDwarf.model.mesa.mesa import parse_mesa_MOD_file
>>> df = parse_mesa_MOD_file("path/to/mod/file")
>>> print(df)
CoolDwarf.model.mesa.mesa.parse_mesa_MOD_file(filepath: str) DataFrame

This function reads a MESA MOD file and extracts the metadata and data sections. The data is then stored in a pandas DataFrame.

Parameters:
filepathstr

Path to the MESA MOD file

Returns:
dfpd.DataFrame

DataFrame containing the data from the MESA MOD file

Module contents