|
1 | | -using DustExtinction |
2 | | -import DustExtinction: redden, deredden |
| 1 | +import DustExtinction |
3 | 2 |
|
4 | | -export redden, |
5 | | - redden!, |
6 | | - deredden, |
7 | | - deredden! |
8 | 3 |
|
9 | 4 | """ |
10 | | - redden!(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
| 5 | + redden!(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
11 | 6 |
|
12 | 7 | In-place version of [`redden`](@ref) |
13 | 8 | """ |
14 | | -function redden!(spec::T, Av; Rv = 3.1, law = CCM89) where {T <: AbstractSpectrum} |
15 | | - @. spec.flux = redden(law, spec.wave, spec.flux; Rv, Av) |
| 9 | +function redden!(spec::T, Av; Rv = 3.1, law = DustExtinction.CCM89) where {T <: AbstractSpectrum} |
| 10 | + @. spec.flux = DustExtinction.redden(law, spec.wave, spec.flux; Rv, Av) |
16 | 11 | return spec |
17 | 12 | end |
18 | 13 |
|
19 | 14 | """ |
20 | | - redden(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
| 15 | + redden(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
21 | 16 |
|
22 | 17 | Redden a spectrum using common color laws provided by [DustExtinction.jl](https://github.com/juliaastro/dustextinction.jl). |
23 | 18 | `Av` is the total extinction, `Rv` is the selective extinction (3.1 is a common |
24 | 19 | value for the Milky Way) and `law` is the color law to use for determining the |
25 | 20 | extinction. |
26 | 21 | """ |
27 | | -function redden(spec::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
| 22 | +function redden(spec::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
28 | 23 | tmp_spec = deepcopy(spec) |
29 | 24 | redden!(tmp_spec, Av; Rv, law) |
30 | 25 | return tmp_spec |
31 | 26 | end |
32 | 27 |
|
33 | 28 | """ |
34 | | - deredden!(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
| 29 | + deredden!(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
35 | 30 |
|
36 | 31 | In-place version of [`deredden`](@ref) |
37 | 32 | """ |
38 | | -function deredden!(spec::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
39 | | - @. spec.flux = deredden(law, spec.wave, spec.flux; Rv, Av) |
| 33 | +function deredden!(spec::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
| 34 | + @. spec.flux = DustExtinction.deredden(law, spec.wave, spec.flux; Rv, Av) |
40 | 35 | return spec |
41 | 36 | end |
42 | 37 |
|
43 | 38 | """ |
44 | | - deredden(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
| 39 | + deredden(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
45 | 40 |
|
46 | 41 | Deredden a spectrum using common color laws provided by [DustExtinction.jl](https://github.com/juliaastro/dustextinction.jl). |
47 | 42 | `Av` is the total extinction, `Rv` is the selective extinction (3.1 is a common |
48 | 43 | value for the Milky Way) and `law` is the color law to use for determining the |
49 | 44 | extinction. |
50 | 45 | """ |
51 | | -function deredden(spec::AbstractSpectrum, Av; Rv = 3.1, law = CCM89) |
| 46 | +function deredden(spec::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89) |
52 | 47 | tmp_spec = deepcopy(spec) |
53 | 48 | deredden!(tmp_spec, Av; Rv, law) |
54 | 49 | return tmp_spec |
|
0 commit comments