Ejemplo n.º 1
0
csbs(psfs_sq, sse_cost, 10, lam=1e0, order=1)
plt.imshow(psfs_sq.copies.reshape(7, 7), cmap='magma')
plt.figtext(0.98,
            0.98,
            str(psfs_sq.csbs_params),
            horizontalalignment='right',
            rotation='vertical',
            fontsize='xx-small')
plt.axis('off')
cbar = plt.colorbar()
cbar.set_label('Copies')
plt.savefig('square_csbs_order1.png', dpi=300)

plt.cla()
plt.close()

psfs_sq.copies = np.repeat(5, 49)
csbs(psfs_sq, sse_cost, 10, lam=1e0, order=0)
plt.imshow(psfs_sq.copies.reshape(7, 7), cmap='magma')
plt.figtext(0.98,
            0.98,
            str(psfs_sq.csbs_params),
            horizontalalignment='right',
            rotation='vertical',
            fontsize='xx-small')
plt.axis('off')
cbar = plt.colorbar()
cbar.set_label('Copies')
plt.savefig('square_csbs_order0.png', dpi=300)
Ejemplo n.º 2
0
from mas.csbs import csbs

ps = PhotonSieve()
wavelengths = np.array([33.4e-9, 33.402e-9])

psfs_focus = PSFs(ps,
                  source_wavelengths=wavelengths,
                  measurement_wavelengths=wavelengths,
                  num_copies=6)

psfs_mid = PSFs(ps,
                source_wavelengths=wavelengths,
                measurement_wavelengths=np.array(
                    [33.4e-9, 33.401e-9, 33.402e-9]),
                num_copies=6)
psfs_mid.copies = np.array([6, 1, 5])

psfs_outer = PSFs(ps,
                  source_wavelengths=wavelengths,
                  measurement_wavelengths=np.array(
                      [33.4e-9, 33.402e-9, 33.41e-9]),
                  num_copies=6)
psfs_outer.copies = np.array([6, 5, 1])

psfs_csbs = PSFs(ps, source_wavelengths=wavelengths, num_copies=10)
csbs(psfs_csbs, sse_cost, 12, lam=10**-4.5, order=1)

sources = strands[:2]

# %% data