You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
My question pertains to the following snippet of code from FresnelWavefront.apply_lens_power.
ifnotself.sphericalifnp.abs(self.z_w0-self.z) <self.z_r:
_log.debug('Near-field, Plane-to-Plane Propagation.')
z_eff=1*optic.flelse:
# find the radius of curvature of the lens output beam# curvatures are multiplicative exponentials# e^(1/z) = e^(1/x)*e^(1/y) = e^(1/x+1/y) -> 1/z = 1/x + 1/y# z = 1/(1/x+1/y) = xy/x+yz_eff=1.0/ (1.0/optic.fl+1.0/ (self.z-self.z_w0))
_log.debug('Inside Rayleigh distance to Outside Rayleigh distance.')
self.spherical=Trueelse: # spherical input wavefrontifnp.abs(self.z_w0-self.z) >self.z_r:
_log.debug('Spherical to Spherical wavefront propagation.')
_log.debug("1/fl={0:0.4e}".format(1.0/optic.fl))
_log.debug("1.0/(R_input_beam)={0:0.4e}".format(1.0/r_input_beam))
_log.debug("1.0/(self.z-self.z_w0)={0:0.4e}".format(1.0/ (self.z-lf.z_w0)))
if (self.z-self.z_w0) ==0:
z_eff=1.0/ (1.0/optic.fl+1.0/ (self.z-self.z_w0))
else:
z_eff=1.0/ (1.0/optic.fl+1.0/ (self.z-self.z_w0) -1.0/r_input_beam)
else:
_log.debug('Spherical to Planar.')
z_eff=1.0/ (1.0/optic.fl-1.0/r_input_beam)
self.spherical=False
Specifically, I believe that the if (self.z - self.z_w0) == 0: in the else branch of the outer if statement is not reachable. If I have interpreted it correctly, (self.z - self.z_w0) == 0 implies that the wavefront is at the waist, where it is planar. Under this assumption the else branch of the outer if statement should not have been accessed. Furthermore, at the next level of nesting np.abs(self.z_w0 - self.z) > self.z_r is checked and since the Rayleigh distance, z_r, is a definitely positive quantity it should not be possible to satisfy both: np.abs(self.z_w0 - self.z) > self.z_r and (self.z - self.z_w0) == 0.
As a second note the (self.z - self.z_w0) == 0 is used in division, implying it is a known amount and z_eff is 0 (1 / inf). If you don't mind me asking is there an original reference for this code, I have scrolled back through Lawrence et. al. but have been unable to find any references to z_eff (I do vaguely remember it been there). If you could point me in that direction it would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Jordan-Dennis
changed the title
Does FresnelWavefront.apply_lens_power has inaccessible if branches?
Does FresnelWavefront.apply_lens_power have inaccessible if branches?
Jul 21, 2022
Hello again,
Upon further review I believe that I may have spotted a second inconsistency in if the wavefront is considered spherical. The line np.abs(self.z - self.z_w0) < (or >) self.z_r seems to be used to determine if the wavefront is spherical or planar at many if statement branches. However, the topif statement of the same function uses np.abs(self.z_w0 - self.z) > self.rayleigh_factor * self.z_r considering also the rayleigh_factor (2. by default). I do not perceive the reason for this difference.
Hi all,
My question pertains to the following snippet of code from
FresnelWavefront.apply_lens_power
.Specifically, I believe that the
if (self.z - self.z_w0) == 0:
in theelse
branch of the outerif
statement is not reachable. If I have interpreted it correctly,(self.z - self.z_w0) == 0
implies that the wavefront is at the waist, where it is planar. Under this assumption theelse
branch of the outerif
statement should not have been accessed. Furthermore, at the next level of nestingnp.abs(self.z_w0 - self.z) > self.z_r
is checked and since the Rayleigh distance,z_r
, is a definitely positive quantity it should not be possible to satisfy both:np.abs(self.z_w0 - self.z) > self.z_r
and(self.z - self.z_w0) == 0
.As a second note the
(self.z - self.z_w0) == 0
is used in division, implying it is a known amount andz_eff
is0
(1 / inf
). If you don't mind me asking is there an original reference for this code, I have scrolled back through Lawrence et. al. but have been unable to find any references toz_eff
(I do vaguely remember it been there). If you could point me in that direction it would be greatly appreciated.The text was updated successfully, but these errors were encountered: