Skip to content

Commit 0720894

Browse files
allow WFS to accept None as phase
This corresponds to a flat wavefront
1 parent b55e356 commit 0720894

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

soapy/DM.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def makeIMat(self, callback=None):
173173
# Send the DM shape off to the relavent WFS. put result in iMat
174174
iMat[i, subap: subap + (2*self.wfss[nWfs].activeSubaps)] = (
175175
-1*self.wfss[nWfs].frame(
176-
phs, correction=self.dmShape, iMatFrame=True))/self.dmConfig.iMatValue
176+
None, correction=self.dmShape, iMatFrame=True))/self.dmConfig.iMatValue
177177

178178
if callback != None:
179179
callback()

soapy/lineofsight.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def performCorrection(self, correction):
485485

486486
self.phase = self.residual * self.phs2Rad
487487

488-
def frame(self, scrns, correction=None):
488+
def frame(self, scrns=None, correction=None):
489489
'''
490490
Runs one frame through a line of sight
491491
@@ -502,14 +502,17 @@ def frame(self, scrns, correction=None):
502502
ndarray: WFS Measurements
503503
'''
504504

505-
#If scrns is not dict or list, assume array and put in list
506-
t = type(scrns)
507-
if t != dict and t != list:
508-
scrns = [scrns]
509-
self.scrns = scrns
510-
511505
self.zeroData()
512-
self.makePhase(self.radii)
506+
507+
if scrns is not None:
508+
509+
#If scrns is not dict or list, assume array and put in list
510+
t = type(scrns)
511+
if t != dict and t != list:
512+
scrns = [scrns]
513+
self.scrns = scrns
514+
515+
self.makePhase(self.radii)
513516

514517
if correction is not None:
515518
self.performCorrection(correction)

soapy/wfs/base.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,14 @@ def frame(self, scrns, correction=None, read=True, iMatFrame=False):
420420
# If no elongation
421421
else:
422422
# If imat frame, dont want to make it off-axis
423-
if iMatFrame:
424-
try:
425-
iMatPhase = aoSimLib.zoom(scrns, self.los.nOutPxls, order=1)
426-
self.los.EField[:] = numpy.exp(1j*iMatPhase*self.los.phs2Rad)
427-
except ValueError:
428-
raise ValueError("If iMat Frame, scrn must be ``simSize``")
429-
else:
430-
self.los.makePhase(self.radii)
423+
# if iMatFrame:
424+
# try:
425+
# iMatPhase = aoSimLib.zoom(scrns, self.los.nOutPxls, order=1)
426+
# self.los.EField[:] = numpy.exp(1j*iMatPhase*self.los.phs2Rad)
427+
# except ValueError:
428+
# raise ValueError("If iMat Frame, scrn must be ``simSize``")
429+
# else:
430+
self.los.makePhase(self.radii)
431431

432432
self.uncorrectedPhase = self.los.phase.copy()/self.los.phs2Rad
433433
if correction is not None:

0 commit comments

Comments
 (0)