-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gilles Orban de Xivry
committed
Apr 12, 2023
1 parent
827ffb0
commit bcca2b3
Showing
3 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
''' | ||
testing grids with and without physical dimensions | ||
''' | ||
|
||
import hcipy | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
|
||
ngrid =128 | ||
det_size=15 | ||
det_res=4 | ||
diam = 40 | ||
|
||
pupilGrid = hcipy.make_pupil_grid(ngrid, diameter=diam) | ||
focalGrid = hcipy.make_focal_grid(det_res, | ||
det_size, | ||
# spatial_resolution= diam, | ||
pupil_diameter=diam, | ||
reference_wavelength=1, | ||
focal_length=diam) | ||
|
||
prop = hcipy.FraunhoferPropagator(pupilGrid, focalGrid, focal_length=diam) | ||
|
||
optical_model = hcipy.OpticalSystem([prop]) | ||
|
||
aperture = hcipy.make_circular_aperture(diam)(pupilGrid) | ||
|
||
phase = hcipy.Field(0, pupilGrid) | ||
wf = hcipy.Wavefront(np.exp(1j * phase) * aperture) | ||
|
||
image = optical_model(wf).power | ||
|
||
plt.figure() | ||
hcipy.imshow_field(image) | ||
|
||
|
||
import psi.psi_utils as psi_utils | ||
filter_fp = psi_utils.makeFilters(focalGrid, | ||
"back_prop", | ||
sigma=0.1, | ||
lD = 6 * 2) | ||
|
||
sh = int(np.sqrt(len(filter_fp))) | ||
plt.figure() | ||
plt.imshow(filter_fp.reshape(sh,sh)) | ||
|
||
# psi_sensor.filter_fp = psi_utils.makeFilters(psi_sensor.inst.focalGrid, | ||
# "back_prop", | ||
# sigma=0.05, | ||
# lD = 2 * 2) |