Utils

Utility functions used by other modules.

tomso.utils.integrate(y, x)[source]

Integral of y over x, computed using the trapezoidal rule. i.e. \int _{x[0]} ^x y(x') dx'.

tomso.utils.complement(y, x)[source]

Complement of integral of y over x, computed using the trapezoidal rule. i.e. \int _x^{x[-1]}y(x') dx'.

tomso.utils.tomso_open(filename, *args, **kwargs)[source]

Wrapper function to open files ending with .gz with built-in gzip module or paths starting with http using urllib.request.urlopen, otherwise use normal open. .gz and normal modes take the same arguments as open and gzip.open and return a file object.

tomso.utils.load_mesa_gyre(filename, mesa_or_gyre)[source]

Most MESA and GYRE output files both adhere to a similar columned ASCII format, so it makes more sense to have one implementation for reading them, rather than re-implementing it in each submodule.

tomso.utils.get_Teff(L, R)[source]

Determine the effective temperature Teff for a given luminosity L and radius R, both in cgs units.

class tomso.utils.AdiabaticStellarModel[source]

Base stellar model class that defines properties that are computed the same way in all stellar model formats for which only adiabatic frequencies can be calculated.

class tomso.utils.FullStellarModel[source]

Base stellar model class that defines properties that are computed the same way in all stellar model formats for which both adiabatic and non-adiabatic frequencies can be calculated.