getdist.cosmosis_interface¶
File with tools to interface Cosmosis runs with GetDist.
chain = loadMCSamples(‘./../test_chains/1p2_SN1_zcut0p3_abs’) chain_root = ‘./../test_chains/d_1sigD_s8/d_TTlite_1sigD_s8_noisy_poly_chain’ chain_root = ‘./../test_chains/d_1sigD_s8’ param_label_dict=None
-
getdist.cosmosis_interface.
MCSamplesFromCosmosis
(chain_root, param_label_dict=None, name_tag=None, settings=None)[source]¶ Function to import Cosmosis chains in GetDist.
Parameters: - chain_root – the name and path to the chain or the path to the folder that contains it.
- param_label_dict – dictionary with the mapping between parameter names and parameter labels, since Cosmosis does not save the labels in the chain.
- name_tag – a string with the name tag for the chain.
- settings – dictionary of analysis settings to override defaults
Returns: The
MCSamples
instance
-
getdist.cosmosis_interface.
get_cosmosis_info
(file)[source]¶ Parse a file to get all the information about a Cosmosis run.
Parameters: file – path and name of the file to parse. Returns: a list of strings with the cosmosis parameters for the run.
-
getdist.cosmosis_interface.
get_maximum_likelihood
(chain_root, param_label_dict)[source]¶ Import the maximum likelihood file for a Cosmosis run, if present.
Parameters: - chain_root – name of the chain file or the folder that contains it.
- param_label_dict – dictionary with the mapping between the parameter names and the labels.
Returns: BestFit
the best fit object.
-
getdist.cosmosis_interface.
get_name_tag
(info)[source]¶ Get the name tag for a chain given the a list of strings containing the cosmosis run parameter informations.
Parameters: info – a list of strings with the cosmosis parameters for the run. Returns: a string with the name tag if any, otherwise returns none.
-
getdist.cosmosis_interface.
get_param_labels
(info, param_names, param_label_dict)[source]¶ Get the labels for the parameter names of a Cosmosis run.
Parameters: - info – a list of strings with the cosmosis parameters for the run.
- param_names – a list of strings with the parameter names.
- param_label_dict – a dictionary with the mapping between names and labels.
Returns: a list of strings with the parameter labels.
-
getdist.cosmosis_interface.
get_param_names
(info)[source]¶ Get the parameter names for a Cosmosis run.
Parameters: info – a list of strings with the cosmosis parameters for the run. Returns: a list of strings with the parameter names.
-
getdist.cosmosis_interface.
get_ranges
(info, param_names)[source]¶ Get the ranges for the parameters from the info file.
Parameters: - info – a list of strings with the cosmosis parameters for the run.
- param_names – a list with the parameter names.
Returns: a dictionary with the parameter ranges.
-
getdist.cosmosis_interface.
get_sampler_type
(info)[source]¶ Get the sampler type for a chain given the a list of strings containing the cosmosis run parameter informations. To process the sampler type the function defines internally a dictionary with the mapping from sampler name to sampler type.
Parameters: info – a list of strings with the cosmosis parameters for the run. Returns: a string with the sampler type if any, otherwise returns none.