-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
20 changed files
with
161 additions
and
326 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,31 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import lentil | ||
|
||
amp = lentil.circle(shape=(256,256), radius=120) | ||
|
||
pupil = lentil.Pupil(amplitude=amp, opd=0, pixelscale=1/240, | ||
focal_length=10) | ||
|
||
trace = [1, 0] | ||
dispersion = [3e-4, 550e-9] | ||
dispersive_element = lentil.DispersiveTilt(trace=trace, dispersion=dispersion) | ||
|
||
|
||
shape = (128,128) | ||
oversample = 3 | ||
out = np.zeros((shape[0]*oversample, shape[1]*oversample)) | ||
|
||
for wave in np.linspace(475, 625, 150): | ||
w0 = lentil.Wavefront(wavelength=wave*1e-9) | ||
w1 = w0 * pupil | ||
w2 = w1 * dispersive_element | ||
w3 = lentil.propagate_dft(w2, shape=shape, prop_shape=(32, 32), | ||
pixelscale=5.5e-6, oversample=oversample) | ||
|
||
out = w3.insert(out) | ||
|
||
fig, ax = plt.subplots() | ||
ax.imshow(out, cmap='inferno') | ||
ax.axis('off') | ||
fig.savefig('dispersion.png', dpi=150, bbox_inches='tight') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import lentil | ||
|
||
amp = lentil.circle(shape=(256,256), radius=120) | ||
amp -= lentil.circle(shape=(256,256), radius=40) | ||
for angle in (0, 90, 180, 270): | ||
amp *= lentil.spider((256,256), 2, angle) | ||
opd = lentil.zernike_compose(amp, (0, 3.5e-6, -2e-6)) | ||
pupil = lentil.Pupil(amplitude=amp, opd=opd, pixelscale=1/240, | ||
focal_length=10) | ||
w0 = lentil.Wavefront(wavelength=500e-9) | ||
w1 = w0 * pupil | ||
w2 = lentil.propagate_dft(w1, shape=(64,64), pixelscale=5e-6, oversample=4) | ||
fig, ax = plt.subplots() | ||
ax.imshow(w2.intensity, norm='log', vmin=10e-5, cmap='inferno') | ||
ax.axis('off') | ||
fig.savefig('tilt.png', dpi=150, bbox_inches='tight') |
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,64 @@ | ||
.. _examples.dispersion: | ||
|
||
******************* | ||
Modeling dispersion | ||
******************* | ||
|
||
.. plot:: | ||
:context: reset | ||
:include-source: | ||
:scale: 50 | ||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import lentil | ||
|
||
amp = lentil.circle(shape=(256,256), radius=120) | ||
|
||
pupil = lentil.Pupil(amplitude=amp, opd=0, pixelscale=1/240, | ||
focal_length=10) | ||
|
||
trace = [1, 0] # y = x | ||
dispersion = [3e-4, 550e-9] # center wavelength = 550 nm | ||
dispersive_element = lentil.DispersiveTilt(trace=trace, dispersion=dispersion) | ||
|
||
shape = (128,128) | ||
oversample = 3 | ||
out = np.zeros((shape[0]*oversample, shape[1]*oversample)) | ||
|
||
fig, ax = plt.subplots(nrows=1, ncols=3, figsize=(6,3)) | ||
|
||
# dispersed PSF @ 475 nm | ||
w0 = lentil.Wavefront(475e-9) | ||
w1 = w0 * pupil | ||
w2 = w1 * dispersive_element | ||
w3 = lentil.propagate_dft(w2, shape=shape, prop_shape=(32, 32), | ||
pixelscale=5.5e-6, oversample=oversample) | ||
ax[0].imshow(w3.intensity, cmap='inferno') | ||
ax[0].set_title('$\lambda$ = 475 nm') | ||
ax[0].axis('off') | ||
|
||
# dispersed PSF @ 625 nm | ||
w0 = lentil.Wavefront(625e-9) | ||
w1 = w0 * pupil | ||
w2 = w1 * dispersive_element | ||
w3 = lentil.propagate_dft(w2, shape=shape, prop_shape=(32, 32), | ||
pixelscale=5.5e-6, oversample=oversample) | ||
ax[1].imshow(w3.intensity, cmap='inferno') | ||
ax[1].set_title('$\lambda$ = 625 nm') | ||
ax[1].axis('off') | ||
|
||
# broadband dispersion | ||
for wave in np.linspace(475, 625, 150): | ||
w0 = lentil.Wavefront(wavelength=wave*1e-9) | ||
w1 = w0 * pupil | ||
w2 = w1 * dispersive_element | ||
w3 = lentil.propagate_dft(w2, shape=shape, prop_shape=(32, 32), | ||
pixelscale=5.5e-6, oversample=oversample) | ||
|
||
out = w3.insert(out) | ||
|
||
|
||
ax[2].imshow(out, cmap='inferno') | ||
ax[2].set_title('$\lambda$ = [475 625] nm') | ||
ax[2].axis('off') |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.