Skip to content

Commit

Permalink
Merge ce464f4 into 15d8357
Browse files Browse the repository at this point in the history
  • Loading branch information
karllark committed Mar 27, 2020
2 parents 15d8357 + ce464f4 commit 7c6bb68
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions docs/dust_extinction/choose_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Simple Average Curves

These are straightforward averages of observed extinction curves. They are the
simplest models and include models for the MW
(:class:`~dust_extinction.averages.RL85_MWAvg`,
(:class:`~dust_extinction.averages.RL85_MWGC`,
:class:`~dust_extinction.averages.I05_MWAvg`,
:class:`~dust_extinction.averages.CT06_MWLoc`,
:class:`~dust_extinction.averages.CT06_MWGC`,
Expand All @@ -35,12 +35,12 @@ Way, the usual average used is R(V) = 3.1.
+==============+=============+==================+==============+
| GCC09_MWAvg | 0.3 - 10.96 | 0.0912 - 3.3 | MW |
+--------------+-------------+------------------+--------------+
| RL85_MWAvg | 0.08 - 0.8 | 1.25 - 13.0 | MW |
+--------------+-------------+------------------+--------------+
| I05_MWAvg | 0.13 - 0.8 | 1.24 - 7.76 | MW |
+--------------+-------------+------------------+--------------+
| CT06_MWLoc | 0.037 - 0.8 | 1.24 - 27.0 | MW (Local) |
+--------------+-------------+------------------+--------------+
| RL85_MWGC | 0.08 - 0.8 | 1.25 - 13.0 | MW (GCenter) |
+--------------+-------------+------------------+--------------+
| CT06_MWGC | 0.037 - 0.8 | 1.24 - 27.0 | MW (GCenter) |
+--------------+-------------+------------------+--------------+
| F11_MWGC | 0.05 - 0.8 | 1.28 - 19.1 | MW (GCenter) |
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 @@ -60,7 +60,7 @@ Average models
import matplotlib.pyplot as plt
import astropy.units as u

from dust_extinction.averages import (RL85_MWAvg,
from dust_extinction.averages import (RL85_MWGC,
I05_MWAvg,
CT06_MWLoc,
CT06_MWGC,
Expand All @@ -71,7 +71,7 @@ Average models
# generate the curves and plot them
x = 1.0 / (np.arange(1.0, 40.0 ,0.1) * u.micron)

models = [RL85_MWAvg, I05_MWAvg, CT06_MWLoc, CT06_MWGC,
models = [RL85_MWGC, I05_MWAvg, CT06_MWLoc, CT06_MWGC,
F11_MWGC]

for cmodel in models:
Expand Down
30 changes: 15 additions & 15 deletions dust_extinction/averages.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .shapes import P92, _curve_F99_method

__all__ = [
"RL85_MWAvg",
"RL85_MWGC",
"G03_SMCBar",
"G03_LMCAvg",
"G03_LMC2",
Expand All @@ -23,7 +23,7 @@
]


class RL85_MWAvg(BaseExtAveModel):
class RL85_MWGC(BaseExtAveModel):
"""
Reike & Lebofsky (1985) MW Average Extinction Curve
Expand All @@ -48,17 +48,17 @@ class RL85_MWAvg(BaseExtAveModel):
import matplotlib.pyplot as plt
import astropy.units as u
from dust_extinction.averages import RL85_MWAvg
from dust_extinction.averages import RL85_MWGC
fig, ax = plt.subplots()
# define the extinction model
ext_model = RL85_MWAvg()
ext_model = RL85_MWGC()
# generate the curves and plot them
x = np.arange(1.0/ext_model.x_range[1], 1.0/ext_model.x_range[0], 0.1) * u.micron
ax.plot(x,ext_model(x),label='RL85_MWAvg')
ax.plot(x,ext_model(x),label='RL85_MWGC')
ax.plot(1.0/ext_model.obsdata_x, ext_model.obsdata_axav, 'ko',
label='obsdata')
Expand Down Expand Up @@ -89,7 +89,7 @@ class RL85_MWAvg(BaseExtAveModel):

def evaluate(self, in_x):
"""
RL85 MWAvg function
RL85 MWGC function
Parameters
----------
Expand All @@ -112,7 +112,7 @@ def evaluate(self, in_x):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "RL85_MWAvg")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# define the function using simple linear interpolation
# avoids negative values of alav that happens with cubic splines
Expand Down Expand Up @@ -242,7 +242,7 @@ def evaluate(self, in_x):
optnir_axav_x,
optnir_axav_y,
self.x_range,
"G03_SMCBar",
self.__class__.__name__,
)


Expand Down Expand Up @@ -361,7 +361,7 @@ def evaluate(self, in_x):
optnir_axav_x,
optnir_axav_y,
self.x_range,
"G03_LMCAvg",
self.__class__.__name__,
)


Expand Down Expand Up @@ -483,7 +483,7 @@ def evaluate(self, in_x):
optnir_axav_x,
optnir_axav_y,
self.x_range,
"G03_LMC2",
self.__class__.__name__,
)


Expand Down Expand Up @@ -578,7 +578,7 @@ def evaluate(self, in_x):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "I05_MWAvg")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# define the function allowing for spline interpolation
f = interp1d(self.obsdata_x, self.obsdata_axav)
Expand Down Expand Up @@ -680,7 +680,7 @@ def evaluate(self, in_x):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "CT06_MWGC")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# define the function allowing for spline interpolation
f = interp1d(self.obsdata_x, self.obsdata_axav)
Expand Down Expand Up @@ -782,7 +782,7 @@ def evaluate(self, in_x):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "CT06_MWLoc")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# define the function allowing for spline interpolation
f = interp1d(self.obsdata_x, self.obsdata_axav)
Expand Down Expand Up @@ -920,7 +920,7 @@ def evaluate(self, in_x):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "GCC09_MWAvg")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# P92 parameters fit to the data using uncs as weights
p92_fit = P92(
Expand Down Expand Up @@ -1050,7 +1050,7 @@ def evaluate(self, in_x):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "F11_MWGC")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# define the function allowing for spline interpolation
f = interp1d(self.obsdata_x, self.obsdata_axav)
Expand Down
8 changes: 4 additions & 4 deletions dust_extinction/parameter_averages.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def evaluate(self, in_x, Rv):
optnir_axav_x,
optnir_axebv_y / Rv,
self.x_range,
"F99",
self.__class__.__name__,
)


Expand Down Expand Up @@ -546,7 +546,7 @@ def evaluate(self, in_x, Rv):
optnir_axav_x,
optnir_axebv_y / Rv,
self.x_range,
"F04",
self.__class__.__name__,
)


Expand Down Expand Up @@ -867,7 +867,7 @@ def evaluate(self, in_x, Rv):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, x_range_M14, "M14")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# just in case someone calls evaluate explicitly
Rv = np.atleast_1d(Rv)
Expand Down Expand Up @@ -1212,7 +1212,7 @@ def evaluate(self, in_x, Rv):
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, self.x_range, "F19")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# just in case someone calls evaluate explicitly
Rv = np.atleast_1d(Rv)
Expand Down
2 changes: 1 addition & 1 deletion dust_extinction/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def evaluate(
x = _get_x_in_wavenumbers(in_x)

# check that the wavenumbers are within the defined range
_test_valid_x_range(x, x_range_P92, "P92")
_test_valid_x_range(x, self.x_range, self.__class__.__name__)

# calculate the terms
lam = 1.0 / x
Expand Down
4 changes: 2 additions & 2 deletions dust_extinction/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)
from dust_extinction.shapes import FM90, P92
from dust_extinction.averages import (
RL85_MWAvg,
RL85_MWGC,
G03_SMCBar,
G03_LMCAvg,
G03_LMC2,
Expand All @@ -29,7 +29,7 @@
param_ave_models = param_ave_models_Rv + param_ave_models_Rv_fA
shape_models = [FM90, P92]
ave_models = [
RL85_MWAvg,
RL85_MWGC,
G03_SMCBar,
G03_LMCAvg,
G03_LMC2,
Expand Down

0 comments on commit 7c6bb68

Please sign in to comment.