PyBORG root module

PyBORG is a complete binding of the borg machine to python. The borg module can be imported either from a normal python interpret or from the embedded python in hades_python.

Be aware that you cannot import directly any of the native modules. To import all borg facilities, it is required and sufficient to just execute import aquila_borg. It will provide all the modules such as aquila_borg.cosmo or aquila_borg.samplers.

Note: The borg module may be installed as an alias to aquila_borg. However the package name is the same as the one used by BorgBackup. Thus there may be clashes between these two softwares. It is advised to use aquila_borg to avoid conflicts.

aquila_borg.borgConsole(original=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)

Setup a clean redirection of BORG output, notably in presence of MPI4PY.

Keyword Arguments

original (file-like) – Where to send the console to (default: sys.stdout)

aquila_borg.buildDefaultChain(box, cosmo_pars, a_init, model)

Build a default BORG chain from a model. This remove the hastle of setting up a primordial fluctuation generator, and the cosmological parameters.

Parameters
  • box (borg.forward.BoxModel) – the specification of the box for the simulation

  • cosmo_pars (borg.cosmo.CosmologicalParameters) – the cosmology chosen

  • a_init (float) – the starting scale factor for model

  • model (borg.forward.BORGForwardModel) – the model to be chained with

Returns

a newly built chain for cosmology

Return type

borg.forward.BORGForwardModel

class aquila_borg.Console

This is the Console class. It allows doing pretty printing of the message from the borg system. It dispatches the message to the appropriate log files and the adequate level asked by the user. The Console object cannot be constructed from Python. To get a Console object use aquila_borg.console.

outputToFile(self: aquila_borg._borg.Console, arg0: str) → None
Parameters

filename (str) – the filename to output the full log to

printStackTrace(self: aquila_borg._borg.Console) → None
print_debug(self: aquila_borg._borg.Console, arg0: str) → None
print_error(self: aquila_borg._borg.Console, arg0: str) → None
print_std(self: aquila_borg._borg.Console, arg0: str) → None

Prints a message to the console

Parameters

message (str) – the message to be printed at the Standard level

print_warning(self: aquila_borg._borg.Console, arg0: str) → None
setVerboseLevel(self: aquila_borg._borg.Console, level: int = 2) → None
aquila_borg.console() → aquila_borg._borg.Console

This function returns the valid already created Console object.

aquila_borg.memoryReport() → Dict[str, aquila_borg._borg._memoryDetail]

Cosmology computations

This module includes the basic components to describe and to do cosmological computations.

CosmologicalParameters

Class that holds the values of all cosmological parameters relevant to the BORG framework.

Cosmology

Class to compute different quantities for an homogeneous universe and given cosmological parameters

CosmoPower

Construct a new CosmoPower object from the given cosmological parameters.

ClassCosmo

Builds a new object ClassCosmo.

Likelihood and associated structures

This module includes the basic components to use BORG likelihoods and develop new likelihoods to mesh with the existing framework.

MarkovState

Create a new MCMC dictionnary.

Likelihood3d

Base class to represent 3d likelihoods in BORG.

ForwardModelLikelihood3d

BaseLikelihood

LikelihoodInfo

GaussianPassthrough

GaussianLinear

PoissonPowerLaw

Samplers and sampler algorithms

This module includes the basic components to generate new samplers in a block sampling strategy.

MarkovSampler

PyBaseSampler

PyBaseSampler class to implement MarkovSampler object from python.

slice_sampler(state, callback, …)

Basic slice_sampler implementation.

GenericBiasSampler

This is a sampler that will run a slice sampler for each bias parameter of catalog.

BiasModelParamsSampler

A sampler that sample bias parameters using the borg forward model strategy.

HMCDensitySampler

Build a new HMC based density sampler.

ModelParamsSampler

Build a new model params sampler.

Sigma8Sampler

Build a new sigma8 sampler.

AltairMetaSampler

Build a new sampler for altair

BORG forward model

This module includes the basic components to manipulate forward models.

PreferredIO

Enumeration to specify the preferred Input/Output of a forward model

BoxModel

BORGForwardModel

Base class for all forward models.

ParticleBasedForwardModel

Special abstract class to provide an API to access to particles used in the forward computation of certain models.

BaseForwardModel

Base class for implementing new forward model in python

ChainForwardModel

This is a forward model to chain several others.

Standard BORG forward models

This module includes direct access to a number of fundamental forward models.

HermiticEnforcer

Enforce the hermiticity of the input complex field.

Primordial

EisensteinHu

Downgrade

Transfer

Forward model to apply a transfer function (not necessarily isotropic) to the input field

HadesLinear

Do nothing but Eulerian linear perturbation scaling

HadesLog

Applies an exponential transform to the real space field.

BorgLpt

This class binds the borg LPT forward model (CIC mass assignment).

BorgLptOpenMP

This class binds the borg LPT forward model (CIC/OpenMP mass assignment).

BorgLptNGP_Double

This class binds the borg LPT forward model (NGP double mass assignment).

BorgLptNGP_Quad

This class binds the borg LPT forward model (NGP quad mass assignment).

BorgLptSmoothNGP_Quad

This class binds the borg LPT forward model (Smooth NGP quad mass assignment).

Borg2Lpt

param box

BORG 3d box descriptor of the input

BorgPM

newModel(arg0, arg1, arg2)

Builds a new forward model object from its named.

listModels()

List the available forward models using their internal name.

Velocity field computations

This module includes the components to compute velocity field from result of forward models.

VelocityBase

This is the base class for models that compute velocity field from a forward model output.

ParticleBasedModel

ParticleBasedModel is the base class for the computation of velocity field from forward model that are particle based (such as aquila_borg.forward.models.BorgLpt or aquila_borg.forward.models.BorgPm).

CICModel

This class implements the Cloud-In-Cell (CIC) model for velocity field computation.

SICModel

This class implements Simplex-In-Cell (SIC) model for the velocity field computation.