pysep.opac.opal package

Submodules

pysep.opac.opal.utils module

Author: Thomas M. Boudreaux

Created: December 2020

Last Modified: May 2021

This module provides helper utilities for reading and parsing opal formated opacity files.

pysep.opac.opal.utils.load_opac(path: str) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]

Load both the opacity table as well as the LogR and LogT for each table. LogT and LogR are not actually taken from the table; rather, they are assumed to be the correct LogT and LogR and are simply constructed from the general LogR and LogT constuctors already present in pysep.

Parameters

path (str) – path to opacity table to load.

Returns

  • LogT (np.ndarray(dtype=’float64’)) – Numpy array of shape (70,) with each required LogT value in it.

  • LogR (np.ndarray(dtype=’float64’)) – Numpy array of shape (19,) wich each required LogR value in it.

  • p (np.ndarray(dtype=’float64’)) – array of shape (126, 70, 19) where the first axis is the composition axis for the 126 compositions which dsep expects, the second is the temperature axis, and the third is the R axis.

pysep.opac.opal.utils.parse_DSEP_opacity_table(path: str) numpy.ndarray

Parse the 126 tables out of a properly formated opacity table which dsep can understand. This idetifies all lines starting with Table # after the summary section and uses those to index where the tables begin. Given that dsep opacity tables are not square and that numpy can only handel rectangular data all rows are padded to the length of the longest row with np.nan. Therefore, nan(s) should be interprited as locations where the opacity table was undefined.

Parameters

path (str) – path to opacity table

Returns

p – array of shape (126, 70, 19) where the first axis is the composition axis for the 126 compositions which dsep expects, the second is the temperature axis, and the third is the R axis.

Return type

np.ndarray

Module contents

Module for dealing with opal format opacities, this is the format which dsep expects.