This part contains plotting support for the LensFactory.jl package.
LensFactory.Lenses.plot_sky — Function
LensFactory.Lenses.plot_sky(θx::Matrix{<:RV}, θy::Matrix{<:RV})This function initializes a blank sky plot with specified axis labels and limits. The user can then add additional elements to the plot as needed. The function returns the figure and axis objects for further customization.
Arguments
θx::Matrix{<:RV}– x-coordinates gridθy::Matrix{<:RV}– y-coordinates grid
Keyword arguments
figure_size::NTuple{2, RV} = (500, 400)– Figure sizeresolution::Int = 2– Resolution of the plot
Returns
fig: A Makie figure object containing the sky plot.ax: The axis object of the plot for further customization.
LensFactory.Lenses.plot_image_plane — Function
LensFactory.Lenses.plot_image_plane(lens::Lenses.AbstractLens, θx::Matrix{<:RV}, θy::Matrix{<:RV}, adis::Float64)Arguments
lens::Lenses.AbstractLens– The lens model to plotθx::Matrix{<:RV}– x-coordinates gridθy::Matrix{<:RV}– y-coordinates gridadis::Float64– Distance ratio ($D_{ds}/D_s$) for the lens system
Keyword arguments
two_panel::Bool = false– Whether to create a two-panel plot with source plane on the left and image plane on the rightplot_caustic::Bool = truecaustic_kws::NamedTuple = (color_tan = :green, color_rad = :green, linewidth = 2)
plot_critical::Bool =truecritical_kws::NamedTuple = (color_tan = :red, color_rad = :red, linewidth = 2)
source::Union{Nothing, NTuple{2, RV}, Matrix{<:RV}} = nothingsource_kws::NamedTuple = (color=:red, markersize=10, marker=:star5, heatmap=cgrad([:white, :blue]))image_kws::NamedTuple = (color=:blue, markersize=10, marker=:star5, heatmap=cgrad([:white, :red]))
save_plot::Bool = falseplot_name::String = "image_plane.png"resolution::Int = 2
Returns
fig: A Makie figure object containing the image plane plot.ax: The axis object of the plot for further customization.
LensFactory.Lenses.plot_surface_density — Function
LensFactory.Lenses.plot_surface_density(lens::Lenses.AbstractLens, θx::Matrix{<:RV}, θy::Matrix{<:RV}, adis::Float64)Arguments
lens::Lenses.AbstractLens– The lens model to plotθx::Matrix{<:RV}– x-coordinates gridθy::Matrix{<:RV}– y-coordinates gridadis::Float64– Distance ratio $(D_{ds}/D_s)$ for the lens system
Keyword arguments
D_d::Float64 = NaN– Angular diameter distance to the lens (required ifunit != :convergence)unit::Symbol = :kg_m2– Unit for surface density. Options are :convergence, :kgm2, :msunpc2, :msun_arcsec2figure_size::NTuple{2, RV} = (500, 400)heatmap_kws::NamedTuple = (colormap=:cubehelix, colorrange=(0, 6))plot_contour::Bool = falsecontour_kws::NamedTuple = (levels=0.5:0.2:1.5, labels=false)
save_plot::Bool = falseplot_name::String = "surface_density.png"resolution::Int = 2
Returns
fig: A Makie figure object containing the surface density plot.ax: The axis object of the plot for further customization.
LensFactory.Lenses.plot_magnification_map — Function
LensFactory.Lenses.plot_magnification_map(lens::Lenses.AbstractLens, θx::Matrix{<:RV}, θy::Matrix{<:RV}, adis::Float64)Arguments
lens::Lenses.AbstractLens– The lens model to plotθx::Matrix{<:RV}– x-coordinates gridθy::Matrix{<:RV}– y-coordinates gridadis::Float64– Distance ratio $(D_{ds}/D_s)$ for the lens system
Keyword arguments
plane::Symbol = :image– Whether to plot |μ| map in:imageor:sourceplanerays_per_pixel::Int64 = 1– Only relevant ifplane = :sourcefigure_size::NTuple{2, RV} = (500, 400)heatmap_kws::NamedTuple = (colormap=:binary, colorrange=(1, 100))save_plot::Bool = falseplot_name::String = "magnification_map.png"resolution::Int = 2
Returns
fig: A Makie figure object containing the magnification map.ax: The axis object of the plot for further customization.
LensFactory.Lenses.plot_magnification_profile — Function
LensFactory.Lenses.plot_magnification_profile(lens::Lenses.AbstractLens, θx::Matrix{<:RV}, θy::Matrix{<:RV}, adis::Float64)Arguments
lens::Lenses.AbstractLens– The lens model to plotθx::Matrix{<:RV}– x-coordinates gridθy::Matrix{<:RV}– y-coordinates gridadis::Float64– Distance ratio $(D_{ds}/D_s)$ for the lens system
Keyword arguments
plane::Symbol = :image– Whether to plot |μ| map in:imageor:sourceplanerays_per_pixel::Int64 = 1– Only relevant ifplane = :sourcemu_range::StepRange{<:RV, <:RV} = 1:5:500unit::Float64 = ANGLE_ARCMIN^2figure_size::NTuple{2, RV} = (500, 400)plot_kws::NamedTuple = (color=:black, linewidth=2, linestyle=:solid)save_plot::Bool = falseplot_name::String = "magnification_profile.png"resolution::Int = 2
Returns
fig: A Makie figure object containing the magnification profile plot.ax: The axis object of the plot for further customization.