/DustExtinction.jl

Models for interstellar dust extinction

Primary LanguageJuliaOtherNOASSERTION

DustExtinction.jl

Build Status PkgEval Coverage License

Stable Dev

Tools for interstellar dust extinction in astronomy

Documentation: DustExtinction

Installation

From package manager (] key)

pkg> add DustExtinction

Usage

Color laws:

julia> using DustExtinction

julia> CCM89(Rv=3.1)(4000)
1.4645557029425842

julia> CCM89(Rv=3.1).([4000, 5000])
2-element Vector{Float64}:
 1.46456
 1.12225

Dust maps:

julia> dustmap = SFD98Map()
SFD98Map("[...]")

julia> dustmap(0.1, 0.1)
0.793093095733043

julia> dustmap.([0.1, 0.2], [0.1, 0.2])
2-element Vector{Float64}:
 0.793093
 0.539507

Reddening:

julia> wave = [4000., 5000.]
2-element Vector{Float64}:
 4000.0
 5000.0

julia> flux = [1.0, 1.5]
2-element Vector{Float64}:
 1.0
 1.5

julia> red = redden.(CCM89, wave, flux; Av=0.3, Rv=3.1)
2-element Vector{Float64}:
 0.6671958182723856
 1.1000733242882896

julia> deredden.(CCM89(Rv=3.1), wave, red; Av=0.3)
2-element Vector{Float64}:
 1.0
 1.5

We provide first-class support for Unitful.jl and Measurements.jl packages, too! Check out the documentation for more examples.

Contributing

Feel free to open an issue or a pull-request for any discussion, suggestions, new features, or patches!