Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
icweaver committed Mar 15, 2022
1 parent 9fd5090 commit 60465e9
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 64 deletions.
4 changes: 2 additions & 2 deletions html/08_retrievals.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/01_raw_data.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.18.1
# v0.18.2

using Markdown
using InteractiveUtils
Expand Down
2 changes: 1 addition & 1 deletion notebooks/02_reduced_data_IMACS.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.18.1
# v0.18.2

using Markdown
using InteractiveUtils
Expand Down
37 changes: 23 additions & 14 deletions notebooks/07_transmission_spectra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ begin
cubes[transit]["δ_WLC"] = maxmeasure(p[1], p_u[1], p_d[1])^2 * 1e6
end

delete!(cubes["Transit 1 (IMACS)"]["tspec"], 3)
cubes = sort(cubes)
end

Expand Down Expand Up @@ -164,9 +165,6 @@ df_common_0 = innerjoin(
Conversely, we also store which points in the spectrum are not common between all nights. `Transit 2 (LDSS3C)` encompasses the spectra from all other nights, so we `antijoin` relative to this dataset:
"""

# ╔═╡ 51357cde-d3da-4377-8ae0-10e81a9c5c8d
occursin("_sp", DATA_DIR)

# ╔═╡ 461097e9-a687-4ef2-a5b4-8bf4d9e1c98f
dfs_unique = (
"Transit 1 (IMACS)" => antijoin(
Expand Down Expand Up @@ -263,7 +261,7 @@ end

# ╔═╡ b32273bc-1bb5-406a-acfe-57fd643ded51
df_tspecs = sort(vcat(df_common, df_extra), :Wcen)
#df_tspecs = df_common
# df_tspecs = df_common

# ╔═╡ 64f608b9-76df-402e-801c-006dc3096f94
latextabular(df_tspecs, latex=false) |> PlutoUI.Text
Expand Down Expand Up @@ -357,6 +355,9 @@ avg_prec_IMACS = getproperty.(df_IMACS[!, :Combined], :err) |> median
# ╔═╡ b6fa6c00-14cf-47af-9593-c70514373db5
avg_prec_LDSS3 = getproperty.(df_LDSS3[!, :Combined], :err) |> median

# ╔═╡ 92029dbc-2633-414f-a8ee-0ec61eda0313
df_common

# ╔═╡ 3af0d3b0-c698-4845-a74e-c7186b03a721
let
#f = "$(DATA_DIR)/tspec_w50_IMACS.csv"
Expand Down Expand Up @@ -395,15 +396,11 @@ wbins_LDSS3
Finally, we save the final combined transmission spectrum to file for our retrieval analysis, along with planet/star parameters computed from the WLC fits:
"""

# ╔═╡ 5718672b-1bc6-4676-8703-5fc06b83f0f9
let
#f = "$(DATA_DIR)/tspec_w50_all.csv"
#CSV.write(f, create_df(df_tspecs; instrument="IMACS+LDSS3C"))
#@info "Saved to $(f)"
#f = "$(DATA_DIR)/tspec_w50.csv"
#CSV.write(f, create_df(df_common; instrument="IMACS+LDSS3C"))
#@info "Saved to $(f)"
end
# ╔═╡ 4faac7de-8c38-4f2c-be85-569e8fc83d28
df_tspecs

# ╔═╡ 3846da6a-af41-47a0-9318-76757a1dba15
df_common

# ╔═╡ 9141dba4-4c11-404d-b18a-b22f3466caba
Rₛ = 0.873u"Rsun"
Expand All @@ -430,6 +427,16 @@ function create_df(df; instrument="add_instrument")
end
end

# ╔═╡ 5718672b-1bc6-4676-8703-5fc06b83f0f9
let
f = "$(DATA_DIR)/tspec_w50_3.csv"
CSV.write(f, create_df(df_tspecs; instrument="IMACS+LDSS3C"))
@info "Saved to $(f)"
#f = "$(DATA_DIR)/tspec_w50.csv"
#CSV.write(f, create_df(df_common; instrument="IMACS+LDSS3C"))
#@info "Saved to $(f)"
end

# ╔═╡ f8a86915-f7d8-4462-980e-7b8124b13a3f
@mdx """
## Notebook setup 🔧
Expand Down Expand Up @@ -749,7 +756,6 @@ gₚ = G * Mₚ / Rₚ^2 |> u"cm/s^2"
# ╟─11066667-9da2-4b36-b784-c3515c04a659
# ╠═cb1b277b-aa92-44de-91ce-88122bc34bb9
# ╟─acde40fd-8ed4-4175-9a52-13ed91dc5495
# ╠═51357cde-d3da-4377-8ae0-10e81a9c5c8d
# ╠═461097e9-a687-4ef2-a5b4-8bf4d9e1c98f
# ╠═4b9cfc02-5e18-422d-b18e-6301a659561a
# ╠═45acc116-e585-4ddf-943d-128db7736921
Expand All @@ -771,13 +777,16 @@ gₚ = G * Mₚ / Rₚ^2 |> u"cm/s^2"
# ╠═940ad41b-910c-40a8-8752-e68e13ff4a1f
# ╠═f37d9e45-575c-40d9-8f26-31bd6cc6d145
# ╠═b6fa6c00-14cf-47af-9593-c70514373db5
# ╠═92029dbc-2633-414f-a8ee-0ec61eda0313
# ╠═3af0d3b0-c698-4845-a74e-c7186b03a721
# ╟─27811c9d-1ee5-49ca-bf09-04dc75dd66be
# ╠═8644fa54-0407-4494-aef4-eb497a86c35d
# ╠═b971503b-bfef-4ca7-98ad-b5940bbda10f
# ╠═943844ce-a78b-403d-8bae-341216308392
# ╠═ef04759d-6a2d-488b-ae3b-6595c35dd70a
# ╟─146a2be7-1c08-4d7c-802f-41f65aeae0d5
# ╠═4faac7de-8c38-4f2c-be85-569e8fc83d28
# ╠═3846da6a-af41-47a0-9318-76757a1dba15
# ╠═5718672b-1bc6-4676-8703-5fc06b83f0f9
# ╠═9141dba4-4c11-404d-b18a-b22f3466caba
# ╠═54c341d9-2065-48cf-89bd-11acf72bdf9d
Expand Down
54 changes: 35 additions & 19 deletions notebooks/08_retrievals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ begin
using PythonCall
end

# ╔═╡ 54d69f6d-cac0-4909-84b0-01f42cb7a4b0
1400 + 250

# ╔═╡ a21aad0b-5998-420e-b437-d7ad262d0fe4
begin
const DATA_DIR = "data/retrievals"
Expand Down Expand Up @@ -91,7 +88,7 @@ species = [
"Na_TiO",
"K_TiO",
"Na_K_TiO",
"CO",
# "CO",
"H2O",
# "NH3", # too low
# "HCN", # too low
Expand Down Expand Up @@ -304,16 +301,22 @@ Dict(k => median(v) ± std(v) for (k, v) ∈ dists)
cube |> keys

# ╔═╡ 41d8cd60-aacb-46c4-9344-29a8228f43cb
cube["K"] |> keys
models = cube["K"] |> keys

# ╔═╡ d5197c68-0045-4ca7-b5c6-f9cd7852d896
models

# ╔═╡ 9c6a178c-ac7a-4ee5-ada2-05690158fcdb
models

# ╔═╡ 6ed6b481-4b84-485a-af2f-d2ecb943cd33
samples = pyconvert(Dict{String, Vector}, cube["K"]["clear"]["retr"]["samples"])
samples = pyconvert(Dict{String, Vector}, cube["Na"]["clear"]["retr"]["samples"])

# ╔═╡ d3ec52e6-205e-4639-bd50-c9ef45e44f8e
hist(samples["T"])
# ╔═╡ 8ac2b5d2-eb4b-4a4f-99f8-52830e5ef9e8
keys(samples)

# ╔═╡ b52a381b-438f-4224-b5f3-7e11db5cc045
samples["Fhet"] |> median
# ╔═╡ d3ec52e6-205e-4639-bd50-c9ef45e44f8e
hist(samples["T"], bins=20)

# ╔═╡ e43f1834-73dd-4859-b847-f4c552561897
begin
Expand Down Expand Up @@ -405,14 +408,26 @@ let
xlabel = "Wavelength (Å)",
ylabel = "Transit depth (ppm)",
#limits = (0.3, 1.1, 17_500, 21_000),
#limits = (4_600, 9_800, 15_500, 22_500),
limits = (4_600, 9_800, 15_500, 22_500)
limits = (4_000, 9_800, 17_500, 21_500),
#limits = (4_600, 9_800, 17_000, 21_000)
#limits = (4_000, 13_000, 15_500, 22_500),
xticks = LinearTicks(7),
)

plot_retrieval!(ax, cube, "Na_K_TiO", "haze+spot"; color=COLORS[6])
plot_retrieval!(ax, cube, "Na", "cloud"; color=COLORS[3])
plot_retrieval!(ax, cube, "TiO", "haze"; color=COLORS[5])
plot_retrieval!(ax, cube, "CO", "clear"; color=COLORS[1], linewidth=6)
# for (i, sp) ∈ enumerate(species)
# plot_retrieval!(ax, cube, sp, "clear"; color=COLORS[mod1(i, 6)], linewidth=1)
# end
# for (i, model) ∈ enumerate(models)
# plot_retrieval!(ax, cube, "TiO", model; color=COLORS[i], linewidth=1)
# end
plot_retrieval!(ax, cube, "Na_K_TiO", "clear"; color=COLORS[1])
plot_retrieval!(ax, cube, "Na_K_TiO", "spot"; color=COLORS[2])
plot_retrieval!(ax, cube, "Na_K_TiO", "cloud"; color=COLORS[3])
plot_retrieval!(ax, cube, "Na_K_TiO", "haze"; color=COLORS[5])

# for sp ∈ species, model ∈ models
# plot_retrieval!(ax, cube, sp, model)
# end

fpath_suff = basename(base_dir)
if occursin("offs", fpath_suff)
Expand Down Expand Up @@ -457,10 +472,9 @@ body.disable_ui main {
"""

# ╔═╡ Cell order:
# ╠═54d69f6d-cac0-4909-84b0-01f42cb7a4b0
# ╟─0132b4ab-0447-4546-b412-ec598b20d21d
# ╠═a21aad0b-5998-420e-b437-d7ad262d0fe4
# ╟─60dc161c-2aa2-4264-884d-6da3ead0e57b
# ╠═60dc161c-2aa2-4264-884d-6da3ead0e57b
# ╟─d7ce97c1-82f2-46f1-a5ac-73e38e032fc8
# ╠═589afac8-0ea5-4962-b52b-7f035e91cf44
# ╟─2c12ec4d-1184-4755-8bd8-0d7cd59fa205
Expand All @@ -480,17 +494,19 @@ body.disable_ui main {
# ╠═930ec094-7b11-48b8-818e-15c63ed6f8a5
# ╠═54b5c81a-835a-461c-9dfd-2d938fac3bc4
# ╟─1c4fe72d-9872-4969-a62a-5163b5009bbb
# ╠═d5197c68-0045-4ca7-b5c6-f9cd7852d896
# ╠═e801501c-a882-4f2d-bbc1-40028c1c91d8
# ╠═00a0f9c4-cd4d-4ae2-80b7-0c044239a571
# ╠═5569b57c-0585-4300-927b-5d089dde0f43
# ╠═db524678-9ee2-4934-b1bb-6a2f13bf0fa6
# ╠═cc011a66-37bd-4543-9a58-b11e1f785e52
# ╟─0f23e0d6-177d-4bf6-9660-f2c376b3146b
# ╠═9c6a178c-ac7a-4ee5-ada2-05690158fcdb
# ╠═95f85651-ca70-4dd8-b82c-b531a966de90
# ╠═41d8cd60-aacb-46c4-9344-29a8228f43cb
# ╠═6ed6b481-4b84-485a-af2f-d2ecb943cd33
# ╠═8ac2b5d2-eb4b-4a4f-99f8-52830e5ef9e8
# ╠═d3ec52e6-205e-4639-bd50-c9ef45e44f8e
# ╠═b52a381b-438f-4224-b5f3-7e11db5cc045
# ╟─1eff1230-2423-4ac3-8e9b-f4e7bcd0121b
# ╟─eab74923-a084-468c-9b0d-c2cc98a23913
# ╠═44b3b8cd-4b83-4b27-a948-d1230489552f
Expand Down
Loading

0 comments on commit 60465e9

Please sign in to comment.