Skip to content

Commit 461011f

Browse files
authored
Merge pull request #424 from ptiede/ptiede-simobsfix
Ptiede simobsfix
2 parents 639c3f4 + 1a69659 commit 461011f

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Comrade"
22
uuid = "99d987ce-9a1e-4df8-bc0b-1ea019aa547b"
33
authors = ["Paul Tiede <ptiede91@gmail.com>"]
4-
version = "0.11.18"
4+
version = "0.11.19"
55

66
[deps]
77
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"

test/Core/bayes.jl

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ end
183183
)
184184
post_gvis = VLBIPosterior(skym, vis)
185185

186+
fwhmfac = 2 * sqrt(2 * log(2))
187+
x0 = (;
188+
sky = (
189+
f1 = 1.0, σ1 = μas2rad(40.0) / fwhmfac, τ1 = 0.5, ξ1 = π / 3,
190+
f2 = 0.5, σ2 = μas2rad(20.0) / fwhmfac, τ2 = 0.5, ξ2 = π / 6,
191+
x = μas2rad(30.0), y = μas2rad(30.0),
192+
),
193+
)
186194
function test_simobs(post, x, int = nothing)
187195
obs = simulate_observation(post, x)[begin]
188196
@test length(obs) == length(post.data[begin])
@@ -200,21 +208,22 @@ end
200208

201209
c2 = chi2(postsim, x; reduce = true)
202210
c2nn = chi2(postsim_nn, x; reduce = true)
203-
204-
@test all(x -> reduce(&, x .< 1.2), c2)
211+
@info c2
212+
@info logdensityof(postsim, x)
213+
@test all(x -> reduce(&, x .< 1.25), c2)
205214
@test all(x -> reduce(&, x .≈ 0), c2nn)
206215

207216

208217
end
209218

210-
test_simobs(post_amp, prior_sample(post_amp))
211-
test_simobs(post_cp, prior_sample(post_cp))
212-
test_simobs(post_lc, prior_sample(post_lc))
213-
test_simobs(post_vis, prior_sample(post_vis))
214-
test_simobs(post_gvis, prior_sample(post_gvis))
219+
test_simobs(post_amp, x0)
220+
test_simobs(post_cp, x0)
221+
test_simobs(post_lc, x0)
222+
test_simobs(post_vis, x0)
223+
test_simobs(post_gvis, x0)
215224

216225
post_all = VLBIPosterior(skym, vis, amp, lcamp, cphase)
217-
simulate_observation(post_all, prior_sample(post_all))
226+
simulate_observation(post_all, x0)
218227

219228

220229
R = JonesR()

0 commit comments

Comments
 (0)