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. .
-
tomso.utils.
complement
(y, x)[source]¶ Complement of integral of y over x, computed using the trapezoidal rule. i.e. .
-
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.