diff --git a/.gitignore b/.gitignore index b2f37439..89fe9179 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,4 @@ Manifest.toml # Housekeeping files generated by Visual Studio Code .vscode -docs/code/examples.jl +docs/examples-code.jl diff --git a/docs/code/getting-started.jl b/docs/code/getting-started.jl deleted file mode 100644 index 26a4e313..00000000 --- a/docs/code/getting-started.jl +++ /dev/null @@ -1,275 +0,0 @@ -DIRR = @__DIR__() * "/../src/figs/" - -# --------------------------------------------------------- - -using Gradus - -struct Schwarzschild{T} <: AbstractStaticAxisSymmetric{T} - M::T -end - -function Gradus.metric_components(m::Schwarzschild, x) - r, θ = x - M = m.M - - dt2 = -(1 - (2M / r)) - dr2 = -inv(dt2) - dθ2 = r^2 - dϕ2 = r^2 * sin(θ)^2 - dtdϕ = zero(r) - - SVector(dt2, dr2, dθ2, dϕ2, dtdϕ) -end - -Gradus.inner_radius(m::Schwarzschild) = 2 * m.M - -# --------------------------------------------------------- - -m = Schwarzschild(1.0) - -x = SVector(0.0, 1000.0, π / 2, 0.0) -v = SVector(0.0, -1.0, 0.0, -8e-6) - -sol = tracegeodesics(m, x, v, 2000.0) - -using Plots - -p = plot_paths(sol) -plot_horizon!(m, color = :black) - -# --------------------------------------------------------- - -# grid of impact parameters in horizontal direction -# keeping β fixed at 0 -α = range(-10.0, 10.0, 30) -vs = map_impact_parameters(m, x, α, 0.0) - -# need a position for each velocity vector -xs = fill(x, size(vs)) - -sols = tracegeodesics(m, xs, vs, 2000.0) - -# plot -p = plot_paths(sols, legend = false) -plot_horizon!(m, color = :black) - -# --------------------------------------------------------- - -# set up our image parameters -α = range(-10.0, 10.0, 100) -β = range(-10.0, 10.0, 100) - -# this will set up a 100x100 matrix of velocity vectors -# so we use `vec` to flatten the structure -vs = vec([map_impact_parameters(m, x, a, b) for a in α, b in β]) -xs = fill(x, size(vs)) - -# trace in parallel -sols = tracegeodesics(m, xs, vs, 2000.0, save_on = false) - -# --------------------------------------------------------- - -points = unpack_solution.(sols.u) -# reshape into the same dimensions as the image -points = reshape(points, (100, 100)) - -times = map(points) do gp - # check if went off the integration chart on the inner boundary - if gp.status == StatusCodes.WithinInnerBoundary - # get the time coordinate - gp.x[1] - else - NaN - end -end - -p = heatmap(α, β, times, aspect_ratio = 1) - -# --------------------------------------------------------- - -time_coord = PointFunction((m, gp, λ) -> gp.x[1]) - -# --------------------------------------------------------- - -filter_event_horizon = FilterStatusCode(StatusCodes.WithinInnerBoundary) -# compose in reverse order -pf = time_coord ∘ filter_event_horizon - -# --------------------------------------------------------- - -times = pf.(m, points, 2000.0) - -# --------------------------------------------------------- - -α, β, image = rendergeodesics( - m, - x, - # no longer need to specify the velocities - # these are automatically calculated - 2000.0, - pf = pf, - # image parameters - image_width = 800, - image_height = 800, - # the "zoom" -- field of view scale - fov = 52, - verbose = true, -) - -heatmap(α, β, image, aspect_ratio = 1) - -# --------------------------------------------------------- - -function cross_section(x) - # centered circle on 12 rg - center = 8 - radius = 3 - - if (x < center - radius) || (radius + center < x) - zero(x) - else - r = x - center - sqrt(radius^2 - r^2) + (0.5sin(3x)) - end -end - -# preview the cross section over a sample range -sample = collect(range(0.0, 20.0, 300)) -y = cross_section.(sample) - -plot(sample, y, xlabel = "r", ylabel = "height", aspect_ratio = 1) - - -savefig(DIRR * "getting-started-5-cross-section.svg") -# --------------------------------------------------------- - -d = ThickDisc(x -> cross_section(x[2])) - -# --------------------------------------------------------- - -pf_geometry = time_coord ∘ ConstPointFunctions.filter_intersected() - -# --------------------------------------------------------- - -# change inclination -x = SVector(0.0, 1000.0, deg2rad(75), 0.0) - -α, β, image = rendergeodesics( - m, - x, - # add the disc argument - d, - 2000.0, - # new point function - pf = pf_geometry, - # slightly wider image - image_width = 1200, - image_height = 800, - # zoom out a little - fov = 22, - verbose = true, -) - -heatmap(α, β, image, aspect_ratio = 1) - -savefig(DIRR * "getting-started-6-weird-disc-render.png") -# --------------------------------------------------------- - -redshift = ConstPointFunctions.redshift(m, x) -# compose to filter those that intersected with the geometry -redshift_geometry = redshift ∘ ConstPointFunctions.filter_intersected() - -# --------------------------------------------------------- - -α, β, image = rendergeodesics( - m, - x, - d, - 2000.0, - # new point function - pf = redshift_geometry, - image_width = 1200, - image_height = 800, - fov = 22, - verbose = true, -) - -heatmap(α, β, image, aspect_ratio = 1) - -savefig(DIRR * "getting-started-7-weird-redshift.png") -# -------------------------------------- - -j_m = JohannsenMetric(M = 1.0, a = 0.7, α13 = 2.0, ϵ3 = 1.0) -is_naked_singularity(j_m) - -# pass the new metric -j_redshift = ConstPointFunctions.redshift(j_m, x) -j_redshift_geometry = j_redshift ∘ ConstPointFunctions.filter_intersected() - -α, β, image = rendergeodesics( - # pass the new metric - j_m, - x, - d, - 2000.0, - # and the new point function - pf = j_redshift_geometry, - image_width = 1200, - image_height = 800, - fov = 22, - verbose = true, -) - -heatmap(α, β, image, aspect_ratio = 1) - -savefig(DIRR * "getting-started-8-jm-weird-redshift.png") -# --------------------------------------------------------- - -# define custom bins for g -bins = collect(range(0.1, 1.4, 200)) - -# define the plane to perform the binning over -plane = PolarPlane(GeometricGrid(); Nr = 1000, Nθ = 1000, r_max = 50.0) - -# --------------------------------------------------------- - -p = plot(PolarPlane(GeometricGrid(); Nr = 10, Nθ = 20, r_max = 50.0)) - -# --------------------------------------------------------- - -function calculate_line_profile(m, x, d, bins, plane) - _, f = lineprofile( - m, - x, - d, - algorithm = BinnedLineProfile(), - # no false images - callback = domain_upper_hemisphere(), - verbose = true, - bins = bins, - plane = plane, - ) - return f -end - -# --------------------------------------------------------- - - -# geometric thin disc in the equitorial plane -d_j_thin = GeometricThinDisc(Gradus.isco(j_m), 200.0, π / 2) -# and for the schwarzschild metric -d_s_thin = GeometricThinDisc(Gradus.isco(m), 200.0, π / 2) - -f_j_thick_disc = calculate_line_profile(j_m, x, d, bins, plane) -f_s_thick_disc = calculate_line_profile(m, x, d, bins, plane) -f_j_thin_disc = calculate_line_profile(j_m, x, d_j_thin, bins, plane) -f_s_thin_disc = calculate_line_profile(m, x, d_s_thin, bins, plane) - -plot(bins, f_j_thick_disc, label = "Johannsen[thick]") -plot!(bins, f_s_thick_disc, label = "Schwarzschild[thick]") -plot!(bins, f_j_thin_disc, label = "Johannsen[thin]") -plot!(bins, f_s_thin_disc, label = "Schwarzschild[thin]") - - -savefig(DIRR * "getting-started-10-line-profiles.svg") -# --------------------------------------------------------- diff --git a/docs/extract-examples.jl b/docs/extract-examples.jl index dcefc0cb..0429ae30 100644 --- a/docs/extract-examples.jl +++ b/docs/extract-examples.jl @@ -1,27 +1,34 @@ -lines = readlines(@__DIR__() * "/src/examples.md") - -examples = String[] - -itt = Iterators.Stateful(lines) -for line in itt - if line == "```julia" - code = String[] - while (line = popfirst!(itt)) != "```" - push!(code, line) - end - push!(examples, join(code, "\n")) - # check if we're supposed to output a picture or not - img = match(r"!\[.*\]\((.*)\)\s*$", peek(itt)) - if !isnothing(img) - filename = last(splitdir(first(img.captures))) - savepath = joinpath(@__DIR__() * "/src/example-figures/", filename) - save_line = "savefig(\"$savepath\")" - push!(examples, save_line) +function add_julia_code!(examples::Vector{String}, src_file) + lines = readlines(src_file) + itt = Iterators.Stateful(enumerate(lines)) + for (lineno, line) in itt + if line == "```julia" + code = String["# $(src_file):$(lineno)"] + while ((_, line) = popfirst!(itt))[2] != "```" + push!(code, line) + end + push!(examples, join(code, "\n")) + # check if we're supposed to output a picture or not + (_, next_line) = peek(itt) + img = match(r"!\[.*\]\((.*)\)\s*$", next_line) + if !isnothing(img) + filename = last(splitdir(first(img.captures))) + savepath = joinpath(@__DIR__() * "/src/example-figures/", filename) + save_line = "savefig(\"$savepath\")" + push!(examples, save_line) + end end end end -open(@__DIR__() * "/code/examples.jl", "w") do f +file1 = @__DIR__() * "/src/examples.md" +file2 = @__DIR__() * "/src/getting-started.md" + +examples = String[] +add_julia_code!(examples, file1) +add_julia_code!(examples, file2) + +open(@__DIR__() * "/examples-code.jl", "w") do f for code in examples write(f, code) write(f, "\n", "#"^100, "\n\n") diff --git a/docs/src/example-figures/example-3d-tracing.svg b/docs/src/example-figures/example-3d-tracing.svg index db3e065b..c0c64666 100644 --- a/docs/src/example-figures/example-3d-tracing.svg +++ b/docs/src/example-figures/example-3d-tracing.svg @@ -1,481 +1,459 @@ - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-bambi-fig1.svg b/docs/src/example-figures/example-bambi-fig1.svg index 8eab01b5..981d0b99 100644 --- a/docs/src/example-figures/example-bambi-fig1.svg +++ b/docs/src/example-figures/example-bambi-fig1.svg @@ -1,48 +1,48 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-bambi-fig2.svg b/docs/src/example-figures/example-bambi-fig2.svg index 33da1c21..7277e8ca 100644 --- a/docs/src/example-figures/example-bambi-fig2.svg +++ b/docs/src/example-figures/example-bambi-fig2.svg @@ -1,50 +1,48 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-circular-orbits.svg b/docs/src/example-figures/example-circular-orbits.svg index 2386af70..d1d7f1e1 100644 --- a/docs/src/example-figures/example-circular-orbits.svg +++ b/docs/src/example-figures/example-circular-orbits.svg @@ -1,46 +1,46 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-concentric.svg b/docs/src/example-figures/example-concentric.svg index e5cad0c4..4668b33e 100644 --- a/docs/src/example-figures/example-concentric.svg +++ b/docs/src/example-figures/example-concentric.svg @@ -1,54 +1,54 @@ - + - + - + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-covariant-radiative-transfer.png b/docs/src/example-figures/example-covariant-radiative-transfer.png index 75100ca3..26aab16d 100644 Binary files a/docs/src/example-figures/example-covariant-radiative-transfer.png and b/docs/src/example-figures/example-covariant-radiative-transfer.png differ diff --git a/docs/src/example-figures/example-exclusion.png b/docs/src/example-figures/example-exclusion.png index 4b8b96b2..9d4f9edf 100644 Binary files a/docs/src/example-figures/example-exclusion.png and b/docs/src/example-figures/example-exclusion.png differ diff --git a/docs/src/example-figures/example-horizon.svg b/docs/src/example-figures/example-horizon.svg index 22287620..72bd2801 100644 --- a/docs/src/example-figures/example-horizon.svg +++ b/docs/src/example-figures/example-horizon.svg @@ -1,62 +1,62 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-hot-spot-fast.png b/docs/src/example-figures/example-hot-spot-fast.png new file mode 100644 index 00000000..847c8836 Binary files /dev/null and b/docs/src/example-figures/example-hot-spot-fast.png differ diff --git a/docs/src/example-figures/example-hot-spot-slow.png b/docs/src/example-figures/example-hot-spot-slow.png new file mode 100644 index 00000000..cff1eaed Binary files /dev/null and b/docs/src/example-figures/example-hot-spot-slow.png differ diff --git a/docs/src/example-figures/example-hot-spot-slow.svg b/docs/src/example-figures/example-hot-spot-slow.svg deleted file mode 100644 index fe6e9180..00000000 --- a/docs/src/example-figures/example-hot-spot-slow.svg +++ /dev/null @@ -1,877 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/src/example-figures/example-interpolated.png b/docs/src/example-figures/example-interpolated.png index 8cbaf088..64db4fe1 100644 Binary files a/docs/src/example-figures/example-interpolated.png and b/docs/src/example-figures/example-interpolated.png differ diff --git a/docs/src/example-figures/example-isco.svg b/docs/src/example-figures/example-isco.svg index 3c7b1a10..c73a39f3 100644 --- a/docs/src/example-figures/example-isco.svg +++ b/docs/src/example-figures/example-isco.svg @@ -1,46 +1,46 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-line-profile.svg b/docs/src/example-figures/example-line-profile.svg index 36ad5365..67eac8fa 100644 --- a/docs/src/example-figures/example-line-profile.svg +++ b/docs/src/example-figures/example-line-profile.svg @@ -1,43 +1,43 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-redshift-histogram.svg b/docs/src/example-figures/example-redshift-histogram.svg index ed70d278..8c09250c 100644 --- a/docs/src/example-figures/example-redshift-histogram.svg +++ b/docs/src/example-figures/example-redshift-histogram.svg @@ -1,48 +1,48 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/example-redshift.png b/docs/src/example-figures/example-redshift.png index 807dd19f..7119e3a9 100644 Binary files a/docs/src/example-figures/example-redshift.png and b/docs/src/example-figures/example-redshift.png differ diff --git a/docs/src/example-figures/example-reverb-tf-with-tf.png b/docs/src/example-figures/example-reverb-tf-with-tf.png index d46e2678..e7601617 100644 Binary files a/docs/src/example-figures/example-reverb-tf-with-tf.png and b/docs/src/example-figures/example-reverb-tf-with-tf.png differ diff --git a/docs/src/example-figures/example-reverb-tf.png b/docs/src/example-figures/example-reverb-tf.png index c839e191..85cf970b 100644 Binary files a/docs/src/example-figures/example-reverb-tf.png and b/docs/src/example-figures/example-reverb-tf.png differ diff --git a/docs/src/example-figures/example-shadow.png b/docs/src/example-figures/example-shadow.png index 9c5e02e5..57a56d5a 100644 Binary files a/docs/src/example-figures/example-shadow.png and b/docs/src/example-figures/example-shadow.png differ diff --git a/docs/src/example-figures/example-thick-disc-doughnut.png b/docs/src/example-figures/example-thick-disc-doughnut.png index 21ea750a..32945d59 100644 Binary files a/docs/src/example-figures/example-thick-disc-doughnut.png and b/docs/src/example-figures/example-thick-disc-doughnut.png differ diff --git a/docs/src/example-figures/example-tracing.svg b/docs/src/example-figures/example-tracing.svg index c4b0ea56..c62c642b 100644 --- a/docs/src/example-figures/example-tracing.svg +++ b/docs/src/example-figures/example-tracing.svg @@ -1,63 +1,63 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/figs/getting-started-1-trajectories.svg b/docs/src/example-figures/getting-started-1-trajectories.svg similarity index 80% rename from docs/src/figs/getting-started-1-trajectories.svg rename to docs/src/example-figures/getting-started-1-trajectories.svg index dafda814..98da4666 100644 --- a/docs/src/figs/getting-started-1-trajectories.svg +++ b/docs/src/example-figures/getting-started-1-trajectories.svg @@ -1,48 +1,48 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/figs/getting-started-10-line-profiles.svg b/docs/src/example-figures/getting-started-10-line-profiles.svg similarity index 100% rename from docs/src/figs/getting-started-10-line-profiles.svg rename to docs/src/example-figures/getting-started-10-line-profiles.svg diff --git a/docs/src/example-figures/getting-started-2-multi-trajectories.svg b/docs/src/example-figures/getting-started-2-multi-trajectories.svg new file mode 100644 index 00000000..013e017c --- /dev/null +++ b/docs/src/example-figures/getting-started-2-multi-trajectories.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/getting-started-3-basic-shadow.png b/docs/src/example-figures/getting-started-3-basic-shadow.png new file mode 100644 index 00000000..75784b26 Binary files /dev/null and b/docs/src/example-figures/getting-started-3-basic-shadow.png differ diff --git a/docs/src/example-figures/getting-started-4-hr-shadow.png b/docs/src/example-figures/getting-started-4-hr-shadow.png new file mode 100644 index 00000000..878cbac0 Binary files /dev/null and b/docs/src/example-figures/getting-started-4-hr-shadow.png differ diff --git a/docs/src/figs/getting-started-5-cross-section.svg b/docs/src/example-figures/getting-started-5-cross-section.svg similarity index 81% rename from docs/src/figs/getting-started-5-cross-section.svg rename to docs/src/example-figures/getting-started-5-cross-section.svg index 6ca070d6..753e719d 100644 --- a/docs/src/figs/getting-started-5-cross-section.svg +++ b/docs/src/example-figures/getting-started-5-cross-section.svg @@ -1,44 +1,44 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/example-figures/getting-started-6-weird-disc-render.png b/docs/src/example-figures/getting-started-6-weird-disc-render.png new file mode 100644 index 00000000..ce397f4e Binary files /dev/null and b/docs/src/example-figures/getting-started-6-weird-disc-render.png differ diff --git a/docs/src/example-figures/getting-started-7-weird-redshift.png b/docs/src/example-figures/getting-started-7-weird-redshift.png new file mode 100644 index 00000000..019bb638 Binary files /dev/null and b/docs/src/example-figures/getting-started-7-weird-redshift.png differ diff --git a/docs/src/example-figures/getting-started-8-jm-weird-redshift.png b/docs/src/example-figures/getting-started-8-jm-weird-redshift.png new file mode 100644 index 00000000..fbf86160 Binary files /dev/null and b/docs/src/example-figures/getting-started-8-jm-weird-redshift.png differ diff --git a/docs/src/figs/getting-started-9-polar-plane.svg b/docs/src/example-figures/getting-started-9-polar-plane.svg similarity index 64% rename from docs/src/figs/getting-started-9-polar-plane.svg rename to docs/src/example-figures/getting-started-9-polar-plane.svg index b023c138..f71f130d 100644 --- a/docs/src/figs/getting-started-9-polar-plane.svg +++ b/docs/src/example-figures/getting-started-9-polar-plane.svg @@ -1,250 +1,250 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/examples.md b/docs/src/examples.md index 130d1107..5b615f9f 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -72,7 +72,7 @@ p = heatmap( α, β, img, - color = :grayC, + color = Plots.cgrad(:thermal, rev = true), xlabel = "α", ylabel = "β", aspect_ratio = 1, @@ -615,14 +615,16 @@ a, b, img = rendergeodesics( hs, 20_000.0, verbose = true, + αlims = (-15, 15), + βlims = (-10, 10), trace = Gradus.TraceRadiativeTransfer(I₀ = 0.0), pf = PointFunction((m, gp, t) -> gp.aux[1]), ) heatmap(a, b, img) ``` -![](./example-figures/example-hot-spot-slow.svg) +![](./example-figures/example-hot-spot-slow.png) In the fast light regime, with an initial radial angle of `-2.6` gives a very different picture -![](./example-figures/example-hot-spot-fast.svg) \ No newline at end of file +![](./example-figures/example-hot-spot-fast.png) \ No newline at end of file diff --git a/docs/src/figs/getting-started-2-multi-trajectories.svg b/docs/src/figs/getting-started-2-multi-trajectories.svg deleted file mode 100644 index 53e7141e..00000000 --- a/docs/src/figs/getting-started-2-multi-trajectories.svg +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/src/figs/getting-started-3-basic-shadow.png b/docs/src/figs/getting-started-3-basic-shadow.png deleted file mode 100644 index 315bd068..00000000 Binary files a/docs/src/figs/getting-started-3-basic-shadow.png and /dev/null differ diff --git a/docs/src/figs/getting-started-4-hr-shadow.png b/docs/src/figs/getting-started-4-hr-shadow.png deleted file mode 100644 index d717050f..00000000 Binary files a/docs/src/figs/getting-started-4-hr-shadow.png and /dev/null differ diff --git a/docs/src/figs/getting-started-6-weird-disc-render.png b/docs/src/figs/getting-started-6-weird-disc-render.png deleted file mode 100644 index f0b5b6b0..00000000 Binary files a/docs/src/figs/getting-started-6-weird-disc-render.png and /dev/null differ diff --git a/docs/src/figs/getting-started-7-weird-redshift.png b/docs/src/figs/getting-started-7-weird-redshift.png deleted file mode 100644 index 6c5b37f1..00000000 Binary files a/docs/src/figs/getting-started-7-weird-redshift.png and /dev/null differ diff --git a/docs/src/figs/getting-started-8-jm-weird-redshift.png b/docs/src/figs/getting-started-8-jm-weird-redshift.png deleted file mode 100644 index 839b6fd6..00000000 Binary files a/docs/src/figs/getting-started-8-jm-weird-redshift.png and /dev/null differ diff --git a/docs/src/getting-started.md b/docs/src/getting-started.md index bd571029..b60174ca 100644 --- a/docs/src/getting-started.md +++ b/docs/src/getting-started.md @@ -122,8 +122,7 @@ plot_paths(sol) # plot plot_horizon!(m) ``` - -![](./figs/getting-started-1-trajectories.svg) +![](./example-figures/getting-started-1-trajectories.svg) Choosing the initial velocity in this manner lacks interpretation. We can instead use so-called _impact parameters_ $(\alpha, \beta)$. These may be thought of as follows: @@ -150,8 +149,7 @@ sols = tracegeodesics(m, xs, vs, λ_max) p = plot_paths(sols, legend=false) plot_horizon!(m, color = :black) ``` - -![](./figs/getting-started-2-multi-trajectories.svg) +![](./example-figures/getting-started-2-multi-trajectories.svg) When we invoke [`tracegeodesics`](@ref) in this way, Gradus.jl will automatically distribute the workload onto as many threads as Julia was started with. For example, starting julia with @@ -211,8 +209,7 @@ end heatmap(α, β, times, aspect_ratio = 1) ``` - -![](./figs/getting-started-3-basic-shadow.png) +![](./example-figures/getting-started-3-basic-shadow.png) This is the so-called _shadow_ of a black hole. @@ -256,15 +253,15 @@ Point functions can also be used in other contexts. For example, [`rendergeodesi # image parameters image_width = 800, image_height = 800, - # the "zoom" -- field of view scale - fov = 52, + # the "zoom" -- use the impact parameter axes + αlims = (-10, 10), + βlims = (-8, 8), verbose = true ) heatmap(α, β, image, aspect_ratio = 1) ``` - -![](./figs/getting-started-4-hr-shadow.png) +![](./example-figures/getting-started-4-hr-shadow.png) This is good, but let's make our render a bit more interesting. @@ -303,13 +300,12 @@ y = cross_section.(sample) plot(sample, y, xlabel = "r", ylabel = "height", aspect_ratio = 1) ``` - -![](./figs/getting-started-5-cross-section.svg) +![](./example-figures/getting-started-5-cross-section.svg) We then wrap our cross section function as a [`ThickDisc`](@ref) type: ```julia -d = ThickDisc(x -> cross_section(x[2])) +d = ThickDisc(r -> cross_section(r)) ``` The thick disc callback receives the full four-position, so we forward only the radial component. @@ -338,14 +334,14 @@ x = SVector(0.0, 1000.0, deg2rad(70), 0.0) image_width = 1200, image_height = 800, # zoom out a little - fov = 22, + αlims = (-20, 20), + βlims = (-15, 15), verbose = true ) heatmap(α, β, image, aspect_ratio = 1) ``` - -![](./figs/getting-started-6-weird-disc-render.png) +![](./example-figures/getting-started-6-weird-disc-render.png) ## 6 Calculating physical quantities @@ -377,14 +373,14 @@ This is another [`PointFunction`](@ref), and is used in the same way. Rendering pf = redshift_geometry, image_width = 1200, image_height = 800, - fov = 22, + αlims = (-20, 20), + βlims = (-15, 15), verbose = true ) heatmap(α, β, image, aspect_ratio = 1) ``` - -![](./figs/getting-started-7-weird-redshift.png) +![](./example-figures/getting-started-7-weird-redshift.png) ## 7 Changing metric @@ -407,14 +403,14 @@ j_redshift_geometry = j_redshift ∘ ConstPointFunctions.filter_intersected() pf = j_redshift_geometry, image_width = 1200, image_height = 800, - fov = 22, + αlims = (-20, 20), + βlims = (-15, 15), verbose = true ) heatmap(α, β, image, aspect_ratio = 1) ``` - -![](./figs/getting-started-8-jm-weird-redshift.png) +![](./example-figures/getting-started-8-jm-weird-redshift.png) ## 8 Calculating line profiles @@ -444,8 +440,7 @@ plot( PolarPlane(GeometricGrid(); Nr = 10, Nθ = 20, r_max = 50.0) ) ``` - -![](./figs/getting-started-9-polar-plane.svg) +![](./example-figures/getting-started-9-polar-plane.svg) Each point on this plane represent a photon which will be traced, and the intensity scaled according to the area the point covers on the image plane. @@ -457,7 +452,7 @@ function calculate_line_profile(m, x, d, bins, plane) m, x, d, - algorithm = BinnedLineProfile(), + algorithm = BinningMethod(), # no false images callback = domain_upper_hemisphere(), verbose = true, @@ -471,9 +466,9 @@ end Note that [`lineprofile`](@ref) returns both the redshift $g$ (bins) and flux at each $g$. Since we specified the binning, we can ignore the first return value, and keep only the flux. ```julia -d_j_thin = GeometricThinDisc(Gradus.isco(j_m), 200.0, π / 2) +d_j_thin = ThinDisc(Gradus.isco(j_m), 200.0) # and for the schwarzschild metric -d_s_thin = GeometricThinDisc(Gradus.isco(m), 200.0, π / 2) +d_s_thin = ThinDisc(Gradus.isco(m), 200.0) f_j_thick_disc = calculate_line_profile(j_m, x, d, bins, plane) f_s_thick_disc = calculate_line_profile(m, x, d, bins, plane) @@ -485,8 +480,7 @@ plot!(bins, f_s_thick_disc, label = "Schwarzschild[thick]") plot!(bins, f_j_thin_disc, label = "Johannsen[thin]") plot!(bins, f_s_thin_disc, label = "Schwarzschild[thin]") ``` - -![](./figs/getting-started-10-line-profiles.svg) +![](./example-figures/getting-started-10-line-profiles.svg) !!! note For how to use these line profiles and other observables in fitting programs, see [Exporting data products](@ref).