load_Nautilus_chains_from_txt#

cosmicjellyfish.analysis.fishconsumer.load_Nautilus_chains_from_txt(filename, param_cols, log_weights=False)[source]#

Load Nautilus chains from a text file.

The file is the one written by NautilusSampler, with columns <params...> weights loglike. The last two columns are returned as weight and posterior. Note that posterior holds the log-likelihood stored by the sampler (the name is kept for ChainConsumer and backwards compatibility); it equals the log-posterior only for flat priors.

Parameters:
  • filename (str) – Path to the chain .txt file.

  • param_cols (list or dict) – Names of the sampled parameters, in the column order of the file (a dict is converted to its keys). Read them from the chain header if unsure.

  • log_weights (bool, optional) – If True, the weight column holds log-weights and is exponentiated.

Returns:

Samples with non-zero weight.

Return type:

pandas.DataFrame