Core#
Enumerations#
Enums used across the package for wavelength units, flux units, observation types, prior types, parameter kinds, and more.
- class ForMoSA.core.enums.WavelengthUnit(*values)[source]#
Bases:
EnumEnumeration of wavelength units used in ForMoSA with accepted aliases
Notes
Authors: Allan Denis
- ANGSTROM = Unit("Angstrom")#
- NANOMETER = Unit("nm")#
- MICROMETER = Unit("um")#
- angstrom = Unit("Angstrom")#
- Angstrom = Unit("Angstrom")#
- AA = Unit("Angstrom")#
- Nanometer = Unit("nm")#
- nanometer = Unit("nm")#
- nm = Unit("nm")#
- Micrometer = Unit("um")#
- micrometer = Unit("um")#
- um = Unit("um")#
- class ForMoSA.core.enums.FluxUnit(*values)[source]#
Bases:
EnumEnumeration of flux units used in ForMoSA
Notes
Authors: Allan Denis
- FLAM = Unit("erg / (Angstrom s cm2)")#
- FNU = Unit("erg / (Hz s cm2)")#
- JY = Unit("Jy")#
- class ForMoSA.core.enums.DataUnit(*values)[source]#
Bases:
EnumEnumeration of data units used in ForMoSA
Notes
Authors: Allan Denis
- COUNTS = 'counts'#
- ELECTRONS = 'electrons'#
- ADU = 'adu'#
- class ForMoSA.core.enums.ObservationType(*values)[source]#
Bases:
EnumEnumeration of observation types used in ForMoSA with accepted aliases
Notes
Authors: Allan Denis
- SPECTROSCOPIC = 'Spectroscopic'#
- PHOTOMETRIC = 'Photometric'#
- spectroscopic = 'Spectroscopic'#
- SPECTRO = 'Spectroscopic'#
- spectro = 'Spectroscopic'#
- photometric = 'Photometric'#
- PHOTO = 'Photometric'#
- photo = 'Photometric'#
- class ForMoSA.core.enums.ObservationKeys(canonical, aliases)[source]#
Bases:
EnumEnumeration of observation keys used in ForMoSA with accepted aliases
Examples
>>> WAVELENGTH = ObservationKeys.WAVELENGTH >>> WAVELENGTH.canonical = "WAVELENGTH" >>> WAVELENGTH.aliases = "WAVE", "WAV", "LAMBDA"
So the user can use “WAVELENGTH”, “WAVE”, “WAV” or “LAMBDA” to call the wavelength array of the observations
Notes
Authors: Allan Denis
- WAVELENGTH = ('WAVELENGTH', ['WAVELENGTH', 'WAVE', 'WAV', 'LAMBDA'])#
- FLUX = ('FLUX', ['FLUX', 'FLX'])#
- ERROR = ('ERROR', ['ERROR', 'ERR', 'SIGMA'])#
- FACILITY = ('FACILITY', ['FACILITY', 'FAC', 'Facility'])#
- INSTRUMENT = ('INSTRUMENT', ['INSTRUMENT', 'INS'])#
- FILTER_ID = ('FILTER_ID', ['FILTER_ID', 'FILTER', 'FILT', 'FILT_ID'])#
- RESOLUTION = ('RESOLUTION', ['RESOLUTION', 'RES'])#
- COVARIANCE = ('COVARIANCE', ['COVARIANCE', 'COV'])#
- TRANSMISSION = ('TRANSMISSION', ['TRANSMISSION', 'TRANSM'])#
- STAR_FLUX = ('STAR_FLUX', ['STAR_FLUX', 'STAR_FLX'])#
- SYSTEMATICS = ('SYSTEMATICS', ['SYSTEMATICS', 'SYS'])#
- WAVELENGTH_UNIT = ('WAVELENGTH_UNIT', ['WAVELENGTH_UNIT', 'UNIT', 'WAVE_UNIT'])#
- FLUX_CONT = ('FLUX_CONT', ['FLUX_CONT'])#
- STAR_FLUX_CONT = ('STAR_FLUX_CONT', ['STAR_FLUX_CONT'])#
- WAVE_CONT = ('WAVE_CONT', ['WAVE_CONT'])#
- RES_CONT = ('RES_CONT', ['RES_CONT'])#
- classmethod validate_photometric(present)[source]#
Method to check that observation keys contains required photometric keys
- Parameters:
- Return type:
- Returns:
list[str] – List of required photometric keys absent
Notes
Authors: Allan Denis
- class ForMoSA.core.enums.PriorType(*values)[source]#
Bases:
EnumEnumeration of prior types used in ForMoSA
Notes
Authors: Allan Denis
- UNIFORM = 'uniform'#
- GAUSSIAN = 'gaussian'#
- LOG_UNIFORM = 'log_uniform'#
- CONSTANT = 'constant'#
- class ForMoSA.core.enums.VsiniFunction(*values)[source]#
Bases:
EnumEnumeration of vsini calculation functions used in ForMoSA
Notes
Authors: Allan Denis
- RotBroad = 'RotBroad'#
- FastRotBroad = 'FastRotBroad'#
- Accurate = 'Accurate'#
- AccurateFast = 'AccurateFast'#
- class ForMoSA.core.enums.ParameterKind(*values)[source]#
Bases:
EnumEnumeration of parameters names used in ForMoSA
Notes
Authors: Allan Denis
- RADIUS = 'r'#
- DISTANCE = 'd'#
- AV = 'av'#
- BB_T = 'bb_T'#
- BB_R = 'bb_R'#
- ALPHA = 'alpha'#
- RV = 'rv'#
- VSINI = 'vsini'#
- LD = 'ld'#
- GRID = 'grid'#
- radius = 'r'#
- R = 'r'#
- r = 'r'#
- distance = 'd'#
- D = 'd'#
- d = 'd'#
- av = 'av'#
- EXTINCTION = 'av'#
- extinction = 'av'#
- bb_T = 'bb_T'#
- bb_R = 'bb_R'#
- alpha = 'alpha'#
- rv = 'rv'#
- vsini = 'vsini'#
- ld = 'ld'#
- grid = 'grid'#
- class ForMoSA.core.enums.LogLikelihoodType(*values)[source]#
Bases:
EnumEnumeration of log-likelihood types used in ForMoSA
Notes
Authors: Allan Denis
- CHI2 = 'chi2'#
- CHI2_COVARIANCE = 'chi2_covariance'#
- CHI2_NOISESCALING = 'chi2_noisescaling'#
- CHI2_NOISESCALING_COVARIANCE = 'chi2_noisescaling_covariance'#
- CCF_ZUCKER = 'CCF_Zucker'#
- CCF_BROGI = 'CCF_Brogi'#
- CCF_CUSTOM = 'CCF_custom'#
Errors#
Logging#
Plot Configuration#
Dataclasses that control the visual style of every plot type produced by ForMoSA (corner, chains, radar, best-fit, etc.).

- ForMoSA.core.config.set_filter_path(path)[source]#
Set the global path used to store photometry filters.
Notes
Authors: Allan Denis
- ForMoSA.core.config.darken_color(color, factor=0.7)[source]#
Darken a matplotlib color.
- Parameters:
- Return type:
- Returns:
str (hex color)
Notes
Authors: Allan Denis
- class ForMoSA.core.config.MainPlotConfig(figsize=(10.0, 7.0), legend_ncol=1, legend_hc_ncol=1, legend_filt_ncol=1, legend_fontsize='small', minor_ticks=True, nb_minor_ticks=5)[source]#
Bases:
objectDataclass to handle main parameters for plotting.
Notes
Authors: Allan Denis
- Parameters:
- class ForMoSA.core.config.ObsPlotConfig(cmap=<factory>, color='#7A1E22', edgecolor=None, norm=<factory>, marker='s', markersize=40, linewidth=1, errorbar_fmt='None', errorbar_alpha=1.0, errorbar_capsize=4.0, zorder_data=3, zorder_error=1, label=True)[source]#
Bases:
objectDataclass to handle configurations for plotting data.
Notes
Authors: Allan Denis
- Parameters:
- class ForMoSA.core.config.SpectralPlotConfig(cmap=<factory>, color='#7A1E22', edgecolor=None, norm=<factory>, marker='None', markersize=40, linewidth=1, errorbar_fmt='None', errorbar_alpha=1.0, errorbar_capsize=4.0, zorder_data=3, zorder_error=1, label=True)[source]#
Bases:
ObsPlotConfigDataclass to handle configurations for plotting spectroscopic data.
Notes
Authors: Allan Denis
- Parameters:
- class ForMoSA.core.config.PhotometricPlotConfig(cmap=<factory>, color='blue', edgecolor=None, norm=<factory>, marker='s', markersize=70, linewidth=2.0, errorbar_fmt='None', errorbar_alpha=1.0, errorbar_capsize=4.0, zorder_data=3, zorder_error=1, label=True, label_filter=False, label_data=True)[source]#
Bases:
ObsPlotConfigDataclass to handle configurations for plotting photometric data.
Notes
Authors: Allan Denis
- Parameters:
- class ForMoSA.core.config.CornerPlotConfig(figsize=(15.0, 15.0), color='#A12A1F', bins=80, smooth=1, smooth1d=None, plot_datapoints=False, plot_density=True, plot_contours=True, fill_contours=True, quantiles=(0.16, 0.5, 0.84), levels=<factory>, show_titles=True, title_fmt=' .2f', hist_kwargs=<factory>, contour_kwargs=<factory>, pcolor_kwargs=<factory>, title_kwargs=<factory>, label_kwargs=<factory>, max_n_ticks=4)[source]#
Bases:
objectDataclass to handle configurations for corner plots.
Notes
Authors: Allan Denis
- Parameters:
color (str)
bins (int)
smooth (float)
smooth1d (float | None)
plot_datapoints (bool)
plot_density (bool)
plot_contours (bool)
fill_contours (bool)
quantiles (tuple)
levels (list)
show_titles (bool)
title_fmt (str)
hist_kwargs (dict)
contour_kwargs (dict)
pcolor_kwargs (dict)
title_kwargs (dict)
label_kwargs (dict)
max_n_ticks (int)
- class ForMoSA.core.config.ChainsPlotConfig(figsize=(18.0, 12.0), color_chains='violet', alpha_chains=0.8, color_plot_burn_in='#A12A1F', fontsize_burn_in=14, text_burn_in=(0.8, 0.8), color_text_burn_in='#A12A1F', linestyle_burn_in='--', show_weights=True, color_plot_weights='#1F1F1F', fontsize_weights=14, alpha_weights=0.4, text_weights=(0.8, 0.7), color_text_weights='#1F1F1F', plot_best_value=True, color_best_value='black', linestyle_best_value='-.')[source]#
Bases:
objectDataclass to handle configurations for chains plot.
Notes
Authors: Allan Denis
- Parameters:
color_chains (str)
alpha_chains (float)
color_plot_burn_in (str)
fontsize_burn_in (int)
color_text_burn_in (str)
linestyle_burn_in (str)
show_weights (bool)
color_plot_weights (str)
fontsize_weights (int)
alpha_weights (float)
color_text_weights (str)
plot_best_value (bool)
color_best_value (str)
linestyle_best_value (str)
- class ForMoSA.core.config.RadarPlotConfig(figsize=(6.0, 6.0), color_radar='#4A5FD9', color_uncertainty='#4A5FD9', linewidth=2.0, fontsize_names=11, fontsize_ticks=11, color_ticks='#24292E', show_ticks=False, alpha_fill=0.35, quantiles=(0.16, 0.84), size_quantiles=80, color_quantiles='#4A5FD9', lw_quantiles=2.0)[source]#
Bases:
objectDataclass to handle configurations for radar plot.
Notes
Authors: Allan Denis
- Parameters:
- main_color = '#4A5FD9'#
- fill_color = '#6B7FE8'#
- uncertainty_color = '#A8B3F5'#
- class ForMoSA.core.config.BestFitPlotConfig(color_fit='black', color_residuals='#2C2C2C', linewidth=1.0, zorder=200)[source]#
Bases:
objectDataclass to handle configurations for best fit plot.
Notes
Authors: Allan Denis
- class ForMoSA.core.config.PlotsConfig(CornerPlot=<factory>, ChainsPlot=<factory>, RadarPlot=<factory>, BestFitPlot=<factory>)[source]#
Bases:
objectDataclass to handle configurations for plots.
Notes
Authors: Allan Denis
- Parameters:
CornerPlot (CornerPlotConfig)
ChainsPlot (ChainsPlotConfig)
RadarPlot (RadarPlotConfig)
BestFitPlot (BestFitPlotConfig)
- CornerPlot: CornerPlotConfig#
- ChainsPlot: ChainsPlotConfig#
- RadarPlot: RadarPlotConfig#
- BestFitPlot: BestFitPlotConfig#