Skip to main content
# Installing PyP-BEAGLE

* Make sure that you have a (science-ready!) installation of Python 2.7, for instance [Anaconda](https://www.continuum.io/downloads) (the Python 2.7 version)

* To install PyP-BEAGLE simply run
```
pip install pyp_beagle
```

# Known issues

* On a Mac OS, multiprocessing only works with the ``Agg`` backend. Make sure that your ``~/.matplotlib/matplotlibrc`` file contains the line
```
backend : Agg
```

* If you encounter errors related to LaTeX, or if the visual appearance of the plots is not satisfying, you can copy the matplotlib configuration file ``script/matplotlibrc`` into your ``$HOME/.matplotlib/`` folder (if the folder does not exist, create it). If you already have a customized ``matplotlibrc`` file, then you can use the GNU ``diff`` command to update it.

* PyP-BEAGLE assumes that the Beagle environment variables are correctly set on your machine. Note that while these are the same environment variables used by Docker-Beagle (see [here](https://github.com/jacopo-chevallard/BEAGLE-general/wiki#running-beagle)), they have to point to the actual folders on your machine, not to the "virtual" folder that Docker-Beagle uses. To correctly set the environment variables, you can use the ``scripts/BEAGLE_env_variable.bash`` or ``scripts/BEAGLE_env_variable.csh`` files. In practice, after modifying the file to reflect your Beagle folder tree, you can simply add at the end of your ``.bashrc`` (or ``.tcshrc``, or equivalent) the line
```bash
source <full path to the file>/BEAGLE_env_variable.bash
```

# Using PyP-BEAGLE

The post-processing of Beagle results obtained is performed by means of the command ``pyp_beagle``. You can visualize the possible command-line options of the script with the command
```csh
pyp_beagle --help
```

* [triangle plots](#plotting-the-posterior-probability-distributions-aka-triangle-plots)
* [marginal plots](#plotting-the-comparison-of-data-and-model-observables-aka-marginal-plots)
* [summary catalogue](#computing-a-summary-catalogue)
* [true vs retrieved parameters](#plotting-the-comparison-of-input-and-retrieved-parameters-when-fitting-mock-observations)

### Plotting the posterior probability distributions (aka "triangle plots")

#### Command

```csh
pyp_beagle -r <your Beagle results folder> \
--plot-triangle \
[-np <number of processors>] \
[--json-triangle <JSON triangle file>] \
[--mock-catalogue <input mock catalogue>] \
[--json-mock <JSON mock file>]
```

where
* ``<your Beagle results folder>`` must be replaced by the full path to the Beagle output directory;
* ``<number of processors>`` is an integer indicating how many processors can be used for the parallel execution of the script. This is particularly important when producing plots for large (> 1000) samples, as the creation of each individual plot can take several tens of seconds.
* ``<JSON triangle file>`` is a JSON file used for the configuration of the triangle plot (which parameters should be plotted, log scale, plot limits, ...), an example can be found [here](https://github.com/jacopo-chevallard/PyP-BEAGLE/blob/0996fd3c6b271e15452b7edee6627bc7fbc68675/PyP-BEAGLE/files/params_names.json);
* ``<input mock catalogue>`` indicates a Beagle FITS file containing the input (i.e. "true") physical parameters used to construct the noiseless SEDs which have then been fitted with Beagle (after the noise addition, which must be performed **outside** Beagle). Note that in this case, a ``<JSON mock file>`` must be passed, since we must instruct PyP-BEAGLE where (in which FITS extension and column) to find the "true" parameters. An example of the ``<JSON mock file>`` to be used in this case can be found [here](https://github.com/jacopo-chevallard/PyP-BEAGLE/blob/0996fd3c6b271e15452b7edee6627bc7fbc68675/PyP-BEAGLE/files/params_names_mock.json).


#### Output

The successful execution of the script will create a set of ``*_triangle.pdf`` files (one per object) in the ``<your Beagle results folder>/pyp-beagle/plot`` folder.


### Plotting the comparison of data and model observables (aka "marginal plots")

#### Command

```csh
pyp_beagle -r <your Beagle results folder> \
--plot-marginal \
[-np <number of processors>] \
[--log-wavelength] \
[--plot-line-labels] \
[--spectral-resolution <resolution>] \
```

where
* ``<your Beagle results folder>`` must be replaced by the full path to the Beagle output directory;
* ``<number of processors>`` is an integer indicating how many processors can be used for the parallel execution of the script. This is particularly important when producing plots for large (> 1000) samples, as the creation of each individual plot can take several tens of seconds;
* ``<resolution>`` is a float indicating the resolution of the spectra, and it is used to determine which emission line labels are printed on the plot.

#### Output

The successful execution of the script will create a set of ``*_marginal_SED_spec.pdf`` files (one per object) in the ``<your Beagle results folder>/pyp-beagle/plot`` folder.


### Computing a summary catalogue

#### Command

```csh
pyp_beagle -r <your Beagle results folder>
--compute-summary
[--json-summary <JSON summary file>]
```

where
* ``<your Beagle results folder>`` must be replaced by the full path to the Beagle output directory;
* ``<JSON summary file>`` is a JSON file used for the configuration of the summary catalogue, specifying for which parameters the summary statistics (posterior mean and median, 68 and 95 % credible regions) should be computed. An example can be found [here](https://github.com/jacopo-chevallard/PyP-BEAGLE/blob/0996fd3c6b271e15452b7edee6627bc7fbc68675/PyP-BEAGLE/files/summary_config.json).

#### Output

The successful execution of the script will create the file ``<your Beagle results folder>/pyp-beagle/data/BEAGLE_summary_catalogue.fits``.

### Plotting the comparison of input and retrieved parameters when fitting mock observations

#### Command

```csh
pyp_beagle -r <your Beagle results folder>
--mock-catalogue <input mock catalogue> \
--json-mock <JSON mock file>
```

where
* ``<your Beagle results folder>`` must be replaced by the full path to the Beagle output directory;
* ``<input mock catalogue>`` indicates a Beagle FITS file containing the input (i.e. "true") physical parameters used to construct the noiseless SEDs which have then been fitted with Beagle (after the noise addition, which must be performed **outside** Beagle). Note that in this case, a ``<JSON mock file>`` must be passed, since we must instruct PyP-BEAGLE where (in which FITS extension and column) to find the "true" parameters. An example of the ``<JSON mock file>`` to be used in this case can be found [here](https://github.com/jacopo-chevallard/PyP-BEAGLE/blob/0996fd3c6b271e15452b7edee6627bc7fbc68675/PyP-BEAGLE/files/params_names_mock.json).

#### Output

The successful execution of the script will create the files ``<your Beagle results folder>/pyp-beagle/plot/BEAGLE_mock_retrieved_params_hist.pdf`` and ``<your Beagle results folder>/pyp-beagle/plot/BEAGLE_mock_retrieved_params.pdf``.

Metadata

Release files for pyp-beagle 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyp-beagle 0.6.2
File Size Uploaded
pyp_beagle-0.6.2.tar.gz 63.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyp-beagle 0.6.2
File Interpreter ABI Platform
pyp_beagle-0.6.2-py2.7.egg Legacy Egg format - - Details

Total release size: 218.4 kB

Release files / pyp_beagle-0.6.2.tar.gz

Download URL pyp_beagle-0.6.2.tar.gz
Size 63.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c32dd2391615d7bffc3adcefd141c76c0887a122eacff7fd165e00ea573c3d3e
BLAKE2b-256 checksum
How to use checksums
1a7cb61f5161bf923199e9e295f187db5a3e59f7f8bba29ce49b3aae0b18aac8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

Release files / pyp_beagle-0.6.2-py2.7.egg

Download URL pyp_beagle-0.6.2-py2.7.egg
Size 155.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
1618d392f3133388adb3655856ff9edf6bd32231a8225d4f5a439e0235bdba92
BLAKE2b-256 checksum
How to use checksums
c81cec7f2bb81e523a87691cb8e8e9934fec580647e6b6912f9f30a613fe50ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14

Release history Release notifications | RSS feed

0.10.8

2 release files

0.10.7

2 release files

0.10.6

2 release files

0.10.5

2 release files

0.10.4

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.9.13

2 release files

0.9.12

2 release files

0.9.11

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.1

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.17

3 release files

0.5.14

3 release files

0.5.10

3 release files

0.5.9

3 release files

0.5.8

3 release files

0.5.7

3 release files

0.5.6

3 release files

0.5.5

3 release files

0.5.4

3 release files

0.5.3

3 release files

0.5.2

3 release files

0.5.1

3 release files

0.5.0

1 release file

0.4.6

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page