Skip to content

Commit a17f402

Browse files
committed
update docs
1 parent ffd2ba0 commit a17f402

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/PSFModels.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ julia> m[0, 0] # [y, x] for indexing
2525
1.0
2626
```
2727
28-
To control the amplitude, the best method is using scalar multiplication or division. These operations create another lazy object that scales the original model without having to broadcast and potentially allocate.
28+
To control the amplitude, the best method is using scalar multiplication or division. These operations create another lazy object ([`ScaledPSFModel`](@ref)) that scales the original model without having to broadcast and potentially allocate.
2929
3030
```jldoctest model
3131
julia> m_scaled = 20 * m;
@@ -75,7 +75,7 @@ julia> model = PSFModels.Gaussian(51, 51, 2); # center of big_mat, fwhm=2
7575
julia> ax = map(intersect, axes(big_mat), axes(model))
7676
(48:54, 48:54)
7777
78-
julia> cutout = big_mat[ax...]
78+
julia> cutout = @view big_mat[ax...]
7979
7×7 Array{Float64,2}:
8080
1.0 1.0 1.0 1.0 1.0 1.0 1.0
8181
1.0 1.0 1.0 1.0 1.0 1.0 1.0
@@ -85,10 +85,12 @@ julia> cutout = big_mat[ax...]
8585
1.0 1.0 1.0 1.0 1.0 1.0 1.0
8686
1.0 1.0 1.0 1.0 1.0 1.0 1.0
8787
88-
julia> photsum = sum(cutout .* model[ax...])
88+
julia> stamp = @view model[ax...];
89+
90+
julia> photsum = sum(cutout .* stamp)
8991
4.5322418212890625
9092
```
91-
Nice- we only had to reduce ~50 pixels instead of ~10,000 to calculate the aperture sum, and with some care we could make it allocation-free.
93+
Nice- we only had to reduce ~50 pixels instead of ~10,000 to calculate the aperture sum, all in under a microsecond (on my machine).
9294
9395
Since the models are lazy, that means the type of the output can be specified, as long as it can be converted to from a real number (so no integer types).
9496

0 commit comments

Comments
 (0)