ReflectX
Submodules
Functions
|
|
|
Simple function to create a wavelength grid defined with a constant R. |
|
Rebin the spectrum. Adapted from PICASO mean_regrid function |
Load XArray of filter transmission profiles |
|
|
Scale star and planet flux arrays from surface to flux arriving at Earth |
|
Compute the average flux in a filter by multiplying the spectrum by the filter transmission curve |
|
The SDSS system uses AB mags not Vega mags. To convert Vega mags to AB mag, add this |
|
For a given stellar spectrum in a specific filter, return the Vega magnitude of the star in |
|
Package Contents
- ReflectX.LoadModel(path, Teff, Planet, CtoO, teq=None, phase=None, clouds=None)
- Parameters:
path (str) – Path to location of Teffs folders containing models
Teff (int) – Star effective temperature, must be 3000, 3500, 4000, 5000, or 7000
Planet (str) – Specify planet (see docs for details of each planet type); must be Neptune, SuperNeptune, Saturn, Jupiter, or SuperJupiter
CtoO (float) – Planet C/O ratio; must be 0.5, 1.0, or 1.5
teq (int) – Planet equilibrium temperature; must be 75, 100, 150, 180, 200, 250, 300, or 500
phase (int) – Planet viewing phase in degrees; must be 0, 45, 90, 120, or 140
clouds (dict) – Dictionary of cloud properties, must contain keys fsed and kzz; fsed must be 0.1, 0.5, 1, 3, 6, 0r 10; kzz must be 1e9 or 1e11
- Returns:
entire model set as a dictionary or single spectrum as an XArray
- Return type:
dict or XArray
- ReflectX.CreateGrid(min_wavelength, max_wavelength, constant_R)
Simple function to create a wavelength grid defined with a constant R. Adapted from PICASO create_grid function https://github.com/natashabatalha/picaso/blob/defc72955ad468496a814c1300e0f57244a75cd6/picaso/opacity_factory.py#L667C1-L694C27
- ReflectX.MeanRegrid(x, y, newx=None, R=None)
Rebin the spectrum. Adapted from PICASO mean_regrid function https://github.com/natashabatalha/picaso/blob/defc72955ad468496a814c1300e0f57244a75cd6/picaso/justplotit.py#L31C1-L63C19
- Parameters:
x (arr) – wavelength array to be rebinned
y (arr) – flux values to map to new wavelength grid
newx (arr) – new wavelength array to map flux onto, required if R = None
R (int) – desired R to construct new wavelength array to map flux onto, required if newx = None
- Returns:
tuple containing
newx (arr): new wavelength array
newy (float): new flux array mapped onto new wavelength at desired R
- ReflectX.LoadFilters()
Load XArray of filter transmission profiles
- ReflectX.ScaleModelToStar(model, distance)
Scale star and planet flux arrays from surface to flux arriving at Earth
- Parameters:
model (XArray) – model XArray
distance (float) – distance to star in parsecs
- Returns:
XArray of model with star and planet flux scaled to flux arriving at Earth
- Return type:
XArray
- ReflectX.GetFluxInFilter(wavelength, flux, filterwavelength, filtertransmission)
Compute the average flux in a filter by multiplying the spectrum by the filter transmission curve and dividing by the filter transmission curve
- Parameters:
wavelength (arr) – wavelength array
flux (arr) – flux array
filterwavelength (arr) – filter wavelength array
filtertransmission (arr) – filter transmission curve
- Returns:
weighted average flux in filter
- Return type:
- ReflectX.VegaToAB(filt)
The SDSS system uses AB mags not Vega mags. To convert Vega mags to AB mag, add this value to the Vega mag to convert to AB. These factors = AB - Vega From https://www.astronomy.ohio-state.edu/martini.10/usefuldata.html
- ReflectX.GetMagInFilter(wavelength, flux, filtername=None, filterwavelength=None, filtertransmission=None)
For a given stellar spectrum in a specific filter, return the Vega magnitude of the star in that filter.
- Parameters:
[arr] (spectrum_flux) – spectrum wavelength
[arr] – spectrum flux
object] (filter_lamda0 [astropy unit) – central wavelength of filter. Must include astropy unit Ex: 1.2*u.um
unit] (spectrum_wavelength_unit [astropy) – astropy unit for wavelengths. Ex: u.um
- Returns:
ratio of spectrum to Vega flux in that filter in magnitudes, with correction to AB mags for SDSS filters.
- Return type:
flt
- ReflectX.load_all_groups(filename)