Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any in cloud params vs kzz bug #99

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions species/fit/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -2204,22 +2204,22 @@ def _lnlike(
log_x_base[item[:-3]] = cube[cube_index[item]]

# Create dictionary with cloud parameters

if "log_kzz" in self.parameters:
cloud_param = [
"fsed",
"log_kzz",
"sigma_lnorm",
"log_kappa_0",
"opa_index",
"log_p_base",
"albedo",
"log_kappa_abs",
"log_kappa_sca",
"opa_abs_index",
"opa_sca_index",
"lambda_ray",
]
cloud_param = [
"fsed",
"log_kzz",
"sigma_lnorm",
"log_kappa_0",
"opa_index",
"log_p_base",
"albedo",
"log_kappa_abs",
"log_kappa_sca",
"opa_abs_index",
"opa_sca_index",
"lambda_ray",
]

if any(param_i in self.parameters for param_i in cloud_param):

cloud_dict = {}
for item in cloud_param:
Expand Down Expand Up @@ -2444,13 +2444,9 @@ def _lnlike(
# that is calculated from the spectrum and the
# bolometric flux at each pressure

ln_prior += np.sum(
-0.5 * (f_bol - f_bol_spec) ** 2 / sigma_fbol**2
)
ln_prior += np.sum(-0.5 * (f_bol - f_bol_spec) ** 2 / sigma_fbol**2)

ln_prior += (
-0.5 * f_bol.size * np.log(2.0 * np.pi * sigma_fbol**2)
)
ln_prior += -0.5 * f_bol.size * np.log(2.0 * np.pi * sigma_fbol**2)

# for i in range(i_conv):
# for i in range(lowres_radtrans.press.shape[0]):
Expand Down Expand Up @@ -2997,8 +2993,7 @@ def _lnlike(
-0.5
* weight
* np.sum(
flux_diff**2 / data_var
+ np.log(2.0 * np.pi * data_var)
flux_diff**2 / data_var + np.log(2.0 * np.pi * data_var)
)
)

Expand Down
6 changes: 3 additions & 3 deletions species/util/plot_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,13 +588,13 @@ def update_labels(param: List[str], object_type: str = "planet") -> List[str]:

if "T_bottom" in param:
index = param.index("T_bottom")
param[index] = r"$T_\mathrm{bottom}$ (K)"
param[index] = r"$T_\mathrm{bot}$ (K)"

num_layer = 6 # could make a variable in the future
for i in range(num_layer):
if f"PTslope_{num_layer - i}" in param:
index = param.index(f"PTslope_{num_layer - i}")
param[index] = rf"$(dlnT/dlnP)_\mathrm{{P={i}bar}}$ (K)"
param[index] = rf"dlnT/dlnP$_{i}$ "

if "log_p_quench" in param:
index = param.index("log_p_quench")
Expand Down Expand Up @@ -630,7 +630,7 @@ def update_labels(param: List[str], object_type: str = "planet") -> List[str]:

if f"fsed_{item}(c)" in param:
index = param.index(f"fsed_{item}(c)")
param[index] = rf"$\log\,P_\mathrm{{{cloud_labels[i]}}}$"
param[index] = rf"fsed$_\mathrm{{{cloud_labels[i]}}}$"

for i, item_i in enumerate(cloud_species):
for j, item_j in enumerate(cloud_species):
Expand Down
Loading