diff --git a/pastis/modal_analysis.py b/pastis/modal_analysis.py index d375fcf1..3197ec0d 100644 --- a/pastis/modal_analysis.py +++ b/pastis/modal_analysis.py @@ -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:')