Skip to content

Commit

Permalink
add missing export
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Haack committed Jul 17, 2024
1 parent feeb95d commit 3bce945
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AbstractMediumProperties"
uuid = "62ded331-ac74-4432-90fd-7fafc84e95f4"
authors = ["Christian Haack <[email protected]>"]
version = "1.3.0"
version = "1.3.1"

[compat]
julia = "1.10"
Expand Down
20 changes: 14 additions & 6 deletions src/AbstractMediumProperties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ absorption_length(wavelength, medium::MediumProperties) = _not_implemented(mediu



"""
group_refractive_index(wavelength, medium)
Return the group refractive index at `wavelength`.

`wavelength` is expected to be in units nm.
"""
group_refractive_index(wavelength, medium::MediumProperties) = _not_implemented(medium)

"""
phase_refractive_index(wavelength, medium)
Expand Down Expand Up @@ -107,6 +101,20 @@ function group_velocity(wavelength, medium::MediumProperties)
T(c_vac_m_ns) / (ref_ix - λ_0 * dispersion(wavelength, medium))
end

"""
group_refractive_index(wavelength, medium)
Return the group refractive index at `wavelength`.
`wavelength` is expected to be in units nm.
"""
function group_refractive_index(wavelength, medium)
global c_vac_m_ns

T = typeof(wavelength)

return T(c_vac_m_ns)/group_velocity(wavelength, medium)
end

include("utils.jl")


Expand Down
17 changes: 15 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ export refractive_index_fry
export dispersion_fry
export sca_len_part_conc
export calc_quan_fry_params

export hg_scattering_func, sl_scattering_func, mixed_hg_sl_scattering_func, mixed_hg_sl_scattering_func_ppc

export es_cumulative

"""
DIPPR105Params
Expand Down Expand Up @@ -190,11 +191,24 @@ CUDA-optimized version of Henyey-Greenstein scattering in one plane.
costheta::T = (1 / (2 * g) * (1 + g^2 - ((1 - g^2) / (1 + g * (2 * eta - 1)))^2))
#costheta::T = (1 / (2 * g) * (fma(g, g, 1) - (fma(-g, g, 1) / (fma(g, (fma(2, eta, -1)), 1)))^2))
return clamp(costheta, T(-1), T(1))
end


function es(cos_theta::T,b::T) where {T<:Real}
a = 1/(4*pi) * 1 / (1+b/3)
return a*(1+b*cos_theta^2)
end

function es_integral(cos_theta::T, b::T) where {T<:Real}
a = 1/(4*pi) * 1 / (1+b/3)
return a*cos_theta*(1 + (b*cos_theta^2)/3) * 2*pi
end

function es_cumulative(cos_theta::T, b::T) where {T<:Real}
return es_integral(cos_theta, b) - es_integral(-1., b)
end


"""
sl_scattering_func(g::Real)
Simplified-Liu scattering angle function.
Expand All @@ -211,7 +225,6 @@ function sl_scattering_func(g::T) where {T <: Real}
end



"""
mixed_hg_sl_scattering_func(g, hg_fraction)
Mixture model of HG and SL.
Expand Down

0 comments on commit 3bce945

Please sign in to comment.