Skip to content

Commit

Permalink
add pretty visual to test for farrah
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Aug 19, 2024
1 parent 9dcd884 commit 222dec7
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions tests/test_brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,29 @@ def test_compute_posteriors():

params_arr = np.array(
[
10.0,
0.1,
np.radians(89),
np.radians(21),
np.radians(31),
0.0, # note: I didn't convert tau here, just picked random number
51.5,
1.75,
10.0, # sma
0.3, # ecc
np.radians(0), # inc
np.radians(45), # aop
np.radians(90), # pan
0.0, # tau
51.5, # plx
1.75, # stellar maxx
]
)
epochs = np.linspace(0, 365*30, int(1e3))
ra, dec, vz, brightness = test_system.compute_all_orbits(params_arr, epochs=epochs)

fig, ax = plt.subplots(2, 1, figsize=(5,10))


ax[0].scatter(epochs, brightness, color=plt.cm.RdYlBu((epochs-epochs[0])/(epochs[-1] - epochs[0])))
ax[1].scatter(ra[:,1,:], dec[:,1,:], color=plt.cm.RdYlBu((epochs-epochs[0])/(epochs[-1] - epochs[0])))

all_orbits = test_system.compute_all_orbits(params_arr)
print(all_orbits)
ax[1].axis('equal')
plt.savefig('visual4farrah.png')

model = test_system.compute_model(params_arr)
# model = test_system.compute_model(params_arr)
# print(model)

# test_mcmc = sampler.MCMC(test_system, 1, 50, num_threads=1)
Expand Down

0 comments on commit 222dec7

Please sign in to comment.