Skip to content

Krang api

Raytracing Functions

Krang.emission_radius Function
julia
emission_radius(
    pix::Krang.AbstractPixel,
    θs,
    isindir,
    n
) -> Tuple{Any, Any, Any, Any, Bool}

Emission radius for point originating at inclination θs whose nth order image appears at the screen coordinate (α, β). Returns 0 if the emission coordinates do not exist for that screen coordinate.

Arguments

  • pix : Pixel information

  • θs : Emission inclination

  • isindir : Is emission to observer direct or indirect

  • n : Image index

source

julia
emission_radius(
    pix::Krang.AbstractPixel,
    τ
) -> Tuple{Any, Any, Any, Bool}

Emission radius for point originating at at Mino time τ whose image appears at the screen coordinate (α, β). Returns 0 if the emission coordinates do not exist for that screen coordinate.

Arguments

-pix : Pixel information

  • τ : Mino time

source

Krang.emission_inclination Function
julia
emission_inclination(pix::Krang.AbstractPixel, rs, νr)

Emission inclination for point originating at inclination rs whose nth order image appears at screen coordinate (α, β).

Arguments

  • pix : Pixel information

  • rs : Emission radius

  • νr : Sign of radial velocity direction at emission. This is always positive for case 3 and case 4 geodesics.

source

julia
emission_inclination(
    pix::Krang.AbstractPixel,
    τ
) -> NTuple{6, Any}

Emission inclination for point at Mino time τ whose image appears at screen coordinate (α, β).

Arguments

  • pix : Pixel information

  • τ : Mino Time

source

Krang.emission_coordinates_fast_light Function
julia
emission_coordinates_fast_light(
    pix::Krang.AbstractPixel,
    θs,
    isindir,
    n
) -> Tuple{Any, Any, Any, Any, Any, Bool}

Emission radius and azimuthal angle for point originating at inclination θs whose nth order image appears at the screen coordinate (α, β) for an observer located at inclination θo.

Arguments

  • pix : Pixel information

  • θs : Emission Inclination

  • isindir : Whether emission to observer is direct or indirect

  • n : Image index

source

Krang.emission_coordinates Function
julia
emission_coordinates(
    pix::Krang.AbstractPixel,
    θs,
    isindir,
    n
) -> Tuple{Any, Any, Any, Any, Any, Any, Bool}

Emission radius and azimuthal angle for point originating at inclination θs whose nth order image appears at the screen coordinate (α, β) for an observer located at inclination θo.

Arguments

  • pix : Pixel information

  • θs : Emission Inclination

  • isindir : Whether emission to observer is direct or indirect

  • n : Image index

source

julia
emission_coordinates(
    pix::Krang.AbstractPixel,
    τ
) -> Tuple{Any, Any, Any, Any, Any, Any, Bool}

Raytrace a point that appears at the screen coordinate (α, β) for an observer located at inclination θo

Arguments

  • pix : Pixel information

  • τ : Mino Time

source

Krang.mino_time Function
julia
mino_time(pix, rs, isindir) -> Any

Mino time of trajectory between an observer at infinity and point at radius rs

Arguments

  • pix : Pixel information

  • rs : Emission radius

  • isindir : Is the path direct or indirect?

source

julia
mino_time(pix::Krang.AbstractPixel, θs, isindir, n) -> Any

Mino time of trajectory between two inclinations for a given screen coordinate

Arguments

  • pix : Pixel information

  • θs : Emission inclination

  • isindir : Is the path direct or indirect?

  • n : nth image in orde of amount of minotime traversed

source

Metric Functions

Krang.AbstractMetric Type
julia
abstract type AbstractMetric

Abstract Metric Type

source

Krang.Kerr Type
julia
struct Kerr{T} <: Krang.AbstractMetric

Kerr Metric in Boyer Lindquist Coordinates

  • mass: M = mass

  • spin: a = J/M, where J is the angular momentum and M is the mass of the blackhole.

source

Krang.metric_uu Function
julia
metric_uu(metric::Krang.AbstractMetric, args...) -> Any

Returns the inverse metric in some representation (usually as an nxn matrix).

source

julia
metric_uu(metric::Kerr{T}, r, θ) -> Any

Inverse Kerr metric in Boyer Lindquist (BL) coordinates.

source

julia
metric_uu(metric::Kerr{T}, coordinates) -> Any

Inverse Kerr metric in Boyer Lindquist (BL) coordinates.

Arguments

  • metric : Kerr metric

  • coordinates : Coordinates (t, r, θ, ϕ)

source

Krang.metric_dd Function
julia
metric_dd(metric::Krang.AbstractMetric, args...) -> Any

Returns the metric in some representation (usually as an nxn matrix).

source

julia
metric_dd(metric::Kerr{T}, r, θ) -> Any

Kerr metric in Boyer Lindquist (BL) coordinates.

source

julia
metric_dd(metric::Kerr{T}, coordinates) -> Any

Kerr metric in Boyer Lindquist (BL) coordinates.

Arguments

  • metric : Kerr metric

  • coordinates : Coordinates (t, r, θ, ϕ)

source

Krang.horizon Function
julia
horizon(metric::Kerr{T}) -> Any

Outer Horizon for the Kerr metric.

source

Krang.λ Function
julia
λ(_::Kerr, α, θo) -> Any

Energy reduced azimuthal angular momentum

Arguments

  • metric: Kerr

  • α: Horizontal Bardeen screen coordinate

  • θo: Observer inclination

source

Krang.η Function
julia
η(metric::Kerr, α, β, θo) -> Any

Energy reduced Carter integral

Arguments

  • metric: Kerr

  • α: Horizontal Bardeen screen coordinate

  • β: Bardeen vertical coordinate

  • θo: Observer inclination

source

Radial Integrals

Krang.r_potential Function
julia
r_potential(metric::Kerr{T}, η, λ, r) -> Any

Radial potential of spacetime

Arguments

  • metric: Kerr{T} metric

  • η : Reduced Carter constant

  • λ : Reduced azimuthal angular momentum

  • r : Boyer Lindquist radius

source

Krang.get_radial_roots Function
julia
get_radial_roots(metric::Kerr{T}, η, λ) -> NTuple{4, Any}

Returns roots of r4+(a2ηλ2)r2+2(η+(aλ)2)ra2η

Arguments

  • metric: Kerr{T} metric

  • η : Reduced Carter constant

  • λ : Reduced azimuthal angular momentum

source

Krang.Ir Function
julia
Ir(pix::Krang.AbstractPixel, νr::Bool, rs) -> Any

Returns the antiderivative Ir=drR(r). See r_potential(x) for an implementation of R(r).

Arguments

  • pix : Pixel information

  • νr : Sign of radial velocity direction at emission. This is always positive for case 3 and case 4 geodesics.

  • rs : Emission radius

source

Angular Integrals

Krang.θ_potential Function
julia
θ_potential(metric::Kerr{T}, η, λ, θ) -> Any

Theta potential of a Kerr blackhole

Arguments

  • metric: Kerr{T} metric

  • η : Reduced Carter constant

  • λ : Reduced azimuthal angular momentum

  • θ : Boyer Lindquist inclination

source

Krang.Gθ Function
julia
(
    pix::Krang.AbstractPixel,
    θs,
    isindir,
    n
) -> Tuple{Any, Any, Any, Any, Any, Bool}

Returns the antiderivative Gθ=dθΘ(θ). See θ_potential(x) for an implementation of Θ(heta).

Arguments

  • pix : Pixel information

  • θs : Emission inclination

  • isindir : Is the path direct or indirect?

  • n : nth image ordered by minotime

source

Screen Coordinates

Krang.α Function
julia
α(_::Kerr, λ, θo) -> Any

Horizontal Bardeen Screen Coordinate

Arguments

  • metric: Kerr

  • α: Horizontal Bardeen screen coordinate

  • θo: Observer inclination

source

Krang.β Function
julia
β(metric::Kerr, λ, η, θo) -> Any

Vertical Bardeen Screen Coordinate

Arguments

  • metric: Kerr

  • λ: Energy reduced Azimuthal angular momentul

  • η: Energy reduced Carter integral

  • θo: Observer inclination

source

Krang.αboundary Function
julia
αboundary(metric::Kerr, θs) -> Any

Defines a horizontal boundary on the assmyptotic observer's screen that emission that from θs must fall within.

Arguments

  • metric: Kerr metric

  • θs : Emission Inclination

source

Krang.βboundary Function
julia
βboundary(metric::Kerr{T}, α, θo, θs) -> Any

Defines a vertical boundary on the assmyptotic observer's screen that emission that from θs must fall within.

Arguments

  • metric: Kerr{T} metric

  • α : Horizontal Bardeen screen coordinate

  • θo : Observer inclination

  • θs : Emission Inclination

source

Polarization Functions

Krang.p_bl_d Function
julia
p_bl_d(
    metric::Kerr{T},
    r,
    θ,
    η,
    λ,
    νr::Bool,
    νθ::Bool
) -> Any
Returns the momentum form in the Boyer-Lindquist basis.

source

Krang.jac_bl_u_zamo_d Function
julia
jac_bl_u_zamo_d(metric::Kerr{T}, r, θ) -> Any

Jacobian which converts ZAMO vector to a Boyer-Lindquist basis

source

Krang.jac_zamo_u_bl_d Function
julia
jac_zamo_u_bl_d(metric::Kerr{T}, r, θ) -> Any

Jacobian which converts Boyer-Lindquist vector to a ZAMO basis

source

Krang.jac_bl_d_zamo_u Function
julia
jac_bl_d_zamo_u(metric::Kerr{T}, r, θ) -> Any

Jacobian which converts ZAMO covector to a Boyer-Lindquist basis

source

Krang.jac_zamo_d_bl_u Function
julia
jac_zamo_d_bl_u(metric::Kerr{T}, r, θ) -> Any

Returns the Jacobian which converts a Boyer-Lindquist covector to ZAMO basis.

source

Krang.jac_fluid_u_zamo_d Function
julia
jac_fluid_u_zamo_d(_::Kerr{T}, β, θ, φ) -> Any

Jacobian which expreases ZAMO vector in the fluid frame

source

Krang.screen_polarization Function
julia
screen_polarization(
    metric::Kerr{T},
    κ::Complex,
    θ,
    α,
    β
) -> Tuple{Any, Any}

Returns the screen polarization associated with a killing spinor κ as seen seen by an assymptotic observer.

source

Krang.penrose_walker Function
julia
penrose_walker(
    metric::Kerr{T},
    r,
    θ,
    p_u::AbstractVector,
    f_u::AbstractVector
) -> Tuple{Any, Any}

Returns the Penrose walker constant for a photon with momentum p_u emitted from a fluid particle with momentum f_u.

source

Krang.synchrotronIntensity Function
julia
synchrotronIntensity(
    metric::Kerr{T},
    α,
    β,
    ri,
    θs,
    θo,
    magfield::StaticArraysCore.SArray{Tuple{3}, T, 1, 3},
    βfluid::StaticArraysCore.SArray{Tuple{3}, T, 1, 3},
    νr::Bool,
    θsign::Bool
) -> Tuple{Any, Any, Any}

Calculates the intensity of a photon emitted from a fluid particle with momentum f_u and observed by an asymptotic observer.

source

Krang.synchrotronPolarization Function
julia
synchrotronPolarization(
    metric::Kerr{T},
    α,
    β,
    ri,
    θs,
    θo,
    magfield::StaticArraysCore.SArray{Tuple{3}, T, 1, 3},
    βfluid::StaticArraysCore.SArray{Tuple{3}, T, 1, 3},
    νr::Bool,
    θsign::Bool
) -> NTuple{4, Any}

Calculates the polarization of a photon emitted from a fluid particle with momentum f_u and observed by an asymptotic observer.

source

Krang.Mesh Type
julia
struct Mesh{G<:Krang.AbstractGeometry, M<:Krang.AbstractMaterial}

source

Krang.ElectronSynchrotronPowerLawPolarization Type
julia
struct ElectronSynchrotronPowerLawPolarization <: Krang.AbstractMaterial

Linear polarization material from https://doi.org/10.3847/1538-4357/abf117

source

Krang.UnionGeometry Type
julia
struct UnionGeometry{G1, G2} <: Krang.AbstractGeometry

Geometry that is comprised of the union of two geometries.

source

Misc

Krang._isreal2 Function
julia
_isreal2(num::Complex{T}) -> Any

Checks if a complex number is real to some tolerance

source

Krang.regularized_Pi Function
julia
regularized_Pi(n, ϕ, k) -> Any

Regularized elliptic integral of the third kind

Arguments

  • n: Parameter

  • ϕ: Arguments

  • k: Parameter

source

Krang.radial_inf_integrals_case4 Function
julia
radial_inf_integrals_case4(
    metric::Kerr{T},
    roots::NTuple{4, T} where T
) -> NTuple{4, Any}

Returns the radial integrals for the case where there are no real roots in the radial potential

source

Krang.It_w_I0_terms Function
julia
It_w_I0_terms(
    metric::Kerr{T},
    rs,
    τ,
    roots::NTuple{4, T} where T,
    λ,
    νr
) -> Any

Returns the antiderivative It=r2Δ+2Mr(r2+a2aλ)ΔR(r)dr with I0 terms.

See r_potential(x) for an implementation of R(r).

Arguments

  • metric: Kerr{T} metric

  • roots : Radial roots

  • λ : Reduced azimuthal angular momentum

  • νr : Radial emission direction (Only necessary for case 1&2 geodesics)

source

Krang.Ir_inf Function
julia
Ir_inf(metric::Kerr{T}, roots) -> Any

Returns the antiderivative Ir=drR(r) evaluated at infinity. See r_potential(x) for an implementation of R(r).

Arguments

  • metric: Kerr{T} metric

  • roots : Roots of the radial potential

source

Krang.emission_azimuth Function
julia
emission_azimuth(
    pix::Krang.AbstractPixel,
    θs,
    rs,
    τ,
    νr,
    isindir,
    n
) -> Any

Emission azimuth for point at Mino time τ whose image appears at screen coordinate (α, β).

Arguments

  • pix : Pixel information

  • θs : Emission Inclination

  • rs :Emission radius

  • τ : Mino Time

  • νr : Sign of radial velocity direction at emission. This is always positive for case 3 and case 4 geodesics.

source

Krang.ConeGeometry Type
julia
struct ConeGeometry{T, A} <: Krang.AbstractGeometry

Cone Geometry with half opening angle opening_angle.

source

Krang.Iϕ Function
julia
(pix::Krang.AbstractPixel, rs, τ, νr) -> Any

Returns the antiderivative Iϕ=a(2Mraλ)ΔR(r)dr. See r_potential(x) for an implementation of R(r).

Arguments

  • pix: SlowLightIntensityPixel

  • rs : Emission radius

  • τ : Mino time

  • νr : Sign of radial velocity direction at emission. This is always positive for case 3 and case 4 geodesics.

source

Krang.SlowLightIntensityCamera Type
julia
struct SlowLightIntensityCamera{T, A} <: Krang.AbstractCamera

Observer sitting at radial infinity. The frame of this observer is alligned with the Boyer-Lindquist frame.

source

Krang.Iϕ_w_I0_terms Function
julia
Iϕ_w_I0_terms(metric::Kerr{T}, rs, τ, roots, νr, λ) -> Any

Returns the antiderivative Iϕ=a(2Mraλ)ΔR(r)dr with full I0 terms.

See r_potential(x) for an implementation of R(r).

Arguments

  • metric: Kerr{T} metric

  • τ: Minotime

  • roots : Radial roots

  • νr : Radial emission direction (Only necessary for case 1&2 geodesics)

  • λ : Reduced azimuthal angular momentum

source

Krang.SlowLightIntensityPixel Type
julia
struct SlowLightIntensityPixel{T} <: Krang.AbstractPixel{T}

Intensity Pixel Type.

source

Krang.Iϕ_inf Function
julia
Iϕ_inf(metric::Kerr{T}, roots, λ) -> Any

Returns the antiderivative Iϕ=a(2Mraλ)ΔR(r)dr evaluated at infinity without I0 terms.

See r_potential(x) for an implementation of R(r).

Arguments

  • metric: Kerr{T} metric

  • roots : Radial roots

  • λ : Reduced azimuthal angular momentum

source

Krang.radial_inf_integrals_case3 Function
julia
radial_inf_integrals_case3(
    metric::Kerr{T},
    roots::NTuple{4, T} where T
) -> NTuple{4, Any}

Returns the radial integrals for the case where there are two real roots in the radial potential

source

Krang.AbstractPixel Type
julia
abstract type AbstractPixel{T}

Abstract Pixel Type

source

Krang.radial_w_I0_terms_integrals_case2 Function
julia
radial_w_I0_terms_integrals_case2(
    metric::Kerr{T},
    rs,
    roots::NTuple{4, T} where T,
    τ,
    νr
) -> Tuple

Returns the radial integrals for the case where there are four real roots in the radial potential, with roots outside the horizon.

source

Krang.SlowLightIntensityScreen Type
julia
struct SlowLightIntensityScreen{T, A<:(AbstractMatrix)} <: Krang.AbstractScreen

Screen made of Intensity Pixels.

source

Krang.radial_w_I0_terms_integrals_case4 Function
julia
radial_w_I0_terms_integrals_case4(
    metric::Kerr{T},
    rs,
    roots::NTuple{4, T} where T,
    τ
) -> NTuple{4, Any}

Returns the radial integrals for the case where there are no real roots in the radial potential

source

Krang.radial_integrals Function
julia
radial_integrals(
    pix::Krang.AbstractPixel,
    rs,
    τ,
    νr
) -> NTuple{5, Any}

Return the radial integrals

  • pix: SlowLightIntensityPixel

  • rs : Emission radius

  • τ : Mino time

  • νr : Sign of radial velocity direction at emission. This is always positive for case 3 and case 4 geodesics.

source

Krang.AbstractCamera Type
julia
abstract type AbstractCamera

Abstract Observer Type

source

Krang.IntensityScreen Type
julia
struct IntensityScreen{T, A<:(AbstractMatrix)} <: Krang.AbstractScreen

Screen made of Intensity Pixels.

source

Krang.It Function
julia
It(pix::Krang.AbstractPixel, rs, τ, νr) -> Any

Returns the antiderivative It=a(2Mraλ)ΔR(r)dr. See r_potential(x) for an implementation of R(r).

Arguments

  • pix: SlowLightIntensityPixel

  • rs : Emission radius

  • τ : Mino time

  • νr : Sign of radial velocity direction at emission. This is always positive for case 3 and case 4 geodesics.

source

Krang.IntensityPixel Type
julia
struct IntensityPixel{T} <: Krang.AbstractPixel{T}

Intensity Pixel Type. Each Pixel is associated with a single ray, and caches some information about the ray.

source

Krang.AbstractMaterial Type
julia
abstract type AbstractMaterial

Abstract Material

source

Krang.AbstractScreen Type
julia
abstract type AbstractScreen

Abstract Screen Type

source

Krang.radial_w_I0_terms_integrals_case3 Function
julia
radial_w_I0_terms_integrals_case3(
    metric::Kerr{T},
    rs,
    roots::NTuple{4, T} where T,
    τ
) -> NTuple{4, Any}

Returns the radial integrals for the case where there are two real roots in the radial potential

source

Krang.IntensityCamera Type
julia
struct IntensityCamera{T, A} <: Krang.AbstractCamera

Observer sitting at radial infinity. The frame of this observer is alligned with the Boyer-Lindquist frame.

source

Krang.Ir_s Function
julia
Ir_s(metric::Kerr{T}, rs, roots, νr) -> Any

Returns the antiderivative Ir=drR(r). See r_potential(x) for an implementation of R(r).

Arguments

  • metric: Kerr{T} metric

  • rs : Emission radius

  • roots : Roots of the radial potential

  • νr : Radial emission direction (Only necessary for case 1&2 geodesics)

source

Krang.AbstractGeometry Type
julia
abstract type AbstractGeometry

Abstract Geometry

source

Krang.radial_inf_integrals_case2 Function
julia
radial_inf_integrals_case2(
    metric::Kerr{T},
    roots::NTuple{4, T} where T
) -> NTuple{4, Any}

Returns the radial integrals for the case where there are four real roots in the radial potential, with roots outside the horizon.

source

Krang.It_inf Function
julia
It_inf(
    metric::Kerr{T},
    roots::NTuple{4, T} where T,
    λ
) -> Any

Returns the antiderivative It=r2Δ+2Mr(r2+a2aλ)ΔR(r)dr evaluated at infinity without I0 terms.

See r_potential(x) for an implementation of R(r).

Arguments

  • metric: Kerr{T} metric

  • roots : Radial roots

  • λ : Reduced azimuthal angular momentum

source