This part contains plotting support for the LensFactory.jl package.

LensFactory.Lenses.plot_skyFunction
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 size
  • resolution::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.
source
LensFactory.Lenses.plot_image_planeFunction
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 grid
  • adis::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 right
  • plot_caustic::Bool = true
    • caustic_kws::NamedTuple = (color_tan = :green, color_rad = :green, linewidth = 2)
  • plot_critical::Bool =true
    • critical_kws::NamedTuple = (color_tan = :red, color_rad = :red, linewidth = 2)
  • source::Union{Nothing, NTuple{2, RV}, Matrix{<:RV}} = nothing
    • source_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 = false
    • plot_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.
source
LensFactory.Lenses.plot_surface_densityFunction
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 grid
  • adis::Float64 – Distance ratio $(D_{ds}/D_s)$ for the lens system

Keyword arguments

  • D_d::Float64 = NaN – Angular diameter distance to the lens (required if unit != :convergence)
  • unit::Symbol = :kg_m2 – Unit for surface density. Options are :convergence, :kgm2, :msunpc2, :msun_arcsec2
  • figure_size::NTuple{2, RV} = (500, 400)
  • heatmap_kws::NamedTuple = (colormap=:cubehelix, colorrange=(0, 6))
  • plot_contour::Bool = false
    • contour_kws::NamedTuple = (levels=0.5:0.2:1.5, labels=false)
  • save_plot::Bool = false
    • plot_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.
source
LensFactory.Lenses.plot_magnification_mapFunction
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 grid
  • adis::Float64 – Distance ratio $(D_{ds}/D_s)$ for the lens system

Keyword arguments

  • plane::Symbol = :image – Whether to plot |μ| map in :image or :source plane
  • rays_per_pixel::Int64 = 1 – Only relevant if plane = :source
  • figure_size::NTuple{2, RV} = (500, 400)
  • heatmap_kws::NamedTuple = (colormap=:binary, colorrange=(1, 100))
  • save_plot::Bool = false
    • plot_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.
source
LensFactory.Lenses.plot_magnification_profileFunction
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 grid
  • adis::Float64 – Distance ratio $(D_{ds}/D_s)$ for the lens system

Keyword arguments

  • plane::Symbol = :image – Whether to plot |μ| map in :image or :source plane
  • rays_per_pixel::Int64 = 1 – Only relevant if plane = :source
  • mu_range::StepRange{<:RV, <:RV} = 1:5:500
  • unit::Float64 = ANGLE_ARCMIN^2
  • figure_size::NTuple{2, RV} = (500, 400)
  • plot_kws::NamedTuple = (color=:black, linewidth=2, linestyle=:solid)
  • save_plot::Bool = false
    • plot_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.
source