Skip to content

Commit cf7e854

Browse files
modified docs and added comments
1 parent 664075f commit cf7e854

File tree

1 file changed

+50
-33
lines changed

1 file changed

+50
-33
lines changed

src/fittable_laws.jl

+50-33
Original file line numberDiff line numberDiff line change
@@ -88,38 +88,43 @@ Pei (1992) generative model applicable from the extreme UV to far-IR.
8888
8989
## Parameters
9090
91-
* `BKG_amp` - background term amplitude
92-
* `BKG_lambda` - background term central wavelength
93-
* `BKG_b` - background term b coefficient
94-
* `BKG_n` - background term n coefficient
95-
96-
* `FUV_amp` - far-ultraviolet term amplitude
97-
* `FUV_lambda` - far-ultraviolet term central wavelength
98-
* `FUV_b` - far-ultraviolet term b coefficent
99-
* `FUV_n` - far-ultraviolet term n coefficient
100-
101-
* `NUV_amp` - near-ultraviolet (2175 Å) term amplitude
102-
* `NUV_lambda` - near-ultraviolet (2175 Å) term central wavelength
103-
* `NUV_b` - near-ultraviolet (2175 Å) term b coefficent
104-
* `NUV_n` - near-ultraviolet (2175 Å) term n coefficient
105-
106-
* `SIL1_amp` - 1st silicate feature (~10 micron) term amplitude
107-
* `SIL1_lambda` - 1st silicate feature (~10 micron) term central wavelength
108-
* `SIL1_b` - 1st silicate feature (~10 micron) term b coefficent
109-
* `SIL1_n` - 1st silicate feature (~10 micron) term n coefficient
110-
111-
* `SIL2_amp` - 2nd silicate feature (~18 micron) term amplitude
112-
* `SIL2_lambda` - 2nd silicate feature (~18 micron) term central wavelength
113-
* `SIL2_b` - 2nd silicate feature (~18 micron) term b coefficient
114-
* `SIL2_n` - 2nd silicate feature (~18 micron) term n coefficient
115-
116-
* `FIR_amp` - far-infrared term amplitude
117-
* `FIR_lambda` - far-infrared term central wavelength
118-
* `FIR_b` - far-infrared term b coefficent
119-
* `FIR_n` - far-infrared term n coefficient
120-
121-
If `λ` is a `Unitful.Quantity` it will be automatically converted to Å and the
122-
returned value will be `UnitfulAstro.mag`.
91+
Background Terms
92+
* `BKG_amp` - amplitude
93+
* `BKG_lambda` - central wavelength
94+
* `BKG_b` - b coefficient
95+
* `BKG_n` - n coefficient
96+
97+
Far-Ultraviolet Terms
98+
* `FUV_amp` - amplitude
99+
* `FUV_lambda` - central wavelength
100+
* `FUV_b` - b coefficent
101+
* `FUV_n` - n coefficient
102+
103+
Near-Ultraviolet (2175 Å) Terms
104+
* `NUV_amp` - amplitude
105+
* `NUV_lambda` - central wavelength
106+
* `NUV_b` - b coefficent
107+
* `NUV_n` - n coefficient
108+
109+
1st Silicate Feature (~10 micron) Terms
110+
* `SIL1_amp` - amplitude
111+
* `SIL1_lambda` - central wavelength
112+
* `SIL1_b` - b coefficent
113+
* `SIL1_n` - n coefficient
114+
115+
2nd Silicate Feature (~18 micron) Terms
116+
* `SIL2_amp` - amplitude
117+
* `SIL2_lambda` - central wavelength
118+
* `SIL2_b` - b coefficient
119+
* `SIL2_n` - n coefficient
120+
121+
Far-Infrared Terms
122+
* `FIR_amp` - amplitude
123+
* `FIR_lambda` - central wavelength
124+
* `FIR_b` - b coefficent
125+
* `FIR_n` - n coefficient
126+
127+
If `λ` is a `Unitful.Quantity` it will be automatically converted to Å and the returned value will be `UnitfulAstro.mag`.
123128
124129
## Examples
125130
```jldoctest
@@ -136,6 +141,18 @@ julia> P92(FUV_b = 2.0).([1000, 2000, 3000])
136141
137142
```
138143
144+
## Default Parameter Values
145+
146+
|Term |lambda|A|b|n|
147+
|:---:|:---:|:---:|:---:|:---:|
148+
|BKG |0.047 |218.57142857142858 |90 |2 |
149+
|FUV |0.07 |18.545454545454547 |4.0 |6.5|
150+
|NUV |0.22 |0.05961038961038961 |-1.95|2.0|
151+
|SIL1 |9.7 |0.0026493506493506496|-1.95|2.0|
152+
|SIL2 |18.0 |0.0026493506493506496|-1.8 |2.0|
153+
|FIR |25.0 |0.015896103896103898 |0.0 |2.0|
154+
155+
139156
## References
140157
[Pei (1992)](https://ui.adsabs.harvard.edu/abs/1992ApJ...395..130P)
141158
"""
@@ -192,7 +209,7 @@ function (law::P92)(wave::T) where T
192209
checkbounds(law, wave) || return zero(float(T))
193210

194211
x = aa_to_invum(wave)
195-
lam = 1.0 / x
212+
lam = 1.0 / x # wavelength is in microns
196213

197214
axav = _p92_single_term(lam, law.BKG_amp, law.BKG_lambda, law.BKG_b, law.BKG_n)
198215
axav += _p92_single_term(lam, law.FUV_amp, law.FUV_lambda, law.FUV_b, law.FUV_n)

0 commit comments

Comments
 (0)