diff --git a/docs/dust_extinction/choose_model.rst b/docs/dust_extinction/choose_model.rst index 794c507..8a71e50 100644 --- a/docs/dust_extinction/choose_model.rst +++ b/docs/dust_extinction/choose_model.rst @@ -28,7 +28,8 @@ Note the different valid wavelength ranges), the LMC (:class:`~dust_extinction.averages.G03_LMCAvg`, :class:`~dust_extinction.averages.G03_LMC2`) and the SMC (:class:`~dust_extinction.averages.G03_SMCBar`, -:class:`~dust_extinction.averages.G24_SMCAvg`). +:class:`~dust_extinction.averages.G24_SMCAvg`, +:class:`~dust_extinction.averages.G24_SMCBumps`). One often used alternative to these straight average models is to use one of the parameter dependent models with the average R(V) value. For the Milky @@ -66,7 +67,8 @@ Way, the usual average used is R(V) = 3.1. See the next section. +--------------+-------------+------------------+--------------+ | G24_SMCAvg | 0.3 - 10.0 | 0.1 - 3.3 | SMC | +--------------+-------------+------------------+--------------+ - +| G24_SMCBumps | 0.3 - 10.0 | 0.1 - 3.3 | SMC | ++--------------+-------------+------------------+--------------+ Parameter Dependent Average Curves ---------------------------------- diff --git a/docs/dust_extinction/model_flavors.rst b/docs/dust_extinction/model_flavors.rst index f6dc05c..359ad70 100644 --- a/docs/dust_extinction/model_flavors.rst +++ b/docs/dust_extinction/model_flavors.rst @@ -33,14 +33,16 @@ Average models G03_SMCBar, G03_LMCAvg, G03_LMC2, - G24_SMCAvg) + G24_SMCAvg, + G24_SMCBumps) fig, ax = plt.subplots() # generate the curves and plot them x = np.arange(0.3,11.0,0.1)/u.micron - models = [GCC09_MWAvg, B92_MWAvg, G03_SMCBar, G03_LMCAvg, G03_LMC2, G24_SMCAvg] + models = [GCC09_MWAvg, B92_MWAvg, G03_SMCBar, G03_LMCAvg, G03_LMC2, + G24_SMCAvg, G24_SMCBumps] for cmodel in models: ext_model = cmodel() diff --git a/docs/dust_extinction/references.rst b/docs/dust_extinction/references.rst index a0ffcf7..acc58f8 100644 --- a/docs/dust_extinction/references.rst +++ b/docs/dust_extinction/references.rst @@ -52,9 +52,11 @@ G16: `Gordon et al. 2016, ApJ 826, 104 G21: `Gordon et al. 2021, ApJ, 916, 33 `_ -G23: `Gordon et al. 2022, ApJ, 950, 86 +G23: `Gordon et al. 2023, ApJ, 950, 86 `_ +G24: Gordon et al. 2024, ApJ, in press + HD23: `Hensley & Draine 2023, ApJ, 948, 55 `_ diff --git a/dust_extinction/averages.py b/dust_extinction/averages.py index ff1c3e7..30e0334 100644 --- a/dust_extinction/averages.py +++ b/dust_extinction/averages.py @@ -24,7 +24,7 @@ "G21_MWAvg", "D22_MWAvg", "G24_SMCAvg", - # "G24_SMCBumps" + "G24_SMCBumps", ] @@ -1581,7 +1581,9 @@ def __init__(self, **kwargs): self.obsdata_axav_unc = a["unc"].data # accuracy of the observed data based on published table - self.obsdata_tolerance = 0.1 # large value driven by short wavelength uncertainties + self.obsdata_tolerance = ( + 0.1 # large value driven by short wavelength uncertainties + ) super().__init__(**kwargs) @@ -1632,3 +1634,126 @@ def evaluate(self, in_x): self.x_range, self.__class__.__name__, ) + + +class G24_SMCBumps(BaseExtModel): + r""" + Gordon et al (2024) SMC Bumps Extinction Curve + + Parameters + ---------- + None + + Raises + ------ + None + + Notes + ----- + From Gordon et al. (2024, ApJ, in press) + + Two data points in the FUV from the data file giving the observed average were removed + as they are *very* deviate from the FM90 parametrization. This cause the automated tests + to fail. + + Example showing the average curve + + .. plot:: + :include-source: + + import numpy as np + import matplotlib.pyplot as plt + import astropy.units as u + + from dust_extinction.averages import G24_SMCBumps + + fig, ax = plt.subplots() + + # define the extinction model + ext_model = G24_SMCBumps() + + # generate the curves and plot them + x = np.arange(ext_model.x_range[0], ext_model.x_range[1],0.1)/u.micron + + ax.plot(x,ext_model(x),label='G24 SMC Bumps') + ax.plot(ext_model.obsdata_x, ext_model.obsdata_axav, 'ko', + label='obsdata') + + ax.set_xlabel(r'$x$ [$\mu m^{-1}$]') + ax.set_ylabel(r'$A(x)/A(V)$') + + ax.legend(loc='best') + plt.show() + """ + + x_range = [0.3, 10.0] + + Rv = 2.59 + + def __init__(self, **kwargs): + + # get the tabulated information + data_path = pkg_resources.resource_filename("dust_extinction", "data/") + + # D22 sigma clipped average of 13 diffuse sightlines + a = Table.read(data_path + "G24_SMCBumps.dat", format="ascii.commented_header") + + # data + self.obsdata_x = 1.0 / a["wave"].data + self.obsdata_axav = a["A(l)/A(V)"].data + self.obsdata_axav_unc = a["unc"].data + + # accuracy of the observed data based on published table + self.obsdata_tolerance = ( + 0.1 # large value driven by short wavelength uncertainties + ) + + super().__init__(**kwargs) + + def evaluate(self, in_x): + """ + G24 SMCBumps function + + Parameters + ---------- + in_x: float + expects either x in units of wavelengths or frequency + or assumes wavelengths in wavenumbers [1/micron] + + internally wavenumbers are used + + Returns + ------- + axav: np array (float) + A(x)/A(V) extinction curve [mag] + + Raises + ------ + ValueError + Input x values outside of defined range + """ + C1 = -2.87 + C2 = 1.51 + C3 = 2.64 + C4 = 0.25 + xo = 4.73 + gamma = 1.16 + + optnir_axav_x = 1.0 / np.array([2.198, 1.65, 1.25, 0.55, 0.44, 0.37]) + optnir_axav_y = [0.068, 0.174, 0.302, 1.017, 1.394, 1.675] + + # return A(x)/A(V) + return _curve_F99_method( + in_x, + self.Rv, + C1, + C2, + C3, + C4, + xo, + gamma, + optnir_axav_x, + optnir_axav_y, + self.x_range, + self.__class__.__name__, + ) diff --git a/dust_extinction/data/G24_SMCBumps.dat b/dust_extinction/data/G24_SMCBumps.dat index 8ffa17d..9ce2d2e 100644 --- a/dust_extinction/data/G24_SMCBumps.dat +++ b/dust_extinction/data/G24_SMCBumps.dat @@ -1,7 +1,5 @@ # wave A(l)/A(V) unc type -0.112305922546031 4.27938281479861 0.41979972549018957 spec 0.11701444543424377 5.4176459980372185 0.1032219276339054 spec -0.12192037721493712 4.272988148773956 0.8216371204158461 spec 0.12703199442658303 4.752853473898855 0.08375995156522892 spec 0.13235792060868376 4.671941852629287 0.08390085400631052 spec 0.13790714085008998 4.395775332012629 0.0583456651927308 spec @@ -21,19 +19,12 @@ 0.24507681076473067 2.636005637080303 0.014538738385996147 spec 0.25535186791839903 2.514649982179777 0.007126586158241167 spec 0.26605771572574743 2.299400811815393 0.011083699616338564 spec -0.27094539999961853 2.334321136586501 0.03195466433109193 WFC3_F275W 0.27721241545733843 2.1865630620178007 0.02234139631596784 spec 0.28883478561811626 2.1714747651498394 0.007120837703763066 spec 0.30094443369511337 2.013597970861842 0.0120703720266099 spec -0.33499833941459656 1.8257437897333624 0.008129228237896528 WFC3_F336W 0.3628658354282379 1.6746842300512743 0.00040831423990903573 JohnU 0.43783867359161377 1.3942325108128082 0.006685972865933271 JohnB -0.46907517313957214 1.2932579177380588 0.00267344543998287 ACS_F475W 0.5442439317703247 1.01686775136653 0.0002159286715026245 JohnV -0.5572436451911926 0.9611119466969889 0.04265954068073023 ACS_F550M -0.7932101488113403 0.5757920680725783 0.013510368208852347 ACS_F814W -1.1072901487350464 0.30360021912429525 0.04379160995122052 WFC3_F110W 1.2309569120407104 0.3024797256658269 0.04839927738226376 JohnJ -1.5236843824386597 0.09086306686909129 0.07626826420000873 WFC3_F160W 1.6215280294418335 0.1738600487817531 0.04846869511215765 JohnH 2.1742196083068848 0.06818160198036438 0.0798256207489614 JohnK diff --git a/dust_extinction/tests/helpers.py b/dust_extinction/tests/helpers.py index 6dfea27..66e51ec 100644 --- a/dust_extinction/tests/helpers.py +++ b/dust_extinction/tests/helpers.py @@ -29,6 +29,7 @@ G21_MWAvg, D22_MWAvg, G24_SMCAvg, + G24_SMCBumps, ) from dust_extinction.grain_models import DBP90, WD01, D03, ZDA04, C11, J13, HD23 @@ -51,6 +52,7 @@ G21_MWAvg, D22_MWAvg, G24_SMCAvg, + G24_SMCBumps, ] grain_models = [DBP90, WD01, D03, ZDA04, C11, J13, HD23]