Skip to content

Code to compute the 3x2pt Gaussian and non-Gaussian covariance

License

Notifications You must be signed in to change notification settings

sambit-giri/Spaceborne

 
 

Repository files navigation

Spaceborne


Documentation Status

Installation

We recommend using Spaceborne in a dedicated Conda environment. This ensures all dependencies are properly managed.

1. Create the environment and install dependencies

In the root folder of the Spaceborne repository, run:

$ conda env create -f environment.yaml
$ conda activate spaceborne

🐍 note: using mamba instead of conda in the first line will significantly speed up the environment creation. To install mamba, run conda install mamba in your base environment)

Spaceborne uses CCL as the backend library for many cosmological calculations. Some installation issues have been found with its Python wrapper pyccl; in case of problems with this package, please refer to the official instructions (see also the CCL GitHub page). To facilitate the process, however, its main dependencies - Swig and CMake - have already been included in the environment, so after creating and activating it, a simple

$ conda install -c conda-forge pyccl

or

$ pip install pyccl

should do the job.

If the problem persists, you can try with

$ sudo apt-get install gfortran cmake build-essential autoconf bison

on Linux and

$ brew install gfortran cmake build-essential autoconf bison

on OSX. The installation on Windows machines is not supported.


2. Install Spaceborne

Option A: Using pip

To install Spaceborne directly:

$ pip install .

Option B: Using Poetry

Poetry is an alternative package manager. To use it:

  1. Install Poetry:
    $ curl -sSL https://install.python-poetry.org | python3 -
  2. Install Spaceborne:
    $ poetry install

3. Install Julia for Computational Efficiency

Spaceborne leverages julia for computationally intensive tasks. We recommend installing julia via juliaup:

$ curl -fsSL https://install.julialang.org | sh  # Install juliaup
$ juliaup default 1.10                           # Install Julia version 1.10

Then, install the required Julia packages:

$ julia -e 'using Pkg; Pkg.add("LoopVectorization"); Pkg.add("YAML"); Pkg.add("NPZ")'

Running the Code

All the available options and configurations can be found, along with their explanation, in the config.yaml file. To run Spaceborne with the configuration specified in the Spaceborne/config.yaml file, simply execute the following command:

$ python main.py

If you want to use a configuration file with a different name and/or location, you can instead run with

$ python main.py --config=<path_to_config_file>

for example:

$ python main.py --config="path/to/my/config/config.yaml"

To display the plots generated by the code, add the --show_plots flag:

$ python main.py --config="path/to/my/config/config.yaml" --show_plots

About

Code to compute the 3x2pt Gaussian and non-Gaussian covariance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.4%
  • Julia 2.6%