Skip to content

Commit

Permalink
splitting into DM and camera classes
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-sengupta committed Dec 15, 2024
1 parent 3f7df12 commit 06a3529
Show file tree
Hide file tree
Showing 19 changed files with 9 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
10 changes: 7 additions & 3 deletions photonics/experiments/lantern_cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import numpy as np
import dao

from ..simulations.optics import Optics
from ..simulations.lantern_optics import LanternOptics

class LanternCamera(ABC):
def set_centroids(self, centroids, image, save=False):
"""
Expand Down Expand Up @@ -93,12 +96,13 @@ def gain(self, val):

@property
def fps(self):
return self.fps.get_data()
return self.fpsshm.get_data()

@fps.setter
def set_fps(self, val):
self.fpsshm.set_data(self.fps.get_data() * 0 + val)

class SimLanternCamera(LanternCamera):
class SimulatedLanternCamera(LanternCamera):
def __init__(self):
pass
self.optics = Optics()
self.lantern_optics = LanternOptics(optics)
3 changes: 0 additions & 3 deletions photonics/linearity.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,3 @@ def plot_linearity(amplitudes, responses, title_mod="", savepath="", zlabels=Non
else:
print("Not saving this figure, specify 'savepath' if desired!")

def linearity_loss(amplitudes, linearity_responses):
comparison = np.eye(linearity_responses.shape[2])[:, np.newaxis, :]
return np.sum((comparison * amplitudes[np.newaxis, :, np.newaxis] - linearity_responses) ** 2)
3 changes: 2 additions & 1 deletion photonics/simulations/lantern_optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,5 @@ def gs_inject_recover(self, zernikes, amplitudes, optics):

def set_gs_slopes(self, optics):
gs_slopes = [(self.gs_inject_recover(i, 0.1, optics)[i] - self.gs_inject_recover(i, -0.1, optics)[i]) / (0.2) for i in range(self.nmodes)]
self.gs_slopes = np.array(gs_slopes)
self.gs_slopes = np.array(gs_slopes)

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 06a3529

Please sign in to comment.