threeML.config package

Submodules

threeML.config.catalog_structure module

class threeML.config.catalog_structure.CatalogServer(url: str = '???')[source]

Bases: object

url: str = '???'
class threeML.config.catalog_structure.Catalogs(Fermi: threeML.config.catalog_structure.InstrumentCatalog = <factory>, Swift: threeML.config.catalog_structure.InstrumentCatalog = <factory>)[source]

Bases: object

Fermi: InstrumentCatalog
Swift: InstrumentCatalog
class threeML.config.catalog_structure.InstrumentCatalog(catalogs: Dict[str, threeML.config.catalog_structure.CatalogServer] = '???')[source]

Bases: object

catalogs: Dict[str, CatalogServer] = '???'
class threeML.config.catalog_structure.PublicDataServer(public_ftp_location: Optional[str] = None, public_http_location: str = '???', query_form: Optional[str] = None)[source]

Bases: object

public_ftp_location: Optional[str] = None
public_http_location: str = '???'
query_form: Optional[str] = None

threeML.config.config module

threeML.config.config_structure module

class threeML.config.config_structure.Config(logging: threeML.config.config_structure.Logging = <factory>, parallel: threeML.config.config_structure.Parallel = <factory>, interface: threeML.config.config_structure.Interface = <factory>, plugins: threeML.config.plugin_structure.Plugins = <factory>, time_series: threeML.config.plugin_structure.TimeSeries = <factory>, mle: threeML.config.fitting_structure.MLEDefault = <factory>, bayesian: threeML.config.fitting_structure.BayesianDefault = <factory>, plotting: threeML.config.plotting_structure.GenericPlotting = <factory>, model_plot: threeML.config.plotting_structure.ModelPlotting = <factory>, point_source: threeML.config.point_source_structure.PointSourceDefaults = <factory>, LAT: threeML.config.catalog_structure.PublicDataServer = <factory>, GBM: threeML.config.catalog_structure.PublicDataServer = <factory>, catalogs: threeML.config.catalog_structure.Catalogs = <factory>)[source]

Bases: object

GBM: PublicDataServer
LAT: PublicDataServer
bayesian: BayesianDefault
catalogs: Catalogs
interface: Interface
logging: Logging
mle: MLEDefault
model_plot: ModelPlotting
parallel: Parallel
plotting: GenericPlotting
plugins: Plugins
point_source: PointSourceDefaults
time_series: TimeSeries
class threeML.config.config_structure.Interface(progress_bars: bool = 'on', multi_progress_color: bool = 'on', multi_progress_cmap: str = 'viridis', progress_bar_color: str = '#9C04FF')[source]

Bases: object

multi_progress_cmap: str = 'viridis'
multi_progress_color: bool = 'on'
progress_bar_color: str = '#9C04FF'
progress_bars: bool = 'on'
class threeML.config.config_structure.Logging(path: str = '~/.threeml/log', developer: bool = 'off', usr: bool = 'on', console: bool = 'on', level: threeML.config.config_structure.LoggingLevel = <LoggingLevel.INFO: 20>, startup_warnings: bool = 'on')[source]

Bases: object

console: bool = 'on'
developer: bool = 'off'
level: LoggingLevel = 20
path: str = '~/.threeml/log'
startup_warnings: bool = 'on'
usr: bool = 'on'
class threeML.config.config_structure.LoggingLevel(value)[source]

Bases: IntEnum

An enumeration.

CRITICAL = 50
DEBUG = 10
ERROR = 40
INFO = 20
WARNING = 30
class threeML.config.config_structure.Parallel(profile_name: str = 'default', use_parallel: bool = False, use_joblib: bool = False)[source]

Bases: object

profile_name: str = 'default'
use_joblib: bool = False
use_parallel: bool = False

threeML.config.config_utils module

threeML.config.config_utils.get_current_configuration_copy(file_name: str = 'threeML_config.yml', overwrite: bool = False)[source]

write a copy of the CURRENT configuration to the config directory

threeML.config.config_utils.get_value(name, user_value, par_type, config_value)[source]

Get the value for a parameter. If value is None returns the config value. :param name: Name of parameter :param user_value: user value (can be None if no value given) :param par_type: Type of the paramter :param config_value: value in config :returns: parameter value

threeML.config.config_utils.get_value_kwargs(name, par_type, config_value, **kwargs)[source]

Read the value of a parameter from the kwargs or the config if it does not exist in the kwargs. :param name: Name of parameter in kwargs :param par_type: Type of the parameter :param config_value: Value in the config :param kwargs: :returns: value of parameter, rest of kwargs

threeML.config.config_utils.recurse_dict(d, tree)[source]
threeML.config.config_utils.show_configuration(sub_menu: Optional[str] = None)[source]

display the current configuration or a sub menu if provided

threeML.config.fitting_structure module

class threeML.config.fitting_structure.BayesianDefault(use_median_fit: bool = False, default_sampler: threeML.config.fitting_structure.Sampler = <Sampler.emcee: 'emcee'>, emcee_setup: Optional[Dict[str, Any]] = <factory>, multinest_setup: Optional[Dict[str, Any]] = <factory>, ultranest_setup: Optional[Dict[str, Any]] = <factory>, zeus_setup: Optional[Dict[str, Any]] = <factory>, dynesty_nested_setup: Optional[Dict[str, Any]] = <factory>, dynesty_dynmaic_setup: Optional[Dict[str, Any]] = <factory>, corner_style: threeML.config.plotting_structure.CornerStyle = <factory>)[source]

Bases: object

corner_style: CornerStyle
default_sampler: Sampler = 'emcee'
dynesty_dynmaic_setup: Optional[Dict[str, Any]]
dynesty_nested_setup: Optional[Dict[str, Any]]
emcee_setup: Optional[Dict[str, Any]]
multinest_setup: Optional[Dict[str, Any]]
ultranest_setup: Optional[Dict[str, Any]]
use_median_fit: bool = False
zeus_setup: Optional[Dict[str, Any]]
class threeML.config.fitting_structure.MLEDefault(default_minimizer: threeML.config.fitting_structure.Optimizer = <Optimizer.minuit: 'minuit'>, default_minimizer_algorithm: Optional[str] = None, default_minimizer_callback: Optional[str] = None, contour_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Pastel1: 'Pastel1'>, contour_background: str = 'white', contour_level_1: str = '#ffa372', contour_level_2: str = '#ed6663', contour_level_3: str = '#0f4c81', profile_color: str = 'k', profile_level_1: str = '#ffa372', profile_level_2: str = '#ed6663', profile_level_3: str = '#0f4c81')[source]

Bases: object

contour_background: str = 'white'
contour_cmap: MPLCmap = 'Pastel1'
contour_level_1: str = '#ffa372'
contour_level_2: str = '#ed6663'
contour_level_3: str = '#0f4c81'
default_minimizer: Optimizer = 'minuit'
default_minimizer_algorithm: Optional[str] = None
default_minimizer_callback: Optional[str] = None
profile_color: str = 'k'
profile_level_1: str = '#ffa372'
profile_level_2: str = '#ed6663'
profile_level_3: str = '#0f4c81'
class threeML.config.fitting_structure.Optimizer(value)[source]

Bases: Enum

An enumeration.

ROOT = 'ROOT'
minuit = 'minuit'
scipy = 'scipy'
class threeML.config.fitting_structure.Sampler(value)[source]

Bases: Enum

An enumeration.

autoemcee = 'autoemcee'
dynesty_dynamic = 'dynesty_dynamic'
dynesty_nested = 'dynesty_nested'
emcee = 'emcee'
multinest = 'multinest'
ultranest = 'ultranest'
zeus = 'zeus'

threeML.config.plotting_structure module

class threeML.config.plotting_structure.BinnedSpectrumPlot(data_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, model_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, background_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, n_colors: int = 5, step: bool = False, show_legend: bool = True, show_residuals: bool = True, data_color: Optional[str] = None, model_color: Optional[str] = None, background_color: Optional[str] = None, show_background: bool = False, data_mpl_kwargs: Optional[Dict[str, Any]] = None, model_mpl_kwargs: Optional[Dict[str, Any]] = None, background_mpl_kwargs: Optional[Dict[str, Any]] = None)[source]

Bases: object

background_cmap: MPLCmap = 'Set1'
background_color: Optional[str] = None
background_mpl_kwargs: Optional[Dict[str, Any]] = None
data_cmap: MPLCmap = 'Set1'
data_color: Optional[str] = None
data_mpl_kwargs: Optional[Dict[str, Any]] = None
model_cmap: MPLCmap = 'Set1'
model_color: Optional[str] = None
model_mpl_kwargs: Optional[Dict[str, Any]] = None
n_colors: int = 5
show_background: bool = False
show_legend: bool = True
show_residuals: bool = True
step: bool = False
class threeML.config.plotting_structure.ContourStyle(alpha: float = 0.4)[source]

Bases: object

alpha: float = 0.4
class threeML.config.plotting_structure.CornerStyle(show_titles: bool = True, smooth: float = 0.9, title_fmt: str = '.2g', bins: int = 25, quantiles: List[float] = <factory>, fill_contours: bool = True, cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.viridis: 'viridis'>, extremes: str = 'white', contourf_kwargs: Dict[str, Any] = <factory>, levels: List[float] = <factory>)[source]

Bases: object

bins: int = 25
cmap: MPLCmap = 'viridis'
contourf_kwargs: Dict[str, Any]
extremes: str = 'white'
fill_contours: bool = True
levels: List[float]
quantiles: List[float]
show_titles: bool = True
smooth: float = 0.9
title_fmt: str = '.2g'
class threeML.config.plotting_structure.DataHistPlot(counts_color: str = '#500472', background_color: str = '#79cbb8', warn_channels_color: str = '#C79BFE', bad_channels_color: str = '#FE3131', masked_channels_color: str = '#566573')[source]

Bases: object

background_color: str = '#79cbb8'
bad_channels_color: str = '#FE3131'
counts_color: str = '#500472'
masked_channels_color: str = '#566573'
warn_channels_color: str = '#C79BFE'
class threeML.config.plotting_structure.FermiSpectrumPlot(total_model_color: str = 'k', show_background_sources: bool = True, shade_fixed_sources: bool = True, shade_secondary_sources: bool = False, fixed_sources_color: str = 'grey', secondary_sources_color: str = 'k', data_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, model_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, background_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, step: bool = False, show_legend: bool = True, show_residuals: bool = True, data_color: Optional[str] = None, model_color: Optional[str] = None, background_color: Optional[str] = None, data_mpl_kwargs: Optional[Dict[str, Any]] = None, model_mpl_kwargs: Optional[Dict[str, Any]] = None, background_mpl_kwargs: Optional[Dict[str, Any]] = None)[source]

Bases: object

background_cmap: MPLCmap = 'Set1'
background_color: Optional[str] = None
background_mpl_kwargs: Optional[Dict[str, Any]] = None
data_cmap: MPLCmap = 'Set1'
data_color: Optional[str] = None
data_mpl_kwargs: Optional[Dict[str, Any]] = None
fixed_sources_color: str = 'grey'
model_cmap: MPLCmap = 'Set1'
model_color: Optional[str] = None
model_mpl_kwargs: Optional[Dict[str, Any]] = None
secondary_sources_color: str = 'k'
shade_fixed_sources: bool = True
shade_secondary_sources: bool = False
show_background_sources: bool = True
show_legend: bool = True
show_residuals: bool = True
step: bool = False
total_model_color: str = 'k'
class threeML.config.plotting_structure.GenericPlotting(use_threeml_style: bool = True, mplstyle: str = 'threeml.mplstyle', residual_plot: threeML.config.plotting_structure.ResidualPlot = <factory>)[source]

Bases: object

mplstyle: str = 'threeml.mplstyle'
residual_plot: ResidualPlot
use_threeml_style: bool = True
class threeML.config.plotting_structure.LegendStyle(loc: str = 'best', fancybox: bool = True, shadow: bool = True)[source]

Bases: object

fancybox: bool = True
loc: str = 'best'
shadow: bool = True
class threeML.config.plotting_structure.MPLCmap(value)

Bases: Enum

An enumeration.

Accent = 'Accent'
Accent_r = 'Accent_r'
Blues = 'Blues'
Blues_r = 'Blues_r'
BrBG = 'BrBG'
BrBG_r = 'BrBG_r'
BuGn = 'BuGn'
BuGn_r = 'BuGn_r'
BuPu = 'BuPu'
BuPu_r = 'BuPu_r'
CMRmap = 'CMRmap'
CMRmap_r = 'CMRmap_r'
Dark2 = 'Dark2'
Dark2_r = 'Dark2_r'
GnBu = 'GnBu'
GnBu_r = 'GnBu_r'
Grays = 'Grays'
Greens = 'Greens'
Greens_r = 'Greens_r'
Greys = 'Greys'
Greys_r = 'Greys_r'
OrRd = 'OrRd'
OrRd_r = 'OrRd_r'
Oranges = 'Oranges'
Oranges_r = 'Oranges_r'
PRGn = 'PRGn'
PRGn_r = 'PRGn_r'
Paired = 'Paired'
Paired_r = 'Paired_r'
Pastel1 = 'Pastel1'
Pastel1_r = 'Pastel1_r'
Pastel2 = 'Pastel2'
Pastel2_r = 'Pastel2_r'
PiYG = 'PiYG'
PiYG_r = 'PiYG_r'
PuBu = 'PuBu'
PuBuGn = 'PuBuGn'
PuBuGn_r = 'PuBuGn_r'
PuBu_r = 'PuBu_r'
PuOr = 'PuOr'
PuOr_r = 'PuOr_r'
PuRd = 'PuRd'
PuRd_r = 'PuRd_r'
Purples = 'Purples'
Purples_r = 'Purples_r'
RdBu = 'RdBu'
RdBu_r = 'RdBu_r'
RdGy = 'RdGy'
RdGy_r = 'RdGy_r'
RdPu = 'RdPu'
RdPu_r = 'RdPu_r'
RdYlBu = 'RdYlBu'
RdYlBu_r = 'RdYlBu_r'
RdYlGn = 'RdYlGn'
RdYlGn_r = 'RdYlGn_r'
Reds = 'Reds'
Reds_r = 'Reds_r'
Set1 = 'Set1'
Set1_r = 'Set1_r'
Set2 = 'Set2'
Set2_r = 'Set2_r'
Set3 = 'Set3'
Set3_r = 'Set3_r'
Spectral = 'Spectral'
Spectral_r = 'Spectral_r'
Wistia = 'Wistia'
Wistia_r = 'Wistia_r'
YlGn = 'YlGn'
YlGnBu = 'YlGnBu'
YlGnBu_r = 'YlGnBu_r'
YlGn_r = 'YlGn_r'
YlOrBr = 'YlOrBr'
YlOrBr_r = 'YlOrBr_r'
YlOrRd = 'YlOrRd'
YlOrRd_r = 'YlOrRd_r'
afmhot = 'afmhot'
afmhot_r = 'afmhot_r'
autumn = 'autumn'
autumn_r = 'autumn_r'
binary = 'binary'
binary_r = 'binary_r'
bone = 'bone'
bone_r = 'bone_r'
brg = 'brg'
brg_r = 'brg_r'
bwr = 'bwr'
bwr_r = 'bwr_r'
cividis = 'cividis'
cividis_r = 'cividis_r'
cool = 'cool'
cool_r = 'cool_r'
coolwarm = 'coolwarm'
coolwarm_r = 'coolwarm_r'
copper = 'copper'
copper_r = 'copper_r'
cubehelix = 'cubehelix'
cubehelix_r = 'cubehelix_r'
flag = 'flag'
flag_r = 'flag_r'
gist_earth = 'gist_earth'
gist_earth_r = 'gist_earth_r'
gist_gray = 'gist_gray'
gist_gray_r = 'gist_gray_r'
gist_grey = 'gist_grey'
gist_heat = 'gist_heat'
gist_heat_r = 'gist_heat_r'
gist_ncar = 'gist_ncar'
gist_ncar_r = 'gist_ncar_r'
gist_rainbow = 'gist_rainbow'
gist_rainbow_r = 'gist_rainbow_r'
gist_stern = 'gist_stern'
gist_stern_r = 'gist_stern_r'
gist_yarg = 'gist_yarg'
gist_yarg_r = 'gist_yarg_r'
gist_yerg = 'gist_yerg'
gnuplot = 'gnuplot'
gnuplot2 = 'gnuplot2'
gnuplot2_r = 'gnuplot2_r'
gnuplot_r = 'gnuplot_r'
gray = 'gray'
gray_r = 'gray_r'
grey = 'grey'
hot = 'hot'
hot_r = 'hot_r'
hsv = 'hsv'
hsv_r = 'hsv_r'
inferno = 'inferno'
inferno_r = 'inferno_r'
jet = 'jet'
jet_r = 'jet_r'
magma = 'magma'
magma_r = 'magma_r'
nipy_spectral = 'nipy_spectral'
nipy_spectral_r = 'nipy_spectral_r'
ocean = 'ocean'
ocean_r = 'ocean_r'
pink = 'pink'
pink_r = 'pink_r'
plasma = 'plasma'
plasma_r = 'plasma_r'
prism = 'prism'
prism_r = 'prism_r'
rainbow = 'rainbow'
rainbow_r = 'rainbow_r'
seismic = 'seismic'
seismic_r = 'seismic_r'
spring = 'spring'
spring_r = 'spring_r'
summer = 'summer'
summer_r = 'summer_r'
tab10 = 'tab10'
tab10_r = 'tab10_r'
tab20 = 'tab20'
tab20_r = 'tab20_r'
tab20b = 'tab20b'
tab20b_r = 'tab20b_r'
tab20c = 'tab20c'
tab20c_r = 'tab20c_r'
terrain = 'terrain'
terrain_r = 'terrain_r'
turbo = 'turbo'
turbo_r = 'turbo_r'
twilight = 'twilight'
twilight_r = 'twilight_r'
twilight_shifted = 'twilight_shifted'
twilight_shifted_r = 'twilight_shifted_r'
viridis = 'viridis'
viridis_r = 'viridis_r'
winter = 'winter'
winter_r = 'winter_r'
class threeML.config.plotting_structure.ModelPlotting(point_source_plot: threeML.config.plotting_structure.PointSourcePlot = <factory>)[source]

Bases: object

point_source_plot: PointSourcePlot
class threeML.config.plotting_structure.PlotStyle(linestyle: Optional[str] = '-', linewidth: Optional[float] = 1.7)[source]

Bases: object

linestyle: Optional[str] = '-'
linewidth: Optional[float] = 1.7
class threeML.config.plotting_structure.PointSourcePlot(fit_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, contour_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, bayes_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.Set1: 'Set1'>, plot_style: threeML.config.plotting_structure.PlotStyle = <factory>, contour_style: threeML.config.plotting_structure.ContourStyle = <factory>, show_legend: bool = True, legend_style: threeML.config.plotting_structure.LegendStyle = <factory>, flux_unit: str = '1/(keV s cm2)', emin: float = 10.0, emax: float = 10000.0, num_ene: int = 100, ene_unit: str = 'keV')[source]

Bases: object

bayes_cmap: MPLCmap = 'Set1'
contour_cmap: MPLCmap = 'Set1'
contour_style: ContourStyle
emax: float = 10000.0
emin: float = 10.0
ene_unit: str = 'keV'
fit_cmap: MPLCmap = 'Set1'
flux_unit: str = '1/(keV s cm2)'
legend_style: LegendStyle
num_ene: int = 100
plot_style: PlotStyle
show_legend: bool = True
class threeML.config.plotting_structure.ResidualPlot(linewidth: float = 1, marker: str = '.', size: float = 3, legend_font_size: float = 6.94)[source]

Bases: object

legend_font_size: float = 6.94
linewidth: float = 1
marker: str = '.'
size: float = 3

threeML.config.plugin_structure module

class threeML.config.plugin_structure.Fermipy(fit_plot: threeML.config.plotting_structure.FermiSpectrumPlot = <factory>)[source]

Bases: object

fit_plot: FermiSpectrumPlot
class threeML.config.plugin_structure.OGIP(fit_plot: threeML.config.plotting_structure.BinnedSpectrumPlot = <factory>, data_plot: threeML.config.plotting_structure.DataHistPlot = <factory>, response_cmap: threeML.config.plotting_structure.MPLCmap = <MPLCmap.viridis: 'viridis'>, response_zero_color: str = 'k')[source]

Bases: object

data_plot: DataHistPlot
fit_plot: BinnedSpectrumPlot
response_cmap: MPLCmap = 'viridis'
response_zero_color: str = 'k'
class threeML.config.plugin_structure.Photo(fit_plot: threeML.config.plotting_structure.BinnedSpectrumPlot = <factory>)[source]

Bases: object

fit_plot: BinnedSpectrumPlot
class threeML.config.plugin_structure.Plugins(ogip: threeML.config.plugin_structure.OGIP = <factory>, photo: threeML.config.plugin_structure.Photo = <factory>, fermipy: threeML.config.plugin_structure.Fermipy = <factory>)[source]

Bases: object

fermipy: Fermipy
ogip: OGIP
photo: Photo
class threeML.config.plugin_structure.TimeSeries(light_curve_color: str = '#05716c', selection_color: str = '#1fbfb8', background_color: str = '#C0392B', background_selection_color: str = '#E74C3C', fit: threeML.config.plugin_structure.TimeSeriesFit = <factory>)[source]

Bases: object

background_color: str = '#C0392B'
background_selection_color: str = '#E74C3C'
fit: TimeSeriesFit
light_curve_color: str = '#05716c'
selection_color: str = '#1fbfb8'
class threeML.config.plugin_structure.TimeSeriesFit(fit_poly: bool = True, unbinned: bool = False, bayes: bool = False)[source]

Bases: object

bayes: bool = False
fit_poly: bool = True
unbinned: bool = False

threeML.config.point_source_structure module

class threeML.config.point_source_structure.IntegrateMethod(value)[source]

Bases: IntEnum

An enumeration.

quad = 1
trapz = 0
class threeML.config.point_source_structure.PointSourceDefaults(integrate_flux_method: threeML.config.point_source_structure.IntegrateMethod = <IntegrateMethod.trapz: 0>, max_number_samples: int = 5000)[source]

Bases: object

integrate_flux_method: IntegrateMethod = 0
max_number_samples: int = 5000

Module contents