threeML package
Subpackages
- threeML.bayesian package
- Submodules
- threeML.bayesian.autoemcee_sampler module
- threeML.bayesian.bayesian_analysis module
BayesianAnalysis
BayesianAnalysis.analysis_type
BayesianAnalysis.convergence_plots()
BayesianAnalysis.data_list
BayesianAnalysis.likelihood_model
BayesianAnalysis.log_like_values
BayesianAnalysis.log_marginal_likelihood
BayesianAnalysis.log_probability_values
BayesianAnalysis.plot_chains()
BayesianAnalysis.raw_samples
BayesianAnalysis.restore_MAP_fit()
BayesianAnalysis.restore_median_fit()
BayesianAnalysis.results
BayesianAnalysis.sample()
BayesianAnalysis.sampler
BayesianAnalysis.samples
BayesianAnalysis.set_sampler()
- threeML.bayesian.dynesty_sampler module
- threeML.bayesian.emcee_sampler module
- threeML.bayesian.multinest_sampler module
- threeML.bayesian.nautilus_sampler module
- threeML.bayesian.sampler_base module
- threeML.bayesian.tutorial_material module
- threeML.bayesian.ultranest_sampler module
- threeML.bayesian.zeus_sampler module
- Module contents
- threeML.catalogs package
- Submodules
- threeML.catalogs.Fermi module
- threeML.catalogs.FermiGBM module
- threeML.catalogs.FermiLAT module
- threeML.catalogs.FermiLLE module
- threeML.catalogs.Swift module
- threeML.catalogs.VirtualObservatoryCatalog module
ConeSearchFailed
VirtualObservatoryCatalog
VirtualObservatoryCatalog.apply_format()
VirtualObservatoryCatalog.cone_search()
VirtualObservatoryCatalog.dec_center
VirtualObservatoryCatalog.get_model()
VirtualObservatoryCatalog.query()
VirtualObservatoryCatalog.query_sources()
VirtualObservatoryCatalog.ra_center
VirtualObservatoryCatalog.result
VirtualObservatoryCatalog.search_around_source()
- threeML.catalogs.catalog_utils module
- Module contents
- threeML.classicMLE package
- Submodules
- threeML.classicMLE.goodness_of_fit module
- threeML.classicMLE.joint_likelihood module
JointLikelihood
JointLikelihood.analysis_type
JointLikelihood.compute_TS()
JointLikelihood.correlation_matrix
JointLikelihood.covariance_matrix
JointLikelihood.current_minimum
JointLikelihood.data_list
JointLikelihood.fit()
JointLikelihood.fit_trace
JointLikelihood.get_contours()
JointLikelihood.get_errors()
JointLikelihood.likelihood_model
JointLikelihood.minimizer
JointLikelihood.minimizer_in_use
JointLikelihood.minus_log_like_profile()
JointLikelihood.plot_all_contours()
JointLikelihood.restore_best_fit()
JointLikelihood.results
JointLikelihood.set_minimizer()
NotANumberInLikelihood
ReducingNumberOfSteps
ReducingNumberOfThreads
- threeML.classicMLE.joint_likelihood_set module
- threeML.classicMLE.likelihood_ratio_test module
- Module contents
- threeML.config package
- Submodules
- threeML.config.catalog_structure module
- threeML.config.config module
- threeML.config.config_structure module
- threeML.config.config_utils module
- threeML.config.fitting_structure module
BayesianDefault
MLEDefault
MLEDefault.contour_background
MLEDefault.contour_cmap
MLEDefault.contour_level_1
MLEDefault.contour_level_2
MLEDefault.contour_level_3
MLEDefault.default_minimizer
MLEDefault.default_minimizer_algorithm
MLEDefault.default_minimizer_callback
MLEDefault.profile_color
MLEDefault.profile_level_1
MLEDefault.profile_level_2
MLEDefault.profile_level_3
Optimizer
Sampler
- threeML.config.plotting_structure module
BinnedSpectrumPlot
BinnedSpectrumPlot.background_cmap
BinnedSpectrumPlot.background_color
BinnedSpectrumPlot.background_mpl_kwargs
BinnedSpectrumPlot.data_cmap
BinnedSpectrumPlot.data_color
BinnedSpectrumPlot.data_mpl_kwargs
BinnedSpectrumPlot.model_cmap
BinnedSpectrumPlot.model_color
BinnedSpectrumPlot.model_mpl_kwargs
BinnedSpectrumPlot.n_colors
BinnedSpectrumPlot.show_background
BinnedSpectrumPlot.show_legend
BinnedSpectrumPlot.show_residuals
BinnedSpectrumPlot.step
ContourStyle
CornerStyle
DataHistPlot
FermiSpectrumPlot
FermiSpectrumPlot.background_cmap
FermiSpectrumPlot.background_color
FermiSpectrumPlot.background_mpl_kwargs
FermiSpectrumPlot.data_cmap
FermiSpectrumPlot.data_color
FermiSpectrumPlot.data_mpl_kwargs
FermiSpectrumPlot.fixed_sources_color
FermiSpectrumPlot.model_cmap
FermiSpectrumPlot.model_color
FermiSpectrumPlot.model_mpl_kwargs
FermiSpectrumPlot.secondary_sources_color
FermiSpectrumPlot.shade_fixed_sources
FermiSpectrumPlot.shade_secondary_sources
FermiSpectrumPlot.show_background_sources
FermiSpectrumPlot.show_legend
FermiSpectrumPlot.show_residuals
FermiSpectrumPlot.step
FermiSpectrumPlot.total_model_color
GenericPlotting
LegendStyle
MPLCmap
MPLCmap.Accent
MPLCmap.Accent_r
MPLCmap.Blues
MPLCmap.Blues_r
MPLCmap.BrBG
MPLCmap.BrBG_r
MPLCmap.BuGn
MPLCmap.BuGn_r
MPLCmap.BuPu
MPLCmap.BuPu_r
MPLCmap.CMRmap
MPLCmap.CMRmap_r
MPLCmap.Dark2
MPLCmap.Dark2_r
MPLCmap.GnBu
MPLCmap.GnBu_r
MPLCmap.Grays
MPLCmap.Greens
MPLCmap.Greens_r
MPLCmap.Greys
MPLCmap.Greys_r
MPLCmap.OrRd
MPLCmap.OrRd_r
MPLCmap.Oranges
MPLCmap.Oranges_r
MPLCmap.PRGn
MPLCmap.PRGn_r
MPLCmap.Paired
MPLCmap.Paired_r
MPLCmap.Pastel1
MPLCmap.Pastel1_r
MPLCmap.Pastel2
MPLCmap.Pastel2_r
MPLCmap.PiYG
MPLCmap.PiYG_r
MPLCmap.PuBu
MPLCmap.PuBuGn
MPLCmap.PuBuGn_r
MPLCmap.PuBu_r
MPLCmap.PuOr
MPLCmap.PuOr_r
MPLCmap.PuRd
MPLCmap.PuRd_r
MPLCmap.Purples
MPLCmap.Purples_r
MPLCmap.RdBu
MPLCmap.RdBu_r
MPLCmap.RdGy
MPLCmap.RdGy_r
MPLCmap.RdPu
MPLCmap.RdPu_r
MPLCmap.RdYlBu
MPLCmap.RdYlBu_r
MPLCmap.RdYlGn
MPLCmap.RdYlGn_r
MPLCmap.Reds
MPLCmap.Reds_r
MPLCmap.Set1
MPLCmap.Set1_r
MPLCmap.Set2
MPLCmap.Set2_r
MPLCmap.Set3
MPLCmap.Set3_r
MPLCmap.Spectral
MPLCmap.Spectral_r
MPLCmap.Wistia
MPLCmap.Wistia_r
MPLCmap.YlGn
MPLCmap.YlGnBu
MPLCmap.YlGnBu_r
MPLCmap.YlGn_r
MPLCmap.YlOrBr
MPLCmap.YlOrBr_r
MPLCmap.YlOrRd
MPLCmap.YlOrRd_r
MPLCmap.afmhot
MPLCmap.afmhot_r
MPLCmap.autumn
MPLCmap.autumn_r
MPLCmap.binary
MPLCmap.binary_r
MPLCmap.bone
MPLCmap.bone_r
MPLCmap.brg
MPLCmap.brg_r
MPLCmap.bwr
MPLCmap.bwr_r
MPLCmap.cividis
MPLCmap.cividis_r
MPLCmap.cool
MPLCmap.cool_r
MPLCmap.coolwarm
MPLCmap.coolwarm_r
MPLCmap.copper
MPLCmap.copper_r
MPLCmap.cubehelix
MPLCmap.cubehelix_r
MPLCmap.flag
MPLCmap.flag_r
MPLCmap.gist_earth
MPLCmap.gist_earth_r
MPLCmap.gist_gray
MPLCmap.gist_gray_r
MPLCmap.gist_grey
MPLCmap.gist_heat
MPLCmap.gist_heat_r
MPLCmap.gist_ncar
MPLCmap.gist_ncar_r
MPLCmap.gist_rainbow
MPLCmap.gist_rainbow_r
MPLCmap.gist_stern
MPLCmap.gist_stern_r
MPLCmap.gist_yarg
MPLCmap.gist_yarg_r
MPLCmap.gist_yerg
MPLCmap.gnuplot
MPLCmap.gnuplot2
MPLCmap.gnuplot2_r
MPLCmap.gnuplot_r
MPLCmap.gray
MPLCmap.gray_r
MPLCmap.grey
MPLCmap.hot
MPLCmap.hot_r
MPLCmap.hsv
MPLCmap.hsv_r
MPLCmap.inferno
MPLCmap.inferno_r
MPLCmap.jet
MPLCmap.jet_r
MPLCmap.magma
MPLCmap.magma_r
MPLCmap.nipy_spectral
MPLCmap.nipy_spectral_r
MPLCmap.ocean
MPLCmap.ocean_r
MPLCmap.pink
MPLCmap.pink_r
MPLCmap.plasma
MPLCmap.plasma_r
MPLCmap.prism
MPLCmap.prism_r
MPLCmap.rainbow
MPLCmap.rainbow_r
MPLCmap.seismic
MPLCmap.seismic_r
MPLCmap.spring
MPLCmap.spring_r
MPLCmap.summer
MPLCmap.summer_r
MPLCmap.tab10
MPLCmap.tab10_r
MPLCmap.tab20
MPLCmap.tab20_r
MPLCmap.tab20b
MPLCmap.tab20b_r
MPLCmap.tab20c
MPLCmap.tab20c_r
MPLCmap.terrain
MPLCmap.terrain_r
MPLCmap.turbo
MPLCmap.turbo_r
MPLCmap.twilight
MPLCmap.twilight_r
MPLCmap.twilight_shifted
MPLCmap.twilight_shifted_r
MPLCmap.viridis
MPLCmap.viridis_r
MPLCmap.winter
MPLCmap.winter_r
ModelPlotting
PlotStyle
PointSourcePlot
PointSourcePlot.bayes_cmap
PointSourcePlot.contour_cmap
PointSourcePlot.contour_style
PointSourcePlot.emax
PointSourcePlot.emin
PointSourcePlot.ene_unit
PointSourcePlot.fit_cmap
PointSourcePlot.flux_unit
PointSourcePlot.legend_style
PointSourcePlot.num_ene
PointSourcePlot.plot_style
PointSourcePlot.show_legend
ResidualPlot
- threeML.config.plugin_structure module
- threeML.config.point_source_structure module
- Module contents
- threeML.exceptions package
- threeML.io package
- Subpackages
- threeML.io.cern_root_utils package
- threeML.io.plotting package
- Submodules
- threeML.io.plotting.cmap_cycle module
- threeML.io.plotting.data_residual_plot module
- threeML.io.plotting.get_style module
- threeML.io.plotting.light_curve_plots module
- threeML.io.plotting.model_plot module
- threeML.io.plotting.model_plot_2D module
- threeML.io.plotting.model_plot_tags module
- threeML.io.plotting.post_process_data_plots module
- threeML.io.plotting.step_plot module
- Module contents
- Submodules
- threeML.io.calculate_flux module
- threeML.io.configuration module
- threeML.io.detect_notebook module
- threeML.io.dict_with_pretty_print module
- threeML.io.download_from_ftp module
- threeML.io.download_from_http module
- threeML.io.file_utils module
- threeML.io.fits_file module
- threeML.io.get_heasarc_table_as_pandas module
- threeML.io.hdf5_utils module
- threeML.io.logging module
LoggingState
activate_logs()
activate_progress_bars()
activate_warnings()
debug_mode()
get_path_of_log_dir()
get_path_of_log_file()
invalid_plugin_name()
loud_mode()
quiet_mode()
setup_logger()
silence_console_log()
silence_logs()
silence_progress_bars()
silence_warnings()
toggle_progress_bars()
update_logging_level()
- threeML.io.network module
- threeML.io.package_data module
- threeML.io.results_table module
- threeML.io.rich_display module
- threeML.io.serialization module
- threeML.io.suppress_stdout module
- threeML.io.table module
- threeML.io.uncertainty_formatter module
- Module contents
- Subpackages
- threeML.minimizer package
- Submodules
- threeML.minimizer.ROOT_minimizer module
- threeML.minimizer.grid_minimizer module
- threeML.minimizer.minimization module
- threeML.minimizer.minuit_minimizer module
- threeML.minimizer.multinest_minimizer module
- threeML.minimizer.pagmo_minimizer module
- threeML.minimizer.scipy_minimizer module
- threeML.minimizer.tutorial_material module
- Module contents
- threeML.parallel package
- threeML.plugins package
- Subpackages
- Submodules
- threeML.plugins.BinnedProfileLike module
- threeML.plugins.DispersionSpectrumLike module
DispersionSpectrumLike
DispersionSpectrumLike.display_rsp()
DispersionSpectrumLike.from_function()
DispersionSpectrumLike.get_pha_files()
DispersionSpectrumLike.get_simulated_dataset()
DispersionSpectrumLike.response
DispersionSpectrumLike.set_model()
DispersionSpectrumLike.set_model_integrate_method()
DispersionSpectrumLike.write_pha()
- threeML.plugins.FermiLATLike module
- threeML.plugins.FermipyLike module
FermipyLike
FermipyLike.configuration
FermipyLike.display_model()
FermipyLike.get_basic_config()
FermipyLike.get_log_like()
FermipyLike.get_number_of_data_points()
FermipyLike.get_observation_duration()
FermipyLike.gta
FermipyLike.inner_fit()
FermipyLike.set_inner_minimization()
FermipyLike.set_model()
FermipyLike.set_nuisance_parameter_value()
- threeML.plugins.HAWCLike module
- threeML.plugins.OGIPLike module
- threeML.plugins.PhotometryLike module
- threeML.plugins.SpectrumLike module
SpectrumLike
SpectrumLike.area_ratio
SpectrumLike.assign_to_source()
SpectrumLike.background_count_errors
SpectrumLike.background_counts
SpectrumLike.background_exposure
SpectrumLike.background_integrate_method
SpectrumLike.background_noise_model
SpectrumLike.background_plugin
SpectrumLike.background_scale_factor
SpectrumLike.background_spectrum
SpectrumLike.current_background_count_errors
SpectrumLike.current_background_counts
SpectrumLike.current_observed_count_errors
SpectrumLike.current_observed_counts
SpectrumLike.current_scaled_background_counts
SpectrumLike.display()
SpectrumLike.display_model()
SpectrumLike.energy_boundaries
SpectrumLike.expected_model_rate
SpectrumLike.exposure
SpectrumLike.exposure_ratio
SpectrumLike.fix_effective_area_correction()
SpectrumLike.from_background()
SpectrumLike.from_function()
SpectrumLike.get_background_model()
SpectrumLike.get_log_like()
SpectrumLike.get_model()
SpectrumLike.get_number_of_data_points()
SpectrumLike.get_pha_files()
SpectrumLike.get_simulated_dataset()
SpectrumLike.inner_fit()
SpectrumLike.likelihood_model
SpectrumLike.mask
SpectrumLike.model_integrate_method
SpectrumLike.n_data_points
SpectrumLike.observation_noise_model
SpectrumLike.observed_count_errors
SpectrumLike.observed_counts
SpectrumLike.observed_spectrum
SpectrumLike.quality
SpectrumLike.rebin_on_background()
SpectrumLike.rebin_on_source()
SpectrumLike.remove_rebinning()
SpectrumLike.scale_factor
SpectrumLike.set_active_measurements()
SpectrumLike.set_background_integrate_method()
SpectrumLike.set_model()
SpectrumLike.set_model_integrate_method()
SpectrumLike.significance
SpectrumLike.significance_per_channel
SpectrumLike.simulated_parameters
SpectrumLike.source_rate
SpectrumLike.source_rate_error
SpectrumLike.tstart
SpectrumLike.tstop
SpectrumLike.use_effective_area_correction()
SpectrumLike.view_count_spectrum()
SpectrumLike.write_pha()
- threeML.plugins.SwiftXRTLike module
- threeML.plugins.UnbinnedPoissonLike module
- threeML.plugins.UnresolvedExtendedXYLike module
- threeML.plugins.XYLike module
XYLike
XYLike.assign_to_source()
XYLike.fit()
XYLike.from_dataframe()
XYLike.from_function()
XYLike.from_text_file()
XYLike.get_log_like()
XYLike.get_model()
XYLike.get_number_of_data_points()
XYLike.get_simulated_dataset()
XYLike.goodness_of_fit()
XYLike.has_errors
XYLike.inner_fit()
XYLike.is_poisson
XYLike.likelihood_model
XYLike.plot()
XYLike.set_model()
XYLike.to_csv()
XYLike.to_dataframe()
XYLike.to_txt()
XYLike.x
XYLike.y
XYLike.yerr
- Module contents
- threeML.test package
- Submodules
- threeML.test.conftest module
- threeML.test.generate_pha module
- threeML.test.test_AAA_against_xspec module
- threeML.test.test_FermiLATLike module
- threeML.test.test_FermipyLike module
- threeML.test.test_UnresolvedExtendedXYLike module
- threeML.test.test_XYLike module
- threeML.test.test_analysis_results module
- threeML.test.test_basic module
- threeML.test.test_bayesian module
- threeML.test.test_catalogs module
- threeML.test.test_configuration module
- threeML.test.test_download_GBM_data module
- threeML.test.test_download_LAT_data module
- threeML.test.test_event_list module
- threeML.test.test_file_utils module
- threeML.test.test_fits_file module
- threeML.test.test_fitted_point_sources module
- threeML.test.test_generic module
- threeML.test.test_get_package_data module
- threeML.test.test_goodness_of_fit module
- threeML.test.test_hawc module
- threeML.test.test_histogram module
- threeML.test.test_joint_likelihood_set module
- threeML.test.test_minimizers module
- threeML.test.test_model_from_catalog module
- threeML.test.test_ogip module
- threeML.test.test_photometry_utils module
- threeML.test.test_plotting module
- threeML.test.test_plugin_loading module
- threeML.test.test_power_of_two_utils module
- threeML.test.test_response module
- threeML.test.test_spectrum_class module
- threeML.test.test_spectrumlike module
- threeML.test.test_time_energy_fit module
- threeML.test.test_time_interval module
- threeML.test.test_time_series module
- threeML.test.test_unbinned_poisson_like module
- threeML.test.test_verbosity module
- Module contents
- threeML.utils package
- Subpackages
- threeML.utils.OGIP package
- threeML.utils.data_builders package
- threeML.utils.data_download package
- threeML.utils.fitted_objects package
- threeML.utils.photometry package
- threeML.utils.polarization package
- threeML.utils.spectrum package
- threeML.utils.statistics package
- threeML.utils.time_series package
- Submodules
- threeML.utils.bayesian_blocks module
- threeML.utils.binner module
- threeML.utils.cartesian module
- threeML.utils.differentiation module
- threeML.utils.fermi_relative_mission_time module
- threeML.utils.histogram module
- threeML.utils.interval module
Interval
IntervalSet
IntervalSet.INTERVAL_TYPE
IntervalSet.absolute_start
IntervalSet.absolute_stop
IntervalSet.argsort()
IntervalSet.bin_stack
IntervalSet.containing_bin()
IntervalSet.containing_interval()
IntervalSet.edges
IntervalSet.extend()
IntervalSet.from_list_of_edges()
IntervalSet.from_starts_and_stops()
IntervalSet.from_strings()
IntervalSet.is_contiguous()
IntervalSet.is_sorted
IntervalSet.merge_intersecting_intervals()
IntervalSet.mid_points
IntervalSet.new()
IntervalSet.new_interval()
IntervalSet.pop()
IntervalSet.sort()
IntervalSet.starts
IntervalSet.stops
IntervalSet.to_string()
IntervalSet.widths
IntervalsDoNotOverlap
IntervalsNotContiguous
- threeML.utils.numba_utils module
- threeML.utils.power_of_two_utils module
- threeML.utils.progress_bar module
- threeML.utils.step_parameter_generator module
- threeML.utils.string_utils module
- threeML.utils.time_interval module
- threeML.utils.unique_deterministic_tag module
- Module contents
- Subpackages
Submodules
threeML.analysis_results module
- class threeML.analysis_results.ANALYSIS_RESULTS(analysis_results)[source]
Bases:
FITSExtension
Represents the ANALYSIS_RESULTS extension of a FITS file encoding the results of an analysis
- Parameters:
analysis_results (_AnalysisResults)
- class threeML.analysis_results.ANALYSIS_RESULTS_HDF(analysis_results, hdf_obj)[source]
Bases:
object
- class threeML.analysis_results.AnalysisResultsFITS(*analysis_results, **kwargs)[source]
Bases:
FITSFile
A FITS file for storing one or more results from 3ML analysis
- class threeML.analysis_results.AnalysisResultsSet(results)[source]
Bases:
Sequence
A container for results which behaves like a list (but you cannot add/remove elements).
You can index (analysis_set[0]), iterate (for item in analysis_set) and measure with len()
- characterize_sequence(name, data_tuple)[source]
Characterize the sequence of these results. The provided data frame will be saved along with the results in the “SEQUENCE” extension to allow the interpretation of the results.
This method is completely general, and allow for a lot of flexibility.
If this is a binned analysis and you only want to save the lower and upper bound of the bins, use set_bins instead.
If you only want to associate one quantity for each entry, use set_x.
- set_bins(name, lower_bounds, upper_bounds, unit=None)[source]
Associate the provided bins with these results. These bins will be written in the SEQUENCE extension when saving these results to a FITS file
- Parameters:
name – a name for these bins (for example, “time” or “energy”). Please use only letters and numbers
(no special characters) :param lower_bounds: :param upper_bounds: :param unit: unit for the boundaries (like “s” for seconds, or a astropy.units.Unit instance) :return:
- set_x(name, x, unit=None)[source]
Associate the provided x with these results. The values in x will be written in the SEQUENCE extension when saving these results to a FITS file.
- Parameters:
name – a name for this sequence (for example, “time” or “energy”). Please use only letters and numbers
(no special characters) :param x: :param unit: unit for x (like “s” for seconds, or a astropy.units.Unit instance) :return:
- class threeML.analysis_results.BayesianResults(optimized_model, samples, posterior_values, statistical_measures, log_probabilty)[source]
Bases:
_AnalysisResults
Store results of a Bayesian analysis (i.e., the samples) and allow for computation with them and “error propagation”
- Parameters:
optimized_model – a Model instance with the MAP values of the parameters. A clone will be stored within
the class, so there is no need to clone it before hand :type optimized_model: astromodels.Model :param samples: the samples for the parameters :type samples: np.ndarray :param posterior_values: a dictionary containing the posterior values for the different datasets at the HPD :type posterior_values: dict
- comparison_corner_plot(*other_fits, **kwargs)[source]
Create a corner plot from many different fits which allow for co-plotting of parameters marginals.
- Parameters:
other_fits – other fitted results
parameters – parameters to plot
renamed_parameters – a python dictionary of parameters to rename. Useful when e.g. spectral indices in models have different names but you wish to compare them. Format is {‘old label’: ‘new label’}
names – (optional) name for each chain first name is this chain followed by each added chain
kwargs – chain consumer kwargs
- Returns:
Returns:
- convergence_plots(n_samples_in_each_subset, n_subsets)[source]
Compute the mean and variance for subsets of the samples, and plot them. They should all be around the same values if the MCMC has converged to the posterior distribution.
The subsamples are taken with two different strategies: the first is to slide a fixed-size window, the second is to take random samples from the chain (bootstrap)
- Parameters:
n_samples_in_each_subset – number of samples in each subset
n_subsets – number of subsets to take for each strategy
- Returns:
a matplotlib.figure instance
- corner_plot(renamed_parameters: Dict | None = None, components: List | None = None, **kwargs)[source]
Produce the corner plot showing the marginal distributions in one and two directions.
- Parameters:
renamed_parameters – a python dictionary of parameters to rename. Useful when e.g. spectral indices in models have different names but you wish to compare them. Format is {‘old label’: ‘new label’}, where ‘old label’ is the full path of the parameter
components – a python list of parameter paths to use in the corner plot
kwargs – arguments to be passed to the corner function
- Returns:
a matplotlib.figure instance
- corner_plot_cc(parameters=None, renamed_parameters=None, **cc_kwargs)[source]
Corner plots using chainconsumer which allows for nicer plotting of marginals see: https://samreay.github.io/ChainConsumer/chain_api.html#chainconsumer.ChainConsumer.configure for all options :param parameters: list of parameters to plot :param renamed_parameters: a python dictionary of parameters to rename.
Useful when e.g. spectral indices in models have different names but you wish to compare them. Format is {‘old label’: ‘new label’}
- Parameters:
**cc_kwargs –
chainconsumer general keyword arguments
- Return fig:
- static freedman_diaconis_rule(data)[source]
Returns the number of bins from the Freedman-Diaconis rule for a histogram of the given data
- Parameters:
data – an array of data
- Returns:
the optimal number of bins
- get_correlation_matrix()[source]
Estimate the covariance matrix from the samples
- Returns:
the correlation matrix
- get_highest_density_posterior_interval(parameter, cl=0.68)[source]
returns the highest density posterior interval for that parameter
- Parameters:
parameter_path – path of the parameter or parameter instance
cl – credible interval to obtain
- Returns:
(low bound, high bound)
- property log_probability
The log probability values
- Returns:
- class threeML.analysis_results.MLEResults(optimized_model, covariance_matrix, likelihood_values, n_samples=5000, statistical_measures=None)[source]
Bases:
_AnalysisResults
Build the _AnalysisResults object starting from a covariance matrix.
- Parameters:
optimized_model – best fit model
:type optimized_model:astromodels.Model :param covariance_matrix: :type covariance_matrix: np.ndarray :param likelihood_values: :type likelihood_values: dict :param n_samples: Number of samples to use :type n_samples: int :return: an _AnalysisResults instance
- property covariance_matrix
Returns the covariance matrix.
- Returns:
covariance matrix or None (if the class was built from samples. Use estimate_covariance_matrix in that case)
- class threeML.analysis_results.SEQUENCE(name, data_tuple)[source]
Bases:
FITSExtension
Represents the SEQUENCE extension of a FITS file containing a set of results from a set of analysis
- threeML.analysis_results.load_analysis_results(fits_file: str) _AnalysisResults [source]
Load the results of one or more analysis from a FITS file produced by 3ML
- Parameters:
fits_file – path to the FITS file containing the results, as output by MLEResults or BayesianResults
- Returns:
a new instance of either MLEResults or Bayesian results dending on the type of the input FITS file
- threeML.analysis_results.load_analysis_results_hdf(hdf_file: str) _AnalysisResults [source]
Load the results of one or more analysis from a FITS file produced by 3ML
- Parameters:
fits_file – path to the FITS file containing the results, as output by MLEResults or BayesianResults
- Returns:
a new instance of either MLEResults or Bayesian results dending on the type of the input FITS file
threeML.data_list module
threeML.plugin_prototype module
Define the interface for a plugin class.
- class threeML.plugin_prototype.PluginPrototype(name: str, nuisance_parameters: Dict[str, Parameter])[source]
Bases:
object
- exclude_from_fit(flag=False)[source]
This can be used to explude a plug in from the fit :param flag: True or Fase (default) :return:
- abstract get_log_like() float [source]
Return the value of the log-likelihood with the current values for the parameters
- get_number_of_data_points() int [source]
This returns the number of data points that are used to evaluate the likelihood. For binned measurements, this is the number of active bins used in the fit. For unbinned measurements, this would be the number of photons/particles that are evaluated on the likelihood
- abstract inner_fit()[source]
This is used for the profile likelihood. Keeping fixed all parameters in the LikelihoodModel, this method minimize the logLike over the remaining nuisance parameters, i.e., the parameters belonging only to the model for this particular detector. If there are no nuisance parameters, simply return the logLike value.
- property name: str
Returns the name of this instance
- Returns:
a string (this is enforced to be a valid python identifier)
- property nuisance_parameters: Dict[str, Parameter]
Returns a dictionary containing the nuisance parameters for this dataset
- Returns:
a dictionary
- abstract set_model(likelihood_model_instance: Model)[source]
Set the model to be used in the joint minimization. Must be a LikelihoodModel instance.
- property tag
Gets/sets the tag for this instance, as (independent variable, start, [end])
threeML.random_variates module
- class threeML.random_variates.RandomVariates(input_array, value=None)[source]
Bases:
ndarray
A subclass of np.array which is meant to contain samples for one parameter. This class contains methods to easily compute properties for the parameter (errors and so on)
- property average
Returns average value
- equal_tail_interval(cl=0.68)[source]
Returns the equal tail interval, i.e., an interval centered on the median of the distribution with the same probability on the right and on the left of the mean.
If the distribution of the parameter is Gaussian and cl=0.68, this is equivalent to the 1 sigma confidence interval.
- Parameters:
cl – confidence level (0 < cl < 1)
- Returns:
(low_bound, hi_bound)
- highest_posterior_density_interval(cl=0.68)[source]
Returns the Highest Posterior Density interval (HPD) for the parameter, for the given credibility level.
NOTE: the returned interval is the HPD only if the posterior is not multimodal. If it is multimodal, you should probably report the full posterior, not only an interval.
- Parameters:
cl – credibility level (0 < cl < 1)
- Returns:
(low_bound, hi_bound)
- property median
Returns median value
- property samples
- property std
Returns sample std value
- property value
- property var
Returns sample variance value