Skip to content

Commit

Permalink
Allow FQPM image plane shifts like any other AnalyticOpticalElement; …
Browse files Browse the repository at this point in the history
…related to mperrin/webbpsf#191
  • Loading branch information
mperrin committed Feb 20, 2018
1 parent b48e50e commit 6b7ea33
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions poppy/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class AnalyticOpticalElement(OpticalElement):
error if you try to set one.
shift_x, shift_y : Optional floats
Translations of this optic, given in meters relative to the optical
axis.
axis for pupil plane elements, or arcseconds relative to the optical axis
for image plane elements.
rotation : Optional float
Rotation of the optic around its center, given in degrees
counterclockwise. Note that if you apply both shift and rotation,
Expand Down Expand Up @@ -610,14 +611,8 @@ def get_opd(self, wave):
raise ValueError("4QPM get_opd must be called with a Wavefront to define the spacing")
assert (wave.planetype == _IMAGE)

# TODO this computation could be sped up a lot w/ optimzations
phase = np.empty(wave.shape)
n0 = wave.shape[0] / 2
n0 = int(round(n0))
phase[:n0, :n0] = 0.5
phase[n0:, n0:] = 0.5
phase[n0:, :n0] = 0
phase[:n0, n0:] = 0
y, x = self.get_coordinates(wave)
phase = (1- np.sign(x)*np.sign(y))*0.25

return phase * self.central_wavelength.to(u.meter).value

Expand Down

0 comments on commit 6b7ea33

Please sign in to comment.