-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plot updates for paper; debugging pyramid sim again
- Loading branch information
1 parent
186e3b4
commit 154ccc1
Showing
23 changed files
with
665 additions
and
27 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
using NPZ | ||
using Plots | ||
using PhotonicLantern | ||
default(fontfamily= "Computer Modern", linewidth=3, framestyle=:box, label=nothing, grid=true) | ||
|
||
p_i_all = npzread("data/pl_231025/linearity_responses.npy")# * rad2opd | ||
amps = npzread("data/pl_231025/linearity_amps.npy")# * rad2opd | ||
|
||
command_matrix = make_command_matrix(amps, p_i_all, nmodes=10, push_ref=0.05) | ||
plot_linearity(amps, p_i_all, command_matrix, nmodes=10) | ||
plot_linearity(amps, p_i_all, command_matrix, nmodes=6) | ||
command_matrix = make_command_matrix(amps, p_i_all, nmodes=9, push_ref=0.05) | ||
# plot_linearity(amps, p_i_all, command_matrix, nmodes=9) | ||
begin | ||
nmodes = 9 | ||
pl = [] | ||
for k in 1:nmodes | ||
lin_k = ((p_i_all[k,:,:]) * command_matrix)[:,1:nmodes] | ||
a = [(k == i ? 1 : 0.2) for i in 1:(nmodes)]' | ||
pk = plot(xlabel=mode_names[k], label=nothing, legend=:outertopright, aspect_ratio=:equal, ylim=(-1, 1), xlim=(-1, 1)) | ||
plot!(amps, amps, ls=:dash, color=:black) | ||
plot!(amps, lin_k, alpha=a) | ||
push!(pl, pk) | ||
end | ||
p = plot(pl..., legend=nothing, size=(900,900), dpi=600, suptitle="Photonic lantern linear reconstruction, SEAL") | ||
Plots.savefig("figures/linear_seal.pdf") | ||
p | ||
end |
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
File renamed without changes.
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,25 @@ | ||
using Plots | ||
using NPZ | ||
default(fontfamily= "Computer Modern", linewidth=3, framestyle=:box, label=nothing, grid=true) | ||
|
||
amps = npzread("data/sweep_testset_amplitudes_.npy") | ||
sweep_gs = npzread("data/linear_sweeps/gs.npy") | ||
sweep_mpwfs = npzread("data/linear_sweeps/mpwfs.npy") | ||
sweep_linear = npzread("data/linear_sweeps/pl_linear.npy") | ||
sweep_nn = npzread("data/linear_sweeps/pl_nn.npy") | ||
|
||
begin | ||
nmodes = 9 | ||
pl = [] | ||
for k in 1:nmodes | ||
pk = plot(xlabel=mode_names[k], legend=:bottomright, aspect_ratio=:equal, xlim=(-1,1), ylim=(-1,1)) | ||
plot!(amps, amps, ls=:dash, color=:black) | ||
for (i, (s, n)) in enumerate(zip([sweep_mpwfs, sweep_linear, sweep_nn, sweep_gs], ["Modulated pyramid", "PL interaction matrix", "PL neural network", "PL Gerchberg-Saxton"])) | ||
plot!(amps, s[k,:,k], color=15-i, label=(k == 3 ? n : nothing)) | ||
end | ||
push!(pl, pk) | ||
end | ||
p = plot(pl..., size=(1000,1000), dpi=600, suptitle="All PL reconstruction algorithms compared with the modulated pyramid") | ||
Plots.savefig("figures/all_recon.pdf") | ||
p | ||
end |
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,22 @@ | ||
using Plots | ||
using NPZ | ||
default(fontfamily= "Computer Modern", linewidth=3, framestyle=:box, label=nothing, grid=true) | ||
|
||
amps = npzread("data/sweep_testset_amplitudes_.npy") | ||
sweep = npzread("data/linear_sweeps/gs.npy") | ||
|
||
begin | ||
nmodes = 9 | ||
pl = [] | ||
for k in 1:nmodes | ||
lin_k = sweep[k,:,:] | ||
a = [(k == i ? 1 : 0.2) for i in 1:(nmodes)]' | ||
pk = plot(xlabel=mode_names[k], label=nothing, legend=:outertopright, aspect_ratio=:equal, xlim=(-1,1), ylim=(-1,1)) | ||
plot!(amps, amps, ls=:dash, color=:black) | ||
plot!(amps, lin_k, alpha=a) | ||
push!(pl, pk) | ||
end | ||
p = plot(pl..., legend=nothing, size=(900,900), dpi=600, suptitle="Photonic lantern Gerchberg-Saxton reconstruction, simulated") | ||
Plots.savefig("figures/gs_linearity_sim.pdf") | ||
p | ||
end |
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
Oops, something went wrong.