Skip to content

Commit 1a3709e

Browse files
authored
Merge pull request #61 from PSims/restructure
Restructure repository, improve the user interface, and add module-level functionality to replace the previously required data and beam preprocessing scripts.
2 parents f63c79e + 00f53dd commit 1a3709e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+7563
-5343
lines changed

README.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ BayesEoR
22
========
33

44
[![DOI](https://joss.theoj.org/papers/10.21105/joss.06667/status.svg)](https://doi.org/10.21105/joss.06667)
5+
[![Docs](https://app.readthedocs.org/projects/bayeseor/badge/?version=latest)](https://bayeseor.readthedocs.io/en/latest/)
56

67
A Bayesian approach to estimating the power spectrum of the Epoch of Reionization (EoR) from interferometric observations.
78

89
BayesEoR provides a means of performing a joint Bayesian analysis of models for large-spectral-scale foreground emission and a stochastic signal from redshifted 21-cm emission emitted by neutral Hydrogen during the EoR.
910

1011
For a detailed description of the methodology, see [Sims et al. 2016](https://ui.adsabs.harvard.edu/link_gateway/2016MNRAS.462.3069S/doi:10.1093/mnras/stw1768) and [Sims et al. 2019](https://ui.adsabs.harvard.edu/link_gateway/2019MNRAS.484.4152S/doi:10.1093/mnras/stz153). For more detail on the methodology and demonstrations using simulated data, see [Sims and Pober 2019](https://ui.adsabs.harvard.edu/link_gateway/2019MNRAS.488.2904S/doi:10.1093/mnras/stz1888) and [Burba et al. 2023](https://ui.adsabs.harvard.edu/abs/2023MNRAS.520.4443B/abstract).
1112

13+
14+
# Documentation
15+
16+
Documentation on how to estimate the power spectrum of redshifted 21-cm emission in a radio interferometric data set using BayesEoR is hosted on [ReadTheDocs](https://bayeseor.readthedocs.io/en/latest/). Below, we provide a brief summary of BayesEoR's installation and use. However, the docs provide more detail and example demonstrations of using BayesEoR with the provided test datasets in `test_data/`.
17+
18+
1219
# Installation
1320

1421
### Hardware/Software Dependencies
@@ -20,14 +27,14 @@ BayesEoR relies on GPUs to perform a Cholesky decomposition on large matrices us
2027
- [MultiNest](https://github.com/JohannesBuchner/MultiNest)
2128
<!-- - [PolyChord](https://cobaya.readthedocs.io/en/latest/sampler_polychord.html) (better performance than MultiNest for large parameter spaces) -->
2229

23-
BayesEoR has been succesfully run with:
30+
BayesEoR has been successfully run with:
2431
- **GPUs:** NVIDIA P100, V100, and A100 architectures
25-
- **MAGMA:** 2.4.0, 2.5.4, and 2.7.1
26-
- **MPI:** `conda` installation (mpich) and OpenMPI 4.0.5
32+
- **MAGMA:** `conda-forge` and source installations
33+
- **MPI:** `conda-forge` installation (mpich) and OpenMPI 4.0.5
2734
- **CUDA:** 9.1.85.1 and 11.1.1
28-
- **MultiNest:** `conda` installation and a source installation
35+
- **MultiNest:** `conda-forge` and source installations
2936

30-
This is not an exhaustive list of software versions which are compatible with our analysis, just a guide of what versions we have used succesfully in our BayesEoR analyses.
37+
This is not an exhaustive list of software versions which are compatible with our analysis, just a guide of what versions we have used successfully in our BayesEoR analyses.
3138

3239
#### A Note on Using CPUs
3340

@@ -55,48 +62,45 @@ BayesEoR is written primarily in python, with the exception of the MAGMA interfa
5562
- setuptools_scm
5663
- sphinx
5764

58-
If you with to install all of these dependencies with `conda`, you can do so using the included `environment.yaml` file via
65+
If you with to install all of these dependencies with `mamba` (recommended) or `conda`, you can do so using the included `environment.yaml` file via
5966
```
60-
conda env create -f environment.yaml
67+
mamba env create -f environment.yaml
6168
```
69+
If using `conda`, you can replace `mamba` with `conda` in the above command.
6270

63-
If you have pre-configured installations of CUDA or MPI, e.g. installations optimized/configured for a compute cluster, we suggest installing `pycuda` and/or `mpi4py` via `pip` (and commenting out `pycuda` and `mpi4py` in the `environment.yaml` file). If you install these dependencies with `conda`, `conda` will install its own CUDA and MPI binaries which may not be desirable. For `pycuda`, you need only have the path to your cuda binaries in your bash `PATH` variable prior to `pip` installation. For `mpi4py`, see [this article](https://researchcomputing.princeton.edu/support/knowledge-base/mpi4py) to ensure `mpi4py` points to the desired MPI installation.
71+
If you have a pre-configured installation of MPI, e.g. one optimized/configured for a particular compute cluster, we suggest commenting out `mpi4py` in `environment.yaml` and installing `mpi4py` via `pip`. For `mpi4py`, see [this article](https://researchcomputing.princeton.edu/support/knowledge-base/mpi4py) to ensure `mpi4py` points to the desired MPI installation.
6472

65-
Similarly, if using a pre-configured implementation of MultiNest, pymultinest can also be installed with `pip` and forced to point to a particular installation by including the MultiNest installation in your `LD_LIBRARY_PATH`. See the pymultinest [documentation](https://johannesbuchner.github.io/PyMultiNest/install.html) for more details.
73+
Similarly, if using a pre-configured implementation of MultiNest, `pymultinest` can also be installed via `pip` and forced to point to a particular installation by including the desired MultiNest installation in your `LD_LIBRARY_PATH`. See the `pymultinest` [documentation](https://johannesbuchner.github.io/PyMultiNest/install.html) for more details.
6674

6775

68-
# Documentation
76+
# Running BayesEoR
77+
78+
There are two ways to interface with variables in BayesEoR: a yaml configuration file (recommended) or command line arguments. For a list of available command line arguments and their descriptions, run
79+
```
80+
python scripts/run-analysis.py --help
81+
```
82+
or see the [documentation](https://bayeseor.readthedocs.io/en/latest/) for more info on the analysis parameters used by BayesEoR.
83+
84+
The `jsonargparse` package allows for all of these command line arguments to be set via a yaml configuration file. Two example yaml files have been provided: `test_data/eor/config.yaml` and `test_data/eor_fgs/config.yaml`. These example configuration files specify the minimally sufficient variables that must be set for a BayesEoR analysis of EoR only or EoR + foregrounds, respectively. Any variable that can be set via a command line argument can also be set in a yaml configuration file (command line arguments containing dashes in the variable name must be replaced with underscores, i.e. the command line argument `--data-path` can be set in the configuration file via `data_path: "/path/to/data.uvh5"`).
6985

70-
Documentation on how to estimate the power spectrum of redshifted 21-cm emission in a radio interferometric data set using BayesEoR is hosted on [ReadTheDocs](https://bayeseor.readthedocs.io/en/latest/).
86+
`scripts/run-analysis.py` provides an example driver script for running BayesEoR. This file contains all of the necessary steps to set up the `PowerSpectrumPosteriorProbability` class and to run MultiNest and obtain power spectrum posteriors. If using a configuration file, this driver script can be run via
87+
```
88+
python scripts/run-analysis.py --config /path/to/config.yaml
89+
```
7190

7291

7392
# Citation
7493

7594
Users of the code are requested to cite the BayesEoR papers:
7695

77-
- https://ui.adsabs.harvard.edu/abs/2016MNRAS.462.3069S/abstract
78-
- https://ui.adsabs.harvard.edu/abs/2019MNRAS.484.4152S/abstract
79-
- https://ui.adsabs.harvard.edu/abs/2019MNRAS.488.2904S/abstract
80-
- https://ui.adsabs.harvard.edu/abs/2023MNRAS.520.4443B/abstract
96+
- [Sims et al. 2016](https://ui.adsabs.harvard.edu/abs/2016MNRAS.462.3069S/abstract)
97+
- [Sims et al. 2019a](https://ui.adsabs.harvard.edu/abs/2019MNRAS.484.4152S/abstract)
98+
- [Sims et al. 2019b](https://ui.adsabs.harvard.edu/abs/2019MNRAS.488.2904S/abstract)
99+
- [Burba et al. 2023](https://ui.adsabs.harvard.edu/abs/2023MNRAS.520.4443B/abstract)
81100

82101
in their publications.
83102

84103

85-
# Running BayesEoR
86-
87-
There are two ways to interface with variables in BayesEoR: command line arguments or config files. For a list of available command line arguments and their descriptions, run
88-
```
89-
python run-analysis.py --help
90-
```
91-
or see the [documentation](https://bayeseor.readthedocs.io/en/latest/) for more info on the analysis parameters used by BayesEoR.
92-
93-
The `jsonargparse` package allows for all of these command line arguments to be set via a yaml configuration file. An example yaml file has been provided (`example-config.yaml`). Any variable that can be set via a command line argument can also be set in this yaml configuration file (command line arguments containing dashes in the variable name must be replaced with underscores, i.e. the command line argument `--data-path` can be set in the configuration file via `data_path: "/path/to/data.npy"`). The example configuration file also specifies the minimally sufficient variables that must be set for a BayesEoR analysis.
94-
95-
`run-analysis.py` provides an example driver script for running BayesEoR. This file contains all of the necessary steps to set up the `PowerSpectrumPosteriorProbability` class and to run MultiNest and obtain power spectrum posteriors. If using a configuration file, this driver script can be run via
96-
```
97-
python run-analysis.py --config /path/to/config.yaml
98-
```
99-
100104
# How to contribute
101105

102106
BayesEoR is an open source project and contributions to this package in any form are very welcome (e.g. new features, feature requests, bug reports, documentation fixes). Please make such contributions in the form of an issue and/or pull request. For any additional questions or comments, please contact one of the BayesEoR project managers:

bayeseor/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@
88
except PackageNotFoundError:
99
# package is not installed
1010
__version__ = "unknown"
11-
12-
from . import matrices, model, params, posterior, utils

bayeseor/analyze/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .analyze import *

0 commit comments

Comments
 (0)