Skip to content

Commit

Permalink
Added plotting of mu map
Browse files Browse the repository at this point in the history
  • Loading branch information
ivalaginja committed Sep 1, 2019
1 parent a78a6f2 commit 305b779
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pastis/modal_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,18 @@ def calc_random_e2e_configuration(nseg, luvoir, mus, psf_unaber, dh_mask):
#plt.savefig(os.path.join(workdir, 'results', 'random_mu_distribution_'+str(c_stat)+'.pdf'))
plt.savefig(os.path.join(workdir, 'results', 'random_mu_distribution_' + str(c_stat) + '_test.pdf'))

### apply mu map and run through E2E simulator
mus *= u.nm
luvoir.flatten()
for seg, mu in enumerate(mus):
luvoir.set_segment(seg+1, mu.to(u.m).value/2, 0, 0)
psf, ref = luvoir.calc_psf(ref=True, display_intermediate=True)
plt.show()
contrast_mu = util.dh_mean(psf/ref.max(), dh_mask)
print(contrast_mu)

###

print('All saved in {}'.format(os.path.join(workdir, 'results')))

print('\nRuntimes:')
Expand Down

0 comments on commit 305b779

Please sign in to comment.