Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 442af08

Browse files
committedMay 7, 2021
Added the cloud_wavel parameter to ReadRadtrans.get_model
1 parent 6efd32d commit 442af08

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed
 

‎species/read/read_radtrans.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def get_model(self,
145145
quenching: Optional[str] = None,
146146
spec_res: Optional[float] = None,
147147
wavel_resample: Optional[np.ndarray] = None,
148-
plot_contribution: Optional[str] = None) -> box.ModelBox:
148+
plot_contribution: Optional[str] = None,
149+
cloud_wavel: Optional[Tuple[float, float]] = None) -> box.ModelBox:
149150
"""
150151
Function for calculating a model spectrum with ``petitRADTRANS``.
151152
@@ -167,6 +168,12 @@ def get_model(self,
167168
plot_contribution : str, None
168169
Filename for the plot with the emission contribution. The plot is not created if the
169170
argument is set to ``None``.
171+
cloud_wavel : tuple(float, float), None
172+
Tuple with the wavelength range (um) that is used for calculating the median optical
173+
depth of the clouds at the gas-only photosphere and then scaling the cloud optical
174+
depth to the value of ``log_tau_cloud``. The range of ``cloud_wavel`` should be
175+
encompassed by the range of ``wavel_range``. The full wavelength range (i.e.
176+
``wavel_range``) is used if the argument is set to ``None``.
170177
171178
Returns
172179
-------
@@ -366,7 +373,8 @@ def get_model(self,
366373
p_quench, log_x_abund, log_x_base, model_param['fsed'],
367374
log_kzz, model_param['logg'], model_param['sigma_lnorm'],
368375
chemistry=chemistry, pressure_grid=self.pressure_grid,
369-
plotting=False, contribution=True, tau_cloud=tau_cloud)
376+
plotting=False, contribution=True, tau_cloud=tau_cloud,
377+
cloud_wavel=cloud_wavel)
370378

371379
elif chemistry == 'equilibrium':
372380
# Calculate the petitRADTRANS spectrum for a clear atmosphere

‎species/util/retrieval_util.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,9 @@ def calc_spectrum_clouds(rt_object,
716716
pressure_grid: str = 'smaller',
717717
plotting: bool = False,
718718
contribution: bool = False,
719-
tau_cloud: Optional[float] = None) -> Tuple[Optional[np.ndarray],
720-
Optional[np.ndarray],
721-
Optional[np.ndarray]]:
719+
tau_cloud: Optional[float] = None,
720+
cloud_wavel: Optional[Tuple[float, float]] = None) -> Tuple[
721+
Optional[np.ndarray], Optional[np.ndarray], Optional[np.ndarray]]:
722722
"""
723723
Function to simulate an emission spectrum of a cloudy atmosphere.
724724
@@ -766,6 +766,12 @@ def calc_spectrum_clouds(rt_object,
766766
tau_cloud : float, None
767767
Total cloud optical that will be used for scaling the cloud mass fractions. The mass
768768
fractions will not be scaled if the parameter is set to ``None``.
769+
cloud_wavel : tuple(float, float), None
770+
Tuple with the wavelength range (um) that is used for calculating the median optical
771+
depth of the clouds at the gas-only photosphere and then scaling the cloud optical
772+
depth to the value of ``log_tau_cloud``. The range of ``cloud_wavel`` should be
773+
encompassed by the range of ``wavel_range``. The full wavelength range (i.e.
774+
``wavel_range``) is used if the argument is set to ``None``.
769775
770776
Returns
771777
-------
@@ -925,7 +931,8 @@ def calc_spectrum_clouds(rt_object,
925931
kappa_zero=None,
926932
gamma_scat=None,
927933
add_cloud_scat_as_abs=False,
928-
hack_cloud_photospheric_tau=tau_cloud)
934+
hack_cloud_photospheric_tau=tau_cloud,
935+
cloud_wlen=cloud_wavel)
929936

930937
if check_scaling is None:
931938
wlen_micron = constants.LIGHT*1e2/rt_object.freq/1e-4

0 commit comments

Comments
 (0)
Please sign in to comment.