Skip to content

Commit d00ac88

Browse files
icweavercgarling
andauthored
Update docs/src/tutorials/multi-wavelength-spectroscopy.md
Co-authored-by: Chris Garling <chris.t.garling@gmail.com>
1 parent 56c3006 commit d00ac88

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

docs/src/tutorials/multi-wavelength-spectroscopy.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,13 @@ println("E(B-V) = ", round(ebv, digits=4), " Av = ", round(Av, digits=4), " mag
109109

110110
# Apply CCM89 extinction law
111111
ext = CCM89(Rv = 3.1)
112-
tau = [ustrip(ext(w * u"angstrom")) * Av for w in wave_raw]
113-
corr = 10 .^ (tau ./ 2.5)
112+
A_lambda = ext.(wave_raw) .* Av
113+
corr = exp10.(-A_lambda ./ 2.5)
114+
flux_dered = flux_meas ./ corr
114115

115-
fv_raw = Measurements.value.(ustrip.(spec.flux))
116-
fv_ded = fv_raw .* corr
117-
118-
fig2, ax2 = lines(wv, fv_raw; label = "Raw",
119-
axis = (xlabel = "Wavelength (Å)",
120-
ylabel = "Flux Density (erg s⁻¹ cm⁻² Å⁻¹)",
121-
title = "CCM89 Dust Dereddening"))
122-
lines!(ax2, wv, fv_ded; label = "Dereddened", color = :orange)
116+
fig2, ax2 = lines(wave_aa, flux_meas; label = "Raw",
117+
axis = (title = "CCM89 Dust Dereddening",))
118+
lines!(ax2, wave_aa, flux_dered; label = "Dereddened", color = :orange)
123119
axislegend(ax2)
124120
fig2
125121
```

0 commit comments

Comments
 (0)