Skip to content

Commit cc358e8

Browse files
committed
use complex directly instead of 1im
1 parent 8f35ca0 commit cc358e8

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

examples/advanced/Hibi/main.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ end
9494

9595
using VLBIImagePriors
9696
using Distributions
97-
fgain(x) = exp(x.lg + 1im * x.gp)
97+
fgain(x) = exp(complex(x.lg , x.gp))
9898
G = SingleStokesGain(fgain)
9999

100100
intpr = (

examples/intermediate/PolarizedImaging/main.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ skym = SkyModel(sky, skyprior, grid; metadata = skymeta)
231231
# The first element of the tuple is the gain for the first polarization feed (R) and the
232232
# second is the gain for the second polarization feed (L).
233233
function fgain(x)
234-
gR = exp(x.lgR + 1im * x.gpR)
235-
gL = gR * exp(x.lgrat + 1im * x.gprat)
234+
gR = exp(complex(x.lgR, x.gpR))
235+
gL = gR * exp(complex(x.lgrat, x.gprat))
236236
return gR, gL
237237
end
238238
G = JonesG(fgain)

examples/intermediate/StokesIImaging/main.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ skym = SkyModel(sky, prior, grid; metadata = skymeta)
130130
G = SingleStokesGain() do x
131131
lg = x.lg
132132
gp = x.gp
133-
return exp(lg + 1im * gp)
133+
return exp(complex(lg, gp))
134134
end
135135

136136
intpr = (

src/instrument/jonesmatrices.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ is the complex gain `g1` and the second element is the complex gain `g2`.
4747
## Example
4848
```julia
4949
G = JonesG() do
50-
g1 = exp(x.lg1 + 1im.*x.gp1)
51-
g2 = g1*exp(x.lgratio + 1im.*x.gpratio)
50+
g1 = exp(complex(x.lg1, x.gp1))
51+
g2 = g1*exp(complex(x.lgratio, x.gpratio))
5252
return g1, g2
5353
end
5454
```

src/instrument/model.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ visibilities.
106106
107107
A Stokes I example is
108108
```julia-repl
109-
julia> G = SingleStokesGain(x->exp(x.lg + 1im*x.pg))
109+
julia> G = SingleStokesGain(x->exp(complex(x.lg, x.pg)))
110110
julia> intprior = (lg = ArrayPrior(IIDSitePrior(ScanSeg(), Normal(0.0, 0.1))),
111111
pg = ArrayPrior(IIDSitePrior(ScanSeg(), DiagVonMises(0.0, inv(π^2))))
112112
)
@@ -117,8 +117,8 @@ julia> intm = InstrumentModel(G, intprior)
117117
A standard polarized example is
118118
```julia-repl
119119
julia> G = JonesG() do
120-
gR = exp.(x.lgr + 1im*x.gpr)
121-
gL = gr*exp.(x.lgrat + 1im*x.gprat)
120+
gR = exp.(complex(x.lgr, x.gpr))
121+
gL = gr*exp.(complex(x.lgrat, x.gprat))
122122
return gR, gL
123123
end
124124
julia> D = JonesD() do

src/posterior/vlbiposterior.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ skyprior = (r = Uniform(μas2rad(10.0), μas2rad(30.0)), a = Uniform(1.0, 10.0))
5555
g = imagepixels(μas2rad(100.0), μas2rad(100.0), 256, 256)
5656
skym = SkyModel(sky, skyprior, g)
5757
58-
G = SingleStokesGain(x->exp(x.lg + 1im*x.pg))
58+
G = SingleStokesGain(x->exp(complex(x.lg, x.pg)))
5959
intprior = (lg = ArrayPrior(IIDSitePrior(ScanSeg(), Normal(0.0, 0.1))),
6060
pg = ArrayPrior(IIDSitePrior(ScanSeg(), DiagVonMises(0.0, inv(π^2))))
6161
)

test/Core/bayes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ using FiniteDifferences
144144
@test gz gfd
145145

146146
R = JonesR()
147-
Gp = JonesG(x -> (exp(x.lg + 1im * x.gp), exp(x.lg + 1im * x.gp)))
147+
Gp = JonesG(x -> (exp(complex(x.lg, x.gp)), exp(complex(x.lg, x.gp))))
148148
J = JonesSandwich(Gp, R)
149149
pr = (
150150
lg = ArrayPrior(IIDSitePrior(ScanSeg(), Normal(0.0, 1.0))),
@@ -174,7 +174,7 @@ end
174174
post_lc = VLBIPosterior(skym, lcamp)
175175
post_vis = VLBIPosterior(skym, vis)
176176

177-
G = SingleStokesGain(x -> exp(x.lg + 1im .* x.gp))
177+
G = SingleStokesGain(x -> exp(complex(x.lg, x.gp)))
178178
intm = InstrumentModel(
179179
G, (
180180
lg = ArrayPrior(IIDSitePrior(ScanSeg(), Normal(0.0, 1.0))),

0 commit comments

Comments
 (0)