Skip to content

Commit 7ccd42d

Browse files
authored
Merge pull request #23 from JuliaAstro/fixup
Fixup
2 parents f4a63c0 + 1f12434 commit 7ccd42d

File tree

18 files changed

+191
-181
lines changed

18 files changed

+191
-181
lines changed

Project.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name = "Spectra"
22
uuid = "391af1a9-06f1-59d3-8d21-0be089654739"
3-
authors = ["Miles Lucas <mdlucas@hawaii.edu>"]
43
version = "0.1.0"
4+
authors = ["Miles Lucas <mdlucas@hawaii.edu>"]
5+
6+
[workspace]
7+
projects = ["test", "docs"]
58

69
[deps]
710
DustExtinction = "fb44c06c-c62f-5397-83f5-69249e0a3c8e"
@@ -11,7 +14,6 @@ PhysicalConstants = "5ad8b20f-a522-5ce9-bfc9-ddf1d5bda6ab"
1114
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1215
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1316
UnitfulAstro = "6112ee07-acf9-5e0f-b108-d242c714bf9f"
14-
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d"
1517

1618
[compat]
1719
DustExtinction = ">=0.6.0"
@@ -21,5 +23,4 @@ PhysicalConstants = "0.2"
2123
RecipesBase = "1"
2224
Unitful = "1"
2325
UnitfulAstro = "1"
24-
WCS = "0.6"
2526
julia = "1.10"

docs/Project.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ Spectra = "391af1a9-06f1-59d3-8d21-0be089654739"
77
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
88
UnitfulAstro = "6112ee07-acf9-5e0f-b108-d242c714bf9f"
99

10-
[sources]
11-
Spectra = {path = ".."}
12-
1310
[compat]
1411
Documenter = "1"
1512
UnitfulAstro = ">=0.4.0"

src/Spectra.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
module Spectra
22

3-
export spectrum
3+
# common.jl
4+
export AbstractSpectrum, spectrum
5+
# utils.jl
6+
export blackbody
7+
# transforms/redden.jl
8+
export redden, redden!, deredden, deredden!
9+
10+
using RecipesBase: @recipe
11+
using Measurements: Measurements, Measurement
12+
using Unitful: Unitful, Quantity, @u_str, ustrip, unit, dimension
13+
using PhysicalConstants.CODATA2018: h, c_0, k_B
414

515
# AbstractSpectrum and common functionality
616
include("common.jl")
@@ -31,7 +41,7 @@ julia> spec.name
3141
"Just Noise"
3242
```
3343
34-
There is easy integration with [Unitful.jl](https://github.com/painterqubits/unitful.jl)
44+
There is easy integration with [Unitful.jl](https://github.com/JuliaPhysics/Unitful.jl)
3545
and its sub-projects and [Measurements.jl](https://github.com/juliaphysics/measurements.jl)
3646
3747
```jldoctest

src/common.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
using WCS
2-
using Unitful
3-
4-
export AbstractSpectrum
5-
#--------------------------------------------------------------------------------------
6-
71
"""
82
AbstractSpectrum{W<:Number, F<:Number}
93

src/fitting/fitting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LinearAlgebra
1+
using LinearAlgebra: /, \, diagm, pinv
22

33
export continuum, line_flux, equivalent_width
44

src/plotting.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using RecipesBase, Unitful, Measurements
2-
31
@recipe function f(spec::Spectrum)
42
seriestype --> :step
53
xlabel --> "wave"

src/spectrum.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Unitful
2-
31
"""
42
Spectrum <: AbstractSpectrum
53

src/transforms/redden.jl

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,49 @@
1-
using DustExtinction
2-
import DustExtinction: redden, deredden
1+
import DustExtinction
32

4-
export redden,
5-
redden!,
6-
deredden,
7-
deredden!
83

94
"""
10-
redden!(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89)
5+
redden!(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89)
116
127
In-place version of [`redden`](@ref)
138
"""
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)
1611
return spec
1712
end
1813

1914
"""
20-
redden(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89)
15+
redden(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89)
2116
2217
Redden a spectrum using common color laws provided by [DustExtinction.jl](https://github.com/juliaastro/dustextinction.jl).
2318
`Av` is the total extinction, `Rv` is the selective extinction (3.1 is a common
2419
value for the Milky Way) and `law` is the color law to use for determining the
2520
extinction.
2621
"""
27-
function redden(spec::AbstractSpectrum, Av; Rv = 3.1, law = CCM89)
22+
function redden(spec::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89)
2823
tmp_spec = deepcopy(spec)
2924
redden!(tmp_spec, Av; Rv, law)
3025
return tmp_spec
3126
end
3227

3328
"""
34-
deredden!(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89)
29+
deredden!(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89)
3530
3631
In-place version of [`deredden`](@ref)
3732
"""
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)
4035
return spec
4136
end
4237

4338
"""
44-
deredden(::AbstractSpectrum, Av; Rv = 3.1, law = CCM89)
39+
deredden(::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89)
4540
4641
Deredden a spectrum using common color laws provided by [DustExtinction.jl](https://github.com/juliaastro/dustextinction.jl).
4742
`Av` is the total extinction, `Rv` is the selective extinction (3.1 is a common
4843
value for the Milky Way) and `law` is the color law to use for determining the
4944
extinction.
5045
"""
51-
function deredden(spec::AbstractSpectrum, Av; Rv = 3.1, law = CCM89)
46+
function deredden(spec::AbstractSpectrum, Av; Rv = 3.1, law = DustExtinction.CCM89)
5247
tmp_spec = deepcopy(spec)
5348
deredden!(tmp_spec, Av; Rv, law)
5449
return tmp_spec

src/utils.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
using Unitful, UnitfulAstro
2-
using PhysicalConstants.CODATA2018: h, c_0, k_B
3-
4-
export blackbody
5-
61
"""
72
blackbody(wave::Vector{<:Quantity}, T::Quantity)
83
blackbody(wave::Vector{<:Real}, T::Real)

test/Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
DustExtinction = "fb44c06c-c62f-5397-83f5-69249e0a3c8e"
44
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
5+
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
56
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
67
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
78
Spectra = "391af1a9-06f1-59d3-8d21-0be089654739"
89
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
910
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1011
UnitfulAstro = "6112ee07-acf9-5e0f-b108-d242c714bf9f"
11-
12-
[sources]
13-
Spectra = {path = ".."}

0 commit comments

Comments
 (0)