You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,13 @@ m[0, 0] # "index" the model at [y, x]
74
74
m[:, 0]
75
75
m(0.3, 1.0) # directly query value at (x, y)
76
76
m([1.2, 0.4])
77
+
```
78
+
79
+
**Important:**:
77
80
81
+
It is important to recognize the difference in the order of the dimensions between indexing and calling. Indexing is reverse of the cartesian order, which is the natural way of indexing a multi-dimensional array. If you try calling a model as a function with an index, an error will be thrown.
82
+
83
+
```julia
78
84
# scalar multiplication or division will create a ScaledPSFModel
Copy file name to clipboardExpand all lines: src/PSFModels.jl
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,15 @@ julia> m = PSFModels.Gaussian(5); # fwhm of 5 pixels, centered at (0, 0)
23
23
24
24
julia> m[0, 0] # [y, x] for indexing
25
25
1.0
26
+
27
+
julia> m(0, 0) # (x, y) for evaluating
28
+
1.0
26
29
```
27
30
31
+
!!! note "axis order"
32
+
33
+
It's important to note the difference in the axis ordering between the index-style calls and the function-style calls. The index-style calls are reverse cartesian order (e.g., `(z, y, x)`), while function calls are the typical cartesian order `(x, y, z)`. Regardless, the constructors are always in cartesian order (`(x, y, z)`).
34
+
28
35
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.
29
36
30
37
```jldoctest model
@@ -55,7 +62,7 @@ if we want to collect the model into a dense matrix, regardless of the indexing
55
62
julia> stamp = collect(m);
56
63
```
57
64
58
-
these axes are merely a convenience for bounding the model, since they accept any real number as input.
65
+
these axes are merely a convenience for bounding the model, since they accept any real number as input.
0 commit comments