Skip to content

Commit

Permalink
ready for tag
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-sengupta committed Nov 22, 2021
1 parent 52458c7 commit dd0a2c3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions sealrtc/optics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def make_optics():
mode = "simulation"

print(f"SEAL Real-Time Controller running in {mode} mode.")
return optics

from .flatten import flatten
from .align import align
Expand Down
7 changes: 4 additions & 3 deletions sealrtc/optics/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def applytiptilt(amptip,amptilt,bestflat=bestflat): #amp is the P2V in DM units
cenmaskradmax, cenmaskradmin = 49, 10 #mask radii for central lobe, ignoring central part where the pinhole PSF is (if not ignored, this would bias the alignment algorithm)
cenmaskind = np.where(
np.logical_and(
cenmaskrho < cenmaskradmax,cenmaskrho > cenmaskradmin
cenmaskrho < cenmaskradmax,
cenmaskrho > cenmaskradmin
)
)
cenmask[cenmaskind] = 1
Expand All @@ -73,7 +74,7 @@ def applytiptilt(amptip,amptilt,bestflat=bestflat): #amp is the P2V in DM units
cenfraction=np.sum(mtfopt[cenmaskind])/np.sum(mtfopt)
ttoptarr[i,j]=sidefraction+0.1/cenfraction #the factor of 0.01 is a relative weight; because we only expect the fringe visibility to max out at a few %, this attempts to give equal weight to both terms

medttoptarr = median_filter(ttoptarr, 3) #smooth out hot pizels, attenuating noise issues
medttoptarr = median_filter(ttoptarr, 3) #smooth out hot pixels, attenuating noise issues
indopttip, indopttilt = np.where(
medttoptarr == np.max(medttoptarr)
)
Expand All @@ -94,7 +95,7 @@ def applytiptilt(amptip,amptilt,bestflat=bestflat): #amp is the P2V in DM units
cenfraction = np.sum(mtfopt[cenmaskind])/np.sum(mtfopt)
ttoptarr1[i,j] = sidefraction+0.1/cenfraction

medttoptarr1 = median_filter(ttoptarr1, 3) #smooth out hot pizels, attenuating noise issues
medttoptarr1 = median_filter(ttoptarr1, 3) #smooth out hot pixels, attenuating noise issues
indopttip1, indopttilt1 = np.where(medttoptarr1 == np.max(medttoptarr1))
applytiptilt(tipamparr[indopttip1][0],tiltamparr[indopttilt1][0])

Expand Down
4 changes: 2 additions & 2 deletions sealrtc/optics/flatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ def vcmd(rcond): #view the reconstructed DM commands, making sure that waffle mo
#ds9.view(np.flipud(cmd.reshape(dmcini.shape)))

#reference slopes from commented out code above preamble
refslopes=np.load(joindata('refslopes/refSlopes4ALPAOflat.npy'))
refslopes=np.load(joindata("refslopes", "refSlopes4ALPAOflat.npy"))

rcond=3e-1
cmd_mtx=np.linalg.pinv(IM,rcond=rcond)
cmd_mtx = np.linalg.pinv(IM, rcond=rcond)
numiter=20 #convergence seems around this many iterations for a gain of 0.5
gain=0.5
leak=1
Expand Down
1 change: 0 additions & 1 deletion sealrtc/optics/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def set_process_vars(self):
for (i, (n, m)) in enumerate(nmarr):
self.zernarr[i] = self.funz(n, m)[self.indap]


self.make_im_cm()

def processim(self, imin): #process SCC image, isolating the sidelobe in the FFT and IFFT back to the image
Expand Down

0 comments on commit dd0a2c3

Please sign in to comment.