exosim.tasks.sed.loadPhoenix#

Classes#

LoadPhoenix

Loads a star SED from a grid of Phoenix spectra or from a specific Phoenix file.

Module Contents#

class LoadPhoenix[source]#

Bases: exosim.tasks.task.Task

Loads a star SED from a grid of Phoenix spectra or from a specific Phoenix file.

Returns:

Star Sed

Return type:

Sed

Examples

>>> from exosim.tasks.sed import LoadPhoenix
>>> loadPhoenix = LoadPhoenix()

Prepare the star

>>> from astropy import constants as cc
>>> import astropy.units as u
>>> import numpy as np
>>> D= 12.975 * u.pc
>>> T= 3016 * u.K
>>> M= 0.15 * u.Msun
>>> R= 0.218 * u.Rsun
>>> z= 0.0
>>> g = (cc.G * M.si / R.si ** 2).to(u.cm / u.s ** 2)
>>> logg = np.log10(g.value)

Load the sed from a directory

>>> sed = loadPhoenix(path = phoenix_directory,  T=T, D=D, R=R, z=z, logg=logg)

or load the sed from a file

>>> sed = loadPhoenix(filename = phoenix_file, D=D, R=R)

Notes

This class can either load the SED from a file or select the most suitable file from the Phoenix spectra path, given the proper information on the star. In the former case the filename keyword is needed, in the latter are required the keywords path, T, z, logg. Not providing the right keywords would result in an error.

Raises:
  • InputError – if neither filename or path are given.

  • KeyError – if a needed parameter is missing in the user inputs.

execute()[source]#

Class execution. It runs on call and executes all the task actions returning the outputs. It requires the input with correct keywords

load(ph_file)[source]#

Returs a sed given a Phoenix filename :param ph_file: filename :type ph_file: str

Returns:

Star Sed

Return type:

Sed

get_phoenix_model_filename(path, T, logg, z)[source]#

It returns the name of the phoenix file that best matches the input star parameters.

Parameters:
  • path (str) – Phoenix directory path

  • T (Quantity) – star temperature

  • logg (float) – star logG

  • z (float) – star metallicity

Returns:

Phoenix file name

Return type:

str