• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kunzaatko / TransferFunctions.jl / 17264570321

27 Aug 2025 10:47AM UTC coverage: 81.766%. Remained the same
17264570321

push

github

kunzaatko
test: Add test for the indices method on the PSF

565 of 691 relevant lines covered (81.77%)

33464341.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/src/psf/point-spread-function.jl
1
# TODO: Try to define with [DensityInterface](https://juliamath.github.io/DensityInterface.jl/dev/) <21-08-25> 
2
using InterfaceFunctions
3

4
"""
5
    PointSpreadFunction{N} <: LinearShiftInvariantTransferFunction{N}
6
A point spread function is a description of a transfer functions specifying the intensity transfer of a single point
7
source in the object plane into a region of the image plane.
8

9
# Implementation
10
To create a new Point spread function (PSF) `A <: PointSpreadFunction`, you must define the __intensity__ at a given
11
[length](@extref Unitful `Length`) coordinate `intensity(psf::A, x::Length, y::Length)`.
12
"""
13
abstract type PointSpreadFunction{N} <: LinearShiftInvariantTransferFunction{N} end
14
Broadcast.broadcastable(tf::PointSpreadFunction) = Ref(tf)
104✔
15

16
"""
17
    PointSpreadFunctionSymmetry
18
A marker type that indicates the symmetries of a `PointSpreadFunction` which may lead to optimized methods.
19

20
Subtypes thus far include [`ZAxisRadialSymmetry`](@ref) and [`NoSymmetry`](@ref).
21
"""
22
abstract type PointSpreadFunctionSymmetry end
23
Broadcast.broadcastable(s::PointSpreadFunctionSymmetry) = Ref(s)
×
24

25
"""
26
    ZAxisRadialSymmetry <: PointSpreadFunctionSymmetry
27
``z`` axis radial symmetry of a `PointSpreadFunction` indicates that the PSF is symmetric in the radially around the
28
z-axis.
29
"""
30
struct ZAxisRadialSymmetry <: PointSpreadFunctionSymmetry end
210,016✔
31

32
"""
33
    NoSymmetry <: PointSpreadFunctionSymmetry
34
`NoSymmetry` marks a `PointSpreadFunction` that is not symmetric in any way. You need to compute every ``x``, ``y``,
35
``z`` coordinate separately. 
36
"""
37
struct NoSymmetry <: PointSpreadFunctionSymmetry end
4✔
38

39
"""
40
    symmtery(psf::PointSpreadFunction)
41
Marks the symmetries of a `PointSpreadFunction`.
42
"""
43
@interface symmetry(::PointSpreadFunction) = NoSymmetry()
×
44

45
"""
46
    intensity(psf::PointSpreadFunction, x::Length, y::Length)
47
The intensity of a `PSF` at a given location.
48
"""
49
@interface response(psf::PointSpreadFunction, args...) = response(symmetry(psf), psf, args...)
×
50
@inline response(::ZAxisRadialSymmetry, psf::PointSpreadFunction{2}, x::Length, y::Length) = intensity(psf, hypot(x, y))
4,520✔
51
@inline response(::ZAxisRadialSymmetry, psf::PointSpreadFunction{3}, x::Length, y::Length, z::Length) = intensity(psf, hypot(x, y), z)
205,448✔
52
@inline response(::NoSymmetry, psf::PointSpreadFunction{2}, x::Length, y::Length) = intensity(psf, x, y)
4✔
53
@inline response(::NoSymmetry, psf::PointSpreadFunction{3}, x::Length, y::Length, z::Length) = intensity(psf, x, y, z)
×
54

55
"""
56
    PSFModel <: PointSpreadFunction 
57
`PointSpreadFunction` subtype for PSF models. A `PSF` model is a `PointSpreadFunction` that has parameters accessible
58
through [`params`](@ref) and can be fitted to data.
59
"""
60
abstract type PSFModel{N} <: PointSpreadFunction{N} end
61

62
include("methods.jl")
63

64
# Augmentations
65
include("./types/rotated-psf.jl")
66
include("./types/scaled-psf.jl")
67

68
# Models
69
include("./types/airy-disc.jl")
70
include("./types/gaussian.jl")
71

72
# TODO: Fix these models <20-08-25> 
73
include("./types/gibson-lanni.jl")
74
include("./types/born-wolf.jl")
75

76
include("./types/psf-array.jl")
77

78
include("./estimation.jl")
79

80
export response, psf
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc