jar

This module contains general purpose functions that are used throughout PBjam.

pbjam.jar.get_percentiles(X, nsigma=2, **kwargs)[source]

Get percentiles of an distribution

Compute the percentiles corresponding to sigma=1,2,3.. including the median (50th), of an array.

Parameters:
  • X (numpy.array()) – Array to find percentiles of
  • sigma (int, optional.) – Sigma values to compute the percentiles of, e.g. 68% 95% are 1 and 2 sigma, etc. Default is 2.
  • kwargs (dict) – Arguments to be passed to numpy.percentile
Returns:

percentiles – Numpy array of percentile values of X.

Return type:

numpy.array()

pbjam.jar.get_priorpath()[source]

Get default prior path name

Returns:prior_file – Default path to the prior in the package directory structure.
Return type:str
pbjam.jar.isvalid(number)[source]

Checks if number is finite.

Parameters:number (object) –
Returns:x – Whether number a real float or not.
Return type:bool
pbjam.jar.normal(x, mu, sigma)[source]

Evaluate logarithm of normal distribution (not normalized!!)

Evaluates the logarithm of a normal distribution at x.

x : float
Values to evaluate the normal distribution at.
mu : float
Distribution mean.
sigma : float
Distribution standard deviation.
Returns:y – Logarithm of the normal distribution at x
Return type:float
class pbjam.jar.references[source]

A class for managing references used when running PBjam.

This is inherited by session and star.

bibfile

The pathname to the pbjam references list.

Type:str
_reflist

List of references that is updated when new functions are used.

Type:list
bibdict

Dictionary of bib items from the PBjam reference list.

Type:dict
pbjam.jar.to_log10(x, xerr)[source]

Transform to value to log10

Takes a value and related uncertainty and converts them to logscale. Approximate.

Parameters:
  • x (float) – Value to transform to logscale
  • xerr (float) – Value uncertainty
Returns:

logval – logscaled value and uncertainty

Return type:

list