Star
¶
- class sed_analysis_tools.sed_analysis_tools.Star(T: ~astropy.units.quantity.Quantity, L: ~astropy.units.quantity.Quantity, frac_err: float | ~numpy.ndarray | list = 0, seed: int = 0, D: ~astropy.units.quantity.Quantity = <Quantity 10. pc>, threshold_ewr: float = 5, filter_set: ~sed_analysis_tools.sed_analysis_tools.FilterSet = <sed_analysis_tools.sed_analysis_tools.FilterSet object>, name: str = '')¶
A class to represent a star with specific physical and observational parameters.
- Parameters:
T (u.Quantity) – Temperature of the star in Kelvin.
L (u.Quantity) – Luminosity of the star in solar luminosities.
frac_err (Union[float, np.ndarray, list], optional) – Fractional error (sigma) in flux. Defaults to 0.
seed (int, optional) – Random seed for reproducibility. Defaults to 0.
D (u.Quantity, optional) – Distance to the star in parsecs. Defaults to 10 pc.
threshold_ewr (float, optional) – Detection threshold for EWR to identify poorly fitting filters (abs(EWR) > threshold_ewr). Defaults to 5.
filter_set (FilterSet, optional) – The filter set used for observations. Defaults to a default FilterSet with pivot wavelengths from 1600 Å to 50000 Å.
name (str, optional) – Name of the star. Defaults to an empty string.
- T¶
Temperature of the star.
- Type:
u.Quantity
- L¶
Luminosity of the star.
- Type:
u.Quantity
- D¶
Distance to the star.
- Type:
u.Quantity
- frac_err¶
Fractional error in flux.
- Type:
Union[float, np.ndarray, list]
- seed¶
Random seed for reproducibility.
- Type:
int
- threshold_ewr¶
Detection threshold for EWR.
- Type:
float
- x¶
Logarithmic wavelengths in Angstroms for the spectrum/SED, based on the filter set’s pivot wavelengths.
- Type:
np.ndarray
- name¶
Name of the star.
- Type:
str
- R¶
Radius of the star calculated from its temperature and luminosity.
- Type:
u.Quantity
- sf¶
Scale factor of the star’s flux based on its radius and distance.
- Type:
u.Quantity
- logT¶
Logarithm (base 10) of the star’s temperature.
- Type:
float
- logL¶
Logarithm (base 10) of the star’s luminosity.
- Type:
float
- logsf¶
Logarithm (base 10) of the star’s scale factor.
- Type:
float
- estimate_errors(niter: int = 100, verbose: bool = True) None ¶
Estimate the fitting errors using Monte Carlo simulations.
- Parameters:
niter (int, optional) – Number of iterations for error estimation. Defaults to 100.
verbose (bool, optional) – If True, prints summary details. Defaults to True.
- fit_bb_Double(**kwargs) None ¶
Fit a double blackbody model to the star’s spectrum.
- Parameters:
**kwargs – Additional keyword arguments passed to the fitting function.
- fit_bb_Single(use_priors: bool = False, **kwargs) None ¶
Fit a single blackbody model to the star’s spectrum.
- Parameters:
use_priors (bool, optional) – If True, use prior values for fitting. Defaults to False.
**kwargs – Additional keyword arguments passed to the fitting function.
- get_spectrum() None ¶
Generate the spectrum of the star and create a Spectrum object.
- plot(**kwargs) None ¶
Plot the original spectrum of the star.
- Parameters:
**kwargs – Additional keyword arguments passed to the plotting function.
- plot_estimated_errors(ax=None, plot_name: str = None) None ¶
Plot estimated errors on the Hertzsprung-Russell diagram.
- Parameters:
ax (plt.Axes, optional) – Matplotlib axis to plot on. If None, a new figure is created.
plot_name (str, optional) – Path to save the plot. If None, the plot is not saved. Defaults to None.
- plot_fitted(mode: str, axes=None, plot_name: str = None) None ¶
Plot the fitted spectrum.
- Parameters:
mode (str) – Mode for plotting.
axes (plt.Axes, optional) – Matplotlib axes to plot on. Defaults to None.
plot_name (str, optional) – Path to save the plot. If None, the plot is not saved. Defaults to None.