POSEIDON.stellar

Stellar spectra and star spot/faculae contamination calculations.

Module Contents

Functions

planck_lambda(T, wl)

Compute the Planck function spectral radiance.

load_stellar_pysynphot(wl_out, T_eff, Met, log_g[, ...])

Load a stellar model using pysynphot. Pynshot's ICAT function handles

open_pymsg_grid(stellar_grid)

Check if pymsg is installed, then opens the HDF5 file for the grid.

load_stellar_pymsg(wl_out, specgrid, T_eff, Met, log_g)

Load a stellar model using PyMSG. The MSG package

precompute_stellar_spectra(wl_out, star, prior_types, ...)

Precompute a grid of stellar spectra across a range of T_eff and log g.

precompute_stellar_spectra_OLD(wl_out, star, ...[, ...])

Precompute a grid of stellar spectra across a range of T_eff and log g.

stellar_contamination_single_spot(f, I_het, I_phot)

Computes the multiplicative stellar contamination factor for a transmission

stellar_contamination_general(f_het, I_het, I_phot)

Computes the multiplicative stellar contamination factor for a transmission

stellar_contamination(star, wl_out)

Computes the multiplicative stellar contamination factor for a transmission

Attributes

pymsg

POSEIDON.stellar.pymsg
POSEIDON.stellar.planck_lambda(T, wl)

Compute the Planck function spectral radiance.

Parameters:
  • T (float) – Effective temperature of star (K).

  • wl (np.array of float) – Wavelength grid (μm).

Returns:

Planck function spectral radiance in SI units (W/m^2/sr/m).

Return type:

B_lambda (np.array of float)

POSEIDON.stellar.load_stellar_pysynphot(wl_out, T_eff, Met, log_g, stellar_grid='cbk04')

Load a stellar model using pysynphot. Pynshot’s ICAT function handles interpolation within the model grid to the specified stellar parameters.

Note: Pysynphot’s PHOENIX model grids have some bugs for non-solar

metallicity. So we default to the Castelli-Kurucz 2004 grids.

Parameters:
  • wl_out (np.array of float) – Wavelength grid on which to output the stellar spectra (μm).

  • T_eff (float) – Effective temperature of star (K).

  • Met (float) – Stellar metallicity [log10(Fe/H_star / Fe/H_solar)].

  • log_g (float) – Stellar log surface gravity (log10(cm/s^2) by convention).

  • stellar_grid (str) – Desired stellar model grid (Options: cbk04 / phoenix).

Returns:

Stellar specific intensity spectrum in SI units (W/m^2/sr/m).

Return type:

I_out (np.array of float)

POSEIDON.stellar.open_pymsg_grid(stellar_grid)

Check if pymsg is installed, then opens the HDF5 file for the grid.

Parameters:

stellar_grid (string) –

Stellar model grid to use if ‘stellar_spectrum’ is True. (Options: blackbody / cbk04 [for pysynphot] / phoenix [for pysynphot] /

Goettingen-HiRes [for pymsg]).

Returns:

Stellar grid object in pymsg format.

Return type:

specgrid (pymsg object)

POSEIDON.stellar.load_stellar_pymsg(wl_out, specgrid, T_eff, Met, log_g)

Load a stellar model using PyMSG. The MSG package (https://msg.readthedocs.io/en/stable/index.html) handles interpolation within the model grid to the specified stellar parameters.

Parameters:
  • wl_out (np.array of float) – Wavelength grid on which to output the stellar spectra (μm).

  • specgrid (pymsg object) – Stellar grid object in pymsg format.

  • T_eff (float) – Effective temperature of star (K).

  • Met (float) – Stellar metallicity [log10(Fe/H_star / Fe/H_solar)].

  • log_g (float) – Stellar log surface gravity (log10(cm/s^2) by convention).

Returns:

Stellar specific intensity spectrum in SI units (W/m^2/sr/m).

Return type:

I_grid (np.array of float)

POSEIDON.stellar.precompute_stellar_spectra(wl_out, star, prior_types, prior_ranges, stellar_contam, T_step_interp=20, log_g_step_interp=0.1, interp_backend='pysynphot', comm=MPI.COMM_WORLD)

Precompute a grid of stellar spectra across a range of T_eff and log g.

Parameters:
  • wl_out (np.array of float) – Wavelength grid on which to output the stellar spectra (μm).

  • star (dict) – Collection of stellar properties used by POSEIDON.

  • prior_types (dict) – User-provided dictionary containing the prior type for each free parameter in the retrieval model.

  • prior_ranges (dict) – User-provided dictionary containing numbers defining the prior range for each free parameter in the retrieval model.

  • stellar_contam (str) – Chosen prescription for modelling unocculted stellar contamination (Options: one_spot / one_spot_free_log_g / two_spots).

  • stellar_grid (str) – Desired stellar model grid (Options: cbk04 / phoenix).

  • T_step_interp (float) – Temperature step for stellar grid interpolation (uniform priors only).

  • log_g_step_interp (float) – log g step for stellar grid interpolation (uniform priors only).

  • interp_backend (str) – Stellar grid interpolation package for POSEIDON to use. (Options: pysynphot / pymsg).

  • comm (MPI communicator) – Communicator used to allocate shared memory on multiple cores.

Returns:

Photosphere temperatures corresponding to computed stellar spectra (K). T_het_grid (np.array of float):

Heterogeneity temperatures corresponding to computed stellar spectra (K).

log_g_phot_grid (np.array of float):

Photosphere log g corresponding to computed stellar spectra (log10(cm/s^2)).

log_g_het_grid (np.array of float):

Heterogeneity log g corresponding to computed stellar spectra (log10(cm/s^2)).

I_phot_out (3D np.array of float):

Stellar photosphere intensity as a function of T_phot, log_g_phot, and wl (W/m^2/sr/m).

I_het_out (3D np.array of float):

Stellar heterogeneity intensity as a function of T_het, log_g_het, and wl (W/m^2/sr/m).

Return type:

T_phot_grid (np.array of float)

POSEIDON.stellar.precompute_stellar_spectra_OLD(wl_out, star, prior_types, prior_ranges, stellar_contam, T_step_interp=20, log_g_step_interp=0.1, interp_backend='pysynphot')

Precompute a grid of stellar spectra across a range of T_eff and log g.

Parameters:
  • wl_out (np.array of float) – Wavelength grid on which to output the stellar spectra (μm).

  • star (dict) – Collection of stellar properties used by POSEIDON.

  • prior_types (dict) – User-provided dictionary containing the prior type for each free parameter in the retrieval model.

  • prior_ranges (dict) – User-provided dictionary containing numbers defining the prior range for each free parameter in the retrieval model.

  • stellar_contam (str) – Chosen prescription for modelling unocculted stellar contamination (Options: one_spot / one_spot_free_log_g / two_spots).

  • stellar_grid (str) – Desired stellar model grid (Options: cbk04 / phoenix).

  • T_step_interp (float) – Temperature step for stellar grid interpolation (uniform priors only).

  • log_g_step_interp (float) – log g step for stellar grid interpolation (uniform priors only).

  • interp_backend (str) – Stellar grid interpolation package for POSEIDON to use. (Options: pysynphot / pymsg).

Returns:

Photosphere temperatures corresponding to computed stellar spectra (K). T_het_grid (np.array of float):

Heterogeneity temperatures corresponding to computed stellar spectra (K).

log_g_phot_grid (np.array of float):

Photosphere log g corresponding to computed stellar spectra (log10(cm/s^2)).

log_g_het_grid (np.array of float):

Heterogeneity log g corresponding to computed stellar spectra (log10(cm/s^2)).

I_phot_out (3D np.array of float):

Stellar photosphere intensity as a function of T_phot, log_g_phot, and wl (W/m^2/sr/m).

I_het_out (3D np.array of float):

Stellar heterogeneity intensity as a function of T_het, log_g_het, and wl (W/m^2/sr/m).

Return type:

T_phot_grid (np.array of float)

POSEIDON.stellar.stellar_contamination_single_spot(f, I_het, I_phot)

Computes the multiplicative stellar contamination factor for a transmission spectrum due to an unocculted starspot or facular region. The prescription used is as in Rackham+(2017,2018).

Parameters:
  • f (float) – Fraction of the stellar surface covered by the heterogeneity.

  • I_het (np.array of float) – Stellar heterogeneity intensity as a function of wl (W/m^2/sr/m).

  • I_phot (np.array of float) – Stellar photosphere intensity as a function of wl (W/m^2/sr/m).

Returns:

Stellar contamination factor as a function of wl.

Return type:

epsilon (np.array of float)

POSEIDON.stellar.stellar_contamination_general(f_het, I_het, I_phot)

Computes the multiplicative stellar contamination factor for a transmission spectrum due to a collection of unocculted starspot or facular regions, each of which may have their own coverage fraction and specific intensity.

Parameters:
  • f_het (np.array of float) – Fraction of the stellar surface covered each heterogeneity.

  • I_het (2D np.array of float) – Stellar heterogeneity intensity as a function of region and wl (W/m^2/sr/m).

  • I_phot (np.array of float) – Stellar photosphere intensity as a function of wl (W/m^2/sr/m).

Returns:

Stellar contamination factor as a function of wl.

Return type:

epsilon (np.array of float)

POSEIDON.stellar.stellar_contamination(star, wl_out)

Computes the multiplicative stellar contamination factor for a transmission spectrum due to an unocculted starspot or facular region. The prescription used is as in Rackham+(2017,2018).

This function unpacks the required stellar properties from POSEIDON’s ‘star’ object, interpolates the stellar intensities to the output wavelength grid, then computes the stellar contamination for a single heterogeneous region.

Note: this function is only used for forward models, since for retrievals

the wavelength interpolation is handled by another function called ‘precompute_stellar_spectra’.

Parameters:
  • star (dict) – Collection of stellar properties used by POSEIDON.

  • wl_out (np.array of float) – Wavelength grid on which to output the stellar spectra (μm).

Returns:

Stellar contamination factor as a function of wl.

Return type:

epsilon (np.array of float)