Skip to content

Commit

Permalink
Merge pull request #88 from phajy/main
Browse files Browse the repository at this point in the history
Cut-off power law model from XSPEC
  • Loading branch information
fjebaker authored Apr 13, 2024
2 parents 9ed8c8e + 3898b73 commit a332a37
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/xspec-models/additive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,58 @@ function XS_PowerLaw(; K = FitParam(1.0), a = FitParam(1.0))
XS_PowerLaw(K, a)
end

"""
XS_CutOffPowerLaw(K, a)
$(FIELDS)
# Example
```julia
using SpectralFitting
using UnicodePlots
energy = 10 .^collect(range(-1.0, 2.0, 100))
m = invokemodel(energy, XS_CutOffPowerLaw())
lineplot(energy[1:end-1],m,xscale=:log10,yscale=:log10,xlim=(1e-1,1e2),ylim=(1e-6,1e0),xlabel="Energy (keV)",ylabel="Flux",title="XS_CutOffPowerLaw",canvas=DotCanvas)
```
```
XS_CutOffPowerLaw
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
10⁰ β”‚:.. β”‚
β”‚ '':... β”‚
β”‚ '':.. β”‚
β”‚ '''.. β”‚
β”‚ '':.. β”‚
β”‚ '':. β”‚
β”‚ ':. β”‚
Flux β”‚ '.. β”‚
β”‚ ':. β”‚
β”‚ '. β”‚
β”‚ : β”‚
β”‚ :. β”‚
β”‚ : β”‚
β”‚ : β”‚
10⁻⁢ β”‚ :β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
10⁻¹ 10²
Energy (keV)
```
"""
@xspecmodel :C_zcutoffpl struct XS_CutOffPowerLaw{T} <: AbstractSpectralModel{T,Additive}
"Normalisation."
K::T
"Photon index."
Ξ“::T
"Cut-off energy (keV)."
Ecut::T
"Redshift."
z::T
end
function XS_CutOffPowerLaw(; K = FitParam(1.0), Ξ“ = FitParam(2.0), Ecut = FitParam(15.0), z = FitParam(0.0, frozen=true))
XS_CutOffPowerLaw(K, Ξ“, Ecut, z)
end

"""
XS_BlackBody(K, T)
Expand Down Expand Up @@ -634,6 +686,7 @@ function XS_Jet(;
end

export XS_PowerLaw,
XS_CutOffPowerLaw,
XS_BlackBody,
XS_BremsStrahlung,
XS_Laor,
Expand Down

0 comments on commit a332a37

Please sign in to comment.