Installation

Obtaining the code and virtual environment

Important note: BASTA is currently developed for Python 3.11.

Start out by obtaining a copy of BASTA; either by cloning the GitHub repository or downloadning a source code release. As a default, we recommend that you install basta in the folder ~/BASTA. If you have a user on GitHub and use an ssh-keypair, you can simply run:

git clone git@github.com:BASTAcode/BASTA.git

If you prefer to enter username and password instead of a key-pair run:

git clone https://github.com/BASTAcode/BASTA.git

Now, assuming you have downloaded the code, run the following to setup a virtual environment (feel free to do it any other way you prefer; we strongly recommend to install the code in a fresh virtual environment):

cd BASTA
python3 -m venv bastaenv
source bastaenv/bin/activate

Then you can install the code and dependencies into the virtual environment:

pip install -e .

Before first use

To finalise the setup, download a example grid, and obtain the dustmaps, simply run the following from the BASTA directory:

BASTAdownload

Glitch-fitting and Fortran modules

Important note: Please note that the instructions in this section will fail for Python 3.12.

In case you need to fit glitches, you must compile the external Fortran-modules:

cd basta/
f2py -c glitch_fq.f95 -m glitch_fq
f2py -c glitch_sd.f95 -m glitch_sd
f2py -c icov_sd.f95 -m icov_sd
f2py -c sd.f95 -m sd

Git hooks

If you don’t want to contribute to BASTA, you can safely skip this section!

BASTA uses pre-commit to manage git hooks, and the final setup task is to activate them:

source venv/bin/activate
pre-commit install

It might take a minute or two to complete. Now, to ensure everything is correctly setup, run the command:

pre-commit run --all-files

It should pass all checks. BASTA is now ready to go.