Skip to content

Commit bb226f5

Browse files
committed
Merging all changes in the GPU branch (for some reason I couldn't get automatic merging working)
1 parent d5000f1 commit bb226f5

Some content is hidden

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

52 files changed

+3105
-738
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
[![arXiv](http://img.shields.io/badge/arXiv-2004.09513-orange.svg)](https://arxiv.org/abs/2004.09513)
66
[![arXiv](http://img.shields.io/badge/arXiv-1811.11761-orange.svg)](https://arxiv.org/abs/1811.11761)
77

8-
**April 18, 2020: PLATON v5.1 corresponds most closely to the version described
9-
in our second PLATON paper (https://arxiv.org/abs/2004.09513).**
8+
**Oct 30, 2024: PLATON v6.2 is out, with major updates! This corresponds most closely to the version described in Zhang et al 2024. Major changes include GPU support, free retrievals, surface emission, higher-resolution (R=20k) and more up-to-date opacities, leave-one-out cross-validation, pymultinest, and much better plotting tools.**
109

1110
**February 2, 2020: PLEASE re-clone your repository if you cloned it before this
1211
date! On this date, all data files were deleted from the repository, including

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# This is also used if you do content translation via gettext catalogs.
7070
# Usually you set "language" from the command line for these cases.
71-
language = None
71+
language = 'en'
7272

7373
# List of patterns, relative to source directory, that match files and
7474
# directories to ignore when looking for source files.

docs/eclipse_depths.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ Then, call the eclipse depth calculator::
2525

2626
from platon.eclipse_depth_calculator import EclipseDepthCalculator
2727
calc = EclipseDepthCalculator(method="xsec") #"ktables" for correlated k
28-
wavelengths, depths = calc.compute_depths(p, Rs, Mp, Rp, Tstar)
28+
wavelengths, depths, _ = calc.compute_depths(p, Rs, Mp, Rp, Tstar)
2929
3030
Most of the same parameters accepted by the transit depth calculator are also
31-
accepted by the eclipse depth calculator.
31+
accepted by the eclipse depth calculator. Surface emission can be included by
32+
passing surface_temp. Only blackbody emission is supported at the moment, but
33+
non-blackbody emissivities (from new, state of the art lab data!) will be
34+
included in the next release (Paragas et al. 2024, in prep).
3235

3336
It is also possible to retrieve on combined transit and eclipse depths::
3437

@@ -41,7 +44,7 @@ It is also possible to retrieve on combined transit and eclipse depths::
4144
fit_info.add_uniform_fit_param(...)
4245
fit_info.add_uniform_fit_param(...)
4346

44-
result = retriever.run_multinest(transit_bins, transit_depths, transit_errors,
47+
result = retriever.run_dynesty(transit_bins, transit_depths, transit_errors,
4548
eclipse_bins, eclipse_depths, eclipse_errors,
4649
fit_info,
4750
rad_method="xsec") #"ktables" for corr-k
@@ -50,4 +53,3 @@ Here, T_limb is the temperature at the planetary limb (used for transit depths),
5053
while the T-P profile parameters are for the dayside (used for eclipse depths).
5154

5255
To do an eclipse-only retrieval, set transit_bins, transit_depths, and transit_errors to None, and likewise to do a transit-only retrieval.
53-

docs/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
66
Welcome to PLATON's documentation!
77
==================================
8+
**Oct 30, 2024: PLATON v6.2 is out, with major updates! This corresponds most closely to the version described in Zhang et al 2024. Major changes include GPU support, free retrievals, surface emission, higher-resolution (R=20k) and more up-to-date opacities, leave-one-out cross-validation, pymultinest, and much better plotting tools.**
9+
810
**April 18, 2020: PLATON v5.1 corresponds most closely to the version described
911
in our second PLATON paper.**
1012

@@ -21,6 +23,7 @@ in our second PLATON paper.**
2123
quickstart
2224
mie_scattering
2325
eclipse_depths
26+
surface_emission
2427
visualizer
2528
questions_and_answers
2629
source/modules

docs/install.rst

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,29 @@
11
Install
22
*******
3-
4-
Before installing PLATON, it is highly recommended to have a fast linear
5-
algebra library (BLAS) and verify that numpy is linked to it. This is because
6-
the heart of the radiative transfer code is a matrix multiplication operation
7-
conducted through numpy.dot, which in turn calls a BLAS library if it can find
8-
one. If it can't find one, your code will be many times slower.
9-
10-
We recommend using Anaconda, which automatically installs BLAS libraries.
11-
If you don't want to use Anaconda, a good BLAS library to install on Linux is
12-
OpenBLAS. You can install it on Ubuntu with::
3+
We highly recommend installing PLATON in a conda environment, which typically comes with optimized BLAS libraries. Once in the conda environment::
134
14-
sudo apt install libopenblas-dev
15-
16-
On OS X, a good choice is Accelerate/vecLib, which should already be installed
17-
by default.
18-
19-
To check if your numpy is linked to BLAS, do::
20-
21-
numpy.__config__.show()
5+
git clone https://github.com/ideasrule/platon.git
6+
cd platon/
7+
pip install -e .
228

23-
If blas_opt_info mentions OpenBLAS or vecLib, that's a good sign. If it says
24-
"NOT AVAILABLE", that's a bad sign.
9+
Doing "pip install -e ." instead of "pip install ." installs PLATON in-place instead of copying the source files somewhere else. This way, you can modify the source code and have the changes reflected instantly.
2510

26-
Once you have a BLAS installed and linked to numpy, download PLATON,
27-
install the requirements, and install PLATON itself. Although it is possible
28-
to install PLATON using pip (pip install platon), the recommended method is to
29-
clone the GitHub repository and install from there. This is because the
30-
repository includes examples, which you don't get when pip installing.
11+
PLATON 6.2 uses the GPU by default, and falls back on the CPU if it can't find one. If you have a Nvidia GPU, we highly recommend that you install CUDA and cupy, which will speed up PLATON many-fold::
12+
13+
conda install -c conda-forge cupy
3114

32-
To install from GitHub::
15+
PLATON will automatically detect the existence of cupy and use the GPU. You can force it to use the CPU by setting FORCE_CPU = True in _cupy_numpy.py.
3316

34-
git clone https://github.com/ideasrule/platon.git
35-
cd platon/
36-
python setup.py install
17+
PLATON supports both dynesty and pymultinest for nested sampling. dynesty is installed by default. To install pymultinest::
18+
19+
conda install -c conda-forge mpi4py pymultinest
3720

38-
You can run unit tests to make sure everything works::
21+
After installing PLATON, you can run unit tests to make sure everything works::
3922
4023
nosetests -v
4124

4225
The unit tests should also give you a good idea of how fast the code will be.
4326
On a decent Ubuntu machine with OpenBLAS, it takes 3 minutes.
4427

45-
The default data files (in platon/data) have a wavelength resolution of R=1000,
46-
but if you want higher resolution, you can download R=10,000 and
47-
R=375,000 data from `this webpage <http://astro.caltech.edu/~mz/absorption.html>`_
28+
The default data files (in platon/data) have a wavelength resolution of R=20k.
29+
If you want higher resolution, you can download higher-resolution opacities from the `DACE opacity database <https://dace.unige.ch/opacityDatabase>`_ and interpolate to PLATON's temperature and pressure grid.

docs/intro.rst

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
11
Introduction
22
************
33

4-
PLATON (PLanetary Atmospheric Transmission for Observer Noobs) is a
4+
PLATON (PLanetary Atmospheric Tool for Observer Noobs) is a
55
fast and easy to use forward modelling and retrieval tool for
6-
exoplanet atmospheres. It is based on ExoTransmit by Eliza Kempton.
7-
The two main modules are:
6+
exoplanet atmospheres. Its roots are in ExoTransmit by Eliza Kempton, but
7+
it has dramatically changed since then.
8+
9+
The main modules are:
810

911
1. :class:`.TransitDepthCalculator`: computes a transit spectrum for an
1012
exoplanet
1113
2. :class:`.EclipseDepthCalculator`: computes an eclipse spectrum
1214
3. :class:`.CombinedRetriever`: can retrieve atmospheric properties for
1315
transit depths, eclipse depths, or a combination of the two.
1416

15-
The transit spectrum is calculated from 300 nm to 30 um, taking into
16-
account gas absorption, collisionally induced gas absorption, clouds,
17-
and scattering. :class:`.TransitDepthCalculator` is written
18-
entirely in Python and is designed for performance. By default, it
19-
calculates transit depths on a fine wavelength grid (λ/Δλ = 1000 with
20-
4616 wavelength points), which takes ~65 milliseconds on a midrange
21-
consumer computer. The user can instead specify bins which are
22-
directly relevant to matching observational data, in which case the
23-
code avoids computing depths for irrelevant wavelengths and is many
24-
times faster. The user can also download higher resolution data (R=10,000 or R=375,000) from `here <http://astro.caltech.edu/~mz/absorption.html>`_
25-
and drop them into PLATON's data folder; the runtime is roughly proportional
26-
to the resolution.
27-
28-
The eclipse spectrum is calculated with the same physics included, but it does
29-
not include scattering as a source of emission; scattering is only included as
30-
a source of absorption.
17+
The transit spectrum is calculated from 0.2 um to 30 um, taking into
18+
account gas absorption, H- absorption, collisionally induced absorption,
19+
clouds, and scattering. The eclipse spectrum is calculated with the same physics included, but it does not include scattering as a source of emission; scattering is only included as a source of absorption.
3120

3221
The retrievers use TransitDepthCalculator/EclipseDepthCalculator as a forward
3322
model, and can retrieve atmospheric properties using either MCMC or nested
3423
sampling. The speed of these retrievals is highly dependent on the wavelength
3524
range, data precision, prior ranges, opacity resolution, and number of live points (nested sampling)
3625
or iterations/walkers (MCMC). A very rough guideline is that a retrieval with
37-
200 live points and R=1000 (suitable for exploratory work) for
38-
STIS + WFC3 + IRAC 3.6 um + IRAC 4.5 um data takes <1 hour, while a
39-
retrieval with 1000 live points and R=10,000 (suitable for the final version)
40-
takes 1-2 days. There are a variety of ways to speed up the retrieval, as
41-
described in our PLATON II paper. These include using correlated-k instead of
42-
opacity sampling with R=10,000, or removing the opacity data files of
43-
unimportant molecules (thereby zeroing their opacities).
26+
250 live points and R=20k for
27+
STIS + WFC3 + IRAC 3.6 um + IRAC 4.5 um data takes 19 minutes with multinest, or 75 minutes with dynesty. There are a variety of ways to speed up the retrieval, as
28+
described on the Q&A page.

docs/mie_scattering.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ their actual, wavelength-dependent refractive indices, assuming a standard
2424
deviation in the lognormal size distribution of 0.5::
2525

2626
calculator.compute_depths(Rs, Mp, Rp, T,
27-
ri = "TiO2", frac_scale_height = 0.5, number_density = 1e9,
27+
ri = "TiO2_anatase", frac_scale_height = 0.5, number_density = 1e9,
2828
part_size = 1e-6, cloudtop_pressure=1e5)
2929

30-
The supported species are MgSiO3_sol, SiO2_amorph, and TiO2, using the
31-
refractive index data of `Kitzmann et al 2017 <https://arxiv.org/abs/1710.04946>`_.
30+
The supported species are those with `data in LX-MIE <https://github.com/NewStrangeWorlds/LX-MIE/tree/master/compilation>`, with the exception of Fe2SiO4 and MgAl2O4 (which do not have refractive index data all the way to 0.2 um).
3231

3332
To retrieve Mie scattering parameters, make sure to set log_scatt_factor to 0,
3433
and log_number_density to a finite value. n and log_k specify the real component and log10 of the imaginary component of the complex refractive index. We recommend fixing at least n. Example::

0 commit comments

Comments
 (0)