Skip to content

Commit

Permalink
updating docs to use G23
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Apr 4, 2023
1 parent 388cab2 commit c79813a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/dust_extinction/choose_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ to the :class:`~dust_extinction.parameter_averages.F99` model with f\ :sub:`A`\
+----------+-------------+--------------+------------------+--------------+
| D22 | R(V) | 0.2 - 1.25 | 0.8 - 5.0 | MW |
+----------+-------------+--------------+------------------+--------------+
| G23 | R(V) | 0.033 - 11.0 | 0.0912 - 30.0 | MW |
| G23 | R(V) | 0.032 - 11.0 | 0.0912 - 32.0 | MW |
+----------+-------------+--------------+------------------+--------------+

Notes
Expand Down
12 changes: 7 additions & 5 deletions docs/dust_extinction/extinguish.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ Extinguish a Blackbody
:include-source:

import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
import numpy as np

import astropy.units as u
from astropy.modeling.models import BlackBody

from dust_extinction.parameter_averages import F19
from dust_extinction.parameter_averages import G23

# generate wavelengths between 0.12 and 3 microns
# within the valid range for the F19 R(V) dependent relationship
lam = np.logspace(np.log10(0.12), np.log10(3.0), num=1000)
# generate wavelengths between 0.0912 and 32 microns
# within the valid range for the G23 R(V) dependent relationship
lam = np.logspace(np.log10(0.0912), np.log10(32.0), num=1000)

# setup the inputs for the blackbody function
wavelengths = lam*1e4*u.AA
Expand All @@ -38,7 +39,7 @@ Extinguish a Blackbody
flux = bb_lam(wavelengths)

# initialize the model
ext = F19(Rv=3.1)
ext = G23(Rv=3.1)

# get the extinguished blackbody flux for different amounts of dust
flux_ext_av05 = flux*ext.extinguish(wavelengths, Av=0.5)
Expand All @@ -57,6 +58,7 @@ Extinguish a Blackbody
ax.set_ylabel('$Flux$')

ax.set_xscale('log')
ax.xaxis.set_major_formatter(ScalarFormatter())
ax.set_yscale('log')

ax.set_title('Example extinguishing a blackbody')
Expand Down
4 changes: 2 additions & 2 deletions docs/dust_extinction/model_flavors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ R(V) (+ other variables) dependent prediction models
fig, ax = plt.subplots(ncols=2, figsize=(10, 4))

# generate the curves and plot them
x = np.arange(1./30., 1./0.0912, 0.001)/u.micron
x = np.arange(1./32., 1./0.0912, 0.001)/u.micron

Rv = 2.5

Expand Down Expand Up @@ -234,7 +234,7 @@ R(V) (+ other variables) dependent prediction models
fig, ax = plt.subplots(ncols=2, figsize=(10, 4))

# generate the curves and plot them
x = np.arange(1./30., 1./0.0912, 0.001)/u.micron
x = np.arange(1./32., 1./0.0912, 0.001)/u.micron

Rv = 5.5

Expand Down
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ Define a model, specifically the F99 model with an R(V) = 3.1.

.. code-block:: python
from dust_extinction.parameter_averages import F99
from dust_extinction.parameter_averages import G23
# define the model
ext = F99(Rv=3.1)
ext = G23(Rv=3.1)
Extinguish (redden) a spectrum with a screen of F99 dust with an E(B-V) of 0.5.
Can also specify the dust column with Av (this case equivalent to Av = 0.5*Rv =
Expand All @@ -102,10 +102,10 @@ equivalent A(V) column.
import matplotlib.pyplot as plt
import astropy.units as u
from astropy.modeling.models import BlackBody
from dust_extinction.parameter_averages import F99
from dust_extinction.parameter_averages import G23

# define the model
ext = F99(Rv=3.1)
ext = G23(Rv=3.1)

# wavelengths and spectrum are 1D arrays
# wavelengths between 1000 and 30000 A
Expand Down

0 comments on commit c79813a

Please sign in to comment.