Skip to content

Commit

Permalink
Docs updates for F20
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Jun 4, 2019
1 parent 5256366 commit 6aa86c4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
7 changes: 5 additions & 2 deletions docs/dust_extinction/choose_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ model encompasses the average measured behavior of extinction curves in the MW,
LMC, and SMC. The :class:`~dust_extinction.parameter_averages.G16` model reduces
to the :class:`~dust_extinction.parameter_averages.F99` model with f\ :sub:`A`\ =
1.0. If only MW type extinction is expected, then the
:class:`~dust_extinction.parameter_averages.F04` model should be considered as it
is based on significantly more extinction curves than the
:class:`~dust_extinction.parameter_averages.F20` model should be considered as it
is based on spectroscopic extinction curves in the optical and ultraviolet and
significantly more extinction curves than the
:class:`~dust_extinction.parameter_averages.CCM89` or
:class:`~dust_extinction.parameter_averages.O94` models.

Expand All @@ -72,6 +73,8 @@ is based on significantly more extinction curves than the
+----------+-------------+-------------+------------------+--------------+
| G16 | R(V)_A, f_A | 0.3 - 10.0 | 0.1 - 3.3 | MW, LMC, SMC |
+----------+-------------+-------------+------------------+--------------+
| F99, F04 | R(V) | 0.3 - 8.7 | 0.115 - 3.3 | MW |
+----------+-------------+-------------+------------------+--------------+

Notes
-----
Expand Down
10 changes: 5 additions & 5 deletions docs/dust_extinction/extinguish.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Example: Extinguish a Blackbody
import astropy.units as u
from astropy.modeling.blackbody import blackbody_lambda

from dust_extinction.parameter_averages import F99
from dust_extinction.parameter_averages import F20

# generate wavelengths between 0.1 and 3 microns
# within the valid range for the F99 R(V) dependent relationship
lam = np.logspace(np.log10(0.1), np.log10(3.0), num=1000)
# generate wavelengths between 0.12 and 3 microns
# within the valid range for the F20 R(V) dependent relationship
lam = np.logspace(np.log10(0.12), np.log10(3.0), num=1000)

# setup the inputs for the blackbody function
wavelengths = lam*1e4*u.AA
Expand All @@ -37,7 +37,7 @@ Example: Extinguish a Blackbody
flux = blackbody_lambda(wavelengths, temperature)

# initialize the model
ext = F99(Rv=3.1)
ext = F20(Rv=3.1)

# get the extinguished blackbody flux for different amounts of dust
flux_ext_av05 = flux*ext.extinguish(wavelengths, Av=0.5)
Expand Down
12 changes: 6 additions & 6 deletions docs/dust_extinction/model_flavors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ R(V) (+ other variables) dependent prediction models
import astropy.units as u

from dust_extinction.parameter_averages import (CCM89, O94, F99, F04,
VCG04, GCC09, M14)
VCG04, GCC09, M14, F20)

fig, ax = plt.subplots()

Expand All @@ -86,7 +86,7 @@ R(V) (+ other variables) dependent prediction models

Rv = 3.1

models = [CCM89, O94, F99, F04, VCG04, GCC09, M14]
models = [CCM89, O94, F99, F04, VCG04, GCC09, M14, F20]

for cmodel in models:
ext_model = cmodel(Rv=Rv)
Expand All @@ -112,7 +112,7 @@ R(V) (+ other variables) dependent prediction models
import astropy.units as u

from dust_extinction.parameter_averages import (CCM89, O94, F99, F04,
VCG04, GCC09, M14)
VCG04, GCC09, M14, F20)

fig, ax = plt.subplots()

Expand All @@ -121,7 +121,7 @@ R(V) (+ other variables) dependent prediction models

Rv = 2.0

models = [CCM89, O94, F99, F04, VCG04, GCC09, M14]
models = [CCM89, O94, F99, F04, VCG04, GCC09, M14, F20]

for cmodel in models:
ext_model = cmodel(Rv=Rv)
Expand All @@ -148,7 +148,7 @@ R(V) (+ other variables) dependent prediction models
import astropy.units as u

from dust_extinction.parameter_averages import (CCM89, O94, F99, F04,
VCG04, GCC09, M14)
VCG04, GCC09, M14, F20)

fig, ax = plt.subplots()

Expand All @@ -157,7 +157,7 @@ R(V) (+ other variables) dependent prediction models

Rv = 5.5

models = [CCM89, O94, F99, F04, VCG04, GCC09, M14]
models = [CCM89, O94, F99, F04, VCG04, GCC09, M14, F20]

for cmodel in models:
ext_model = cmodel(Rv=Rv)
Expand Down
File renamed without changes.
28 changes: 14 additions & 14 deletions dust_extinction/parameter_averages.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .averages import G03_SMCBar
from .shapes import _curve_F99_method

__all__ = ["CCM89", "O94", "F99", "F04", "VCG04", "GCC09", "M14", "G16", "F19"]
__all__ = ["CCM89", "O94", "F99", "F04", "VCG04", "GCC09", "M14", "G16", "F20"]

x_range_CCM89 = [0.3, 10.0]
x_range_O94 = x_range_CCM89
Expand All @@ -23,7 +23,7 @@
x_range_GCC09 = [3.3, 11.0]
x_range_M14 = [0.3, 3.3]
x_range_G16 = [0.3, 10.0]
x_range_F19 = [0.3, 8.7]
x_range_F20 = [0.3, 8.7]


class CCM89(BaseExtRvModel):
Expand Down Expand Up @@ -1136,11 +1136,11 @@ def evaluate(in_x, RvA, fA):
return alav


class F19(BaseExtRvModel):
class F20(BaseExtRvModel):
"""
F19 extinction model calculation
F20 extinction model calculation
Fitzpatrick, Massa, Gordon et al. (2019, in prep) model.
Fitzpatrick, Massa, Gordon et al. (2020, almost submitted) model.
Based on a sample of stars observed spectroscopically in the
optical with HST/STIS.
Expand All @@ -1156,9 +1156,9 @@ class F19(BaseExtRvModel):
Notes
-----
F19 Milky Way R(V) dependent extinction model
F20 Milky Way R(V) dependent extinction model
Example showing F19 curves for a range of R(V) values.
Example showing F20 curves for a range of R(V) values.
.. plot::
:include-source:
Expand All @@ -1167,20 +1167,20 @@ class F19(BaseExtRvModel):
import matplotlib.pyplot as plt
import astropy.units as u
from dust_extinction.parameter_averages import F19
from dust_extinction.parameter_averages import F20
fig, ax = plt.subplots()
# temp model to get the correct x range
text_model = F19()
text_model = F20()
# generate the curves and plot them
x = np.arange(text_model.x_range[0],
text_model.x_range[1],0.1)/u.micron
Rvs = ['2.0','3.0','4.0','5.0','6.0']
for cur_Rv in Rvs:
ext_model = F19(Rv=cur_Rv)
ext_model = F20(Rv=cur_Rv)
ax.plot(x,ext_model(x),label='R(V) = ' + str(cur_Rv))
ax.set_xlabel(r'$x$ [$\mu m^{-1}$]')
Expand All @@ -1191,11 +1191,11 @@ class F19(BaseExtRvModel):
"""

Rv_range = [2.0, 6.0]
x_range = x_range_F19
x_range = x_range_F20

def evaluate(self, in_x, Rv):
"""
F19 function
F20 function
Parameters
----------
Expand Down Expand Up @@ -1225,15 +1225,15 @@ def evaluate(self, in_x, Rv):
x = x_quant.value

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, x_range_F19, "F19")
_test_valid_x_range(x, x_range_F20, "F20")

# ensure Rv is a single element, not numpy array
Rv = Rv[0]

# get the tabulated information
data_path = pkg_resources.resource_filename("dust_extinction", "data/")

a = Table.read(data_path + "F19_tabulated.dat", format="ascii")
a = Table.read(data_path + "F20_tabulated.dat", format="ascii")

# compute E(lambda-55)/E(B-55) on the tabulated x points
k_rV_tab_x = a["k_3.02"].data + a["deltak"].data * (Rv - 3.10) * 0.990
Expand Down

0 comments on commit 6aa86c4

Please sign in to comment.