From 6aa86c4a573a06fe5c4753f1bd2dfb32da5a1372 Mon Sep 17 00:00:00 2001 From: Karl Gordon Date: Tue, 4 Jun 2019 10:29:05 -0400 Subject: [PATCH] Docs updates for F20 --- docs/dust_extinction/choose_model.rst | 7 +++-- docs/dust_extinction/extinguish.rst | 10 +++---- docs/dust_extinction/model_flavors.rst | 12 ++++---- .../{F19_tabulated.dat => F20_tabulated.dat} | 0 dust_extinction/parameter_averages.py | 28 +++++++++---------- 5 files changed, 30 insertions(+), 27 deletions(-) rename dust_extinction/data/{F19_tabulated.dat => F20_tabulated.dat} (100%) diff --git a/docs/dust_extinction/choose_model.rst b/docs/dust_extinction/choose_model.rst index a3a6505..95b7e7d 100644 --- a/docs/dust_extinction/choose_model.rst +++ b/docs/dust_extinction/choose_model.rst @@ -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. @@ -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 ----- diff --git a/docs/dust_extinction/extinguish.rst b/docs/dust_extinction/extinguish.rst index 52b85bb..af5ffe2 100644 --- a/docs/dust_extinction/extinguish.rst +++ b/docs/dust_extinction/extinguish.rst @@ -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 @@ -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) diff --git a/docs/dust_extinction/model_flavors.rst b/docs/dust_extinction/model_flavors.rst index e351164..30772e5 100644 --- a/docs/dust_extinction/model_flavors.rst +++ b/docs/dust_extinction/model_flavors.rst @@ -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() @@ -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) @@ -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() @@ -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) @@ -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() @@ -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) diff --git a/dust_extinction/data/F19_tabulated.dat b/dust_extinction/data/F20_tabulated.dat similarity index 100% rename from dust_extinction/data/F19_tabulated.dat rename to dust_extinction/data/F20_tabulated.dat diff --git a/dust_extinction/parameter_averages.py b/dust_extinction/parameter_averages.py index 987b39f..351b9fb 100644 --- a/dust_extinction/parameter_averages.py +++ b/dust_extinction/parameter_averages.py @@ -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 @@ -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): @@ -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. @@ -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: @@ -1167,12 +1167,12 @@ 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], @@ -1180,7 +1180,7 @@ class F19(BaseExtRvModel): 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}$]') @@ -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 ---------- @@ -1225,7 +1225,7 @@ 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] @@ -1233,7 +1233,7 @@ def evaluate(self, in_x, Rv): # 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