Update Getting started authored by Doriann Blain's avatar Doriann Blain
In this section we will describe how to quickly run an *Exo-REM* simulation. We will use the `inputs/example.nml` coming with all [distributed versions](https://gitlab.obspm.fr/dblain/exorem/-/tree/master/dist) of *Exo-REM* as a starting point. In this section we will describe how to quickly run an *Exo-REM* simulation. We will use the `inputs/example.nml` coming with all [distributed versions](https://gitlab.obspm.fr/dblain/exorem/-/tree/master/dist) of *Exo-REM* as a starting point.
Summary:
- [Prerequisites](#prerequisites)
- [First run](#first-run)
- [Setup](#setup)
- [Running](#running)
- [Plotting](#plotting)
- [More precision](#more-precision)
- Setup
- Running
- Plotting
- [Better figures](#better-figures)
# Prerequisites # Prerequisites
If you downloaded the archive in the [_dist_](https://gitlab.obspm.fr/dblain/exorem/-/tree/master/dist) directory, you should have everything you need, except a stellar spectrum (see point 4 below). Otherwise, check the following: If you downloaded the archive in the [_dist_](https://gitlab.obspm.fr/dblain/exorem/-/tree/master/dist) directory, you should have everything you need, except a stellar spectrum (see point 4 below). Otherwise, check the following:
...@@ -10,6 +22,11 @@ If you downloaded the archive in the [_dist_](https://gitlab.obspm.fr/dblain/exo ...@@ -10,6 +22,11 @@ If you downloaded the archive in the [_dist_](https://gitlab.obspm.fr/dblain/exo
5. Verify if all the condensates and gases thermochemical tables are in the _data/thermochemical_tables_ directory. If you want to add more species to the chemical model, respect the same format and use "speciesName.tct.dat" as file name (e.g. "H2O.tct.dat"). 5. Verify if all the condensates and gases thermochemical tables are in the _data/thermochemical_tables_ directory. If you want to add more species to the chemical model, respect the same format and use "speciesName.tct.dat" as file name (e.g. "H2O.tct.dat").
6. Put a temperature profile as a priori inside the _inputs/atmospheres/temperature_profiles_ directory. The *Exo-REM* data format must be respected. You should have received an example of such a file with your *Exo-REM* distribution. 6. Put a temperature profile as a priori inside the _inputs/atmospheres/temperature_profiles_ directory. The *Exo-REM* data format must be respected. You should have received an example of such a file with your *Exo-REM* distribution.
To plot the figures using the provided plot functions, you will need Python3, and the following Python packages:
- numpy
- scipy
- matplotlib
# First run # First run
## Setup ## Setup
In this example, we will simulate the atmosphere of CoRoT-4 b, a well studied planet. A good source of planetary information can be found [here](https://exoplanetarchive.ipac.caltech.edu/). We will use the parameters from Moutou et al. 2008. In this example, we will simulate the atmosphere of CoRoT-4 b, a well studied planet. A good source of planetary information can be found [here](https://exoplanetarchive.ipac.caltech.edu/). We will use the parameters from Moutou et al. 2008.
...@@ -104,7 +121,7 @@ The transmission spectrum should look like this: ...@@ -104,7 +121,7 @@ The transmission spectrum should look like this:
This is nice, but the resolution is quite low. This is nice, but the resolution is quite low.
# More precision ! # More precision
This time, our goal will be to have more precise results. We will use our calculated temperature profile as input, and a higher resolution power. We will also add a stellar spectrum, and use an advanced mode to calculate the eddy diffusion coefficient. To keep it simple, we will consider only KCl and Na2S clouds. This time, our goal will be to have more precise results. We will use our calculated temperature profile as input, and a higher resolution power. We will also add a stellar spectrum, and use an advanced mode to calculate the eddy diffusion coefficient. To keep it simple, we will consider only KCl and Na2S clouds.
## Setup ## Setup
...@@ -190,14 +207,18 @@ And the transmission spectrum should look like this: ...@@ -190,14 +207,18 @@ And the transmission spectrum should look like this:
![transmission_spectrum_corot-4b_R500](uploads/51da1babc3b2219569a0d861ae645c73/transmission_spectrum_corot-4b_R500.png) ![transmission_spectrum_corot-4b_R500](uploads/51da1babc3b2219569a0d861ae645c73/transmission_spectrum_corot-4b_R500.png)
## Better figures ## Better figures
Not happy with the figures you get ? What if for example you wanted to see the contributions of everything but clouds between 0.5 and 1.5 µm ? To do that, open inside the *Exo-REM* main directory a python console: Not happy with the figures you get ? What if for example you wanted to see the contributions of everything but clouds between 0.5 and 1.5 µm ?
1. To do that, open inside the *Exo-REM* main directory a python console:
```bash ```bash
python python
``` ```
2. Import the *Exo-REM* plot functions:
Then, simply do: ```python
from src.python.plot_figures import *
```
3. Then, simply do:
```python ```python
from src.python.plot_figures import * # import everything from plot_figures
plot_contribution_transmission_spectra( plot_contribution_transmission_spectra(
'./outputs/exorem/spectra_corot-4b_R500.dat', './outputs/exorem/spectra_corot-4b_R500.dat',
wvn2wvl=True, wvn2wvl=True,
...@@ -206,3 +227,16 @@ plot_contribution_transmission_spectra( ...@@ -206,3 +227,16 @@ plot_contribution_transmission_spectra(
exclude=['clouds'] exclude=['clouds']
) )
``` ```
4. If you want to see the effect of the clouds on the transmission spectrum, you can try:
```python
plot_transmission_spectrum('./outputs/exorem/spectra_corot-4b_R500.dat', wvn2wvl=True, star_radius=814e6, cloud_coverage=0, color='r', label='no cloud')
plot_transmission_spectrum('./outputs/exorem/spectra_corot-4b_R500.dat', wvn2wvl=True, star_radius=814e6, cloud_coverage=0.5, color='g', label='50% cover')
plot_transmission_spectrum('./outputs/exorem/spectra_corot-4b_R500.dat', wvn2wvl=True, star_radius=814e6, cloud_coverage=1, color='b', label='full cover')
plt.xlim([0.3e-6, 2e-6])
plt.gca().set_xscale('log')
plt.legend()
```
There is much other things you can do. Do not hesitate to check the _src/python/plot_figures.py_ file to look at the docstrings of the functions.
Enjoy Exo-REM !
\ No newline at end of file