Skip to content
Snippets Groups Projects
Commit 149a05c1 authored by Jan Petermann's avatar Jan Petermann
Browse files

update gaussian beam parameter analysis

parent 083ed3b1
No related branches found
No related tags found
No related merge requests found
Pipeline #4427 failed
...@@ -84,13 +84,13 @@ def fit_beam_data(data, ...@@ -84,13 +84,13 @@ def fit_beam_data(data,
return results return results
class GaussianBeam(): class GaussianBeam:
""" """
Represents a complex gaussian beam parameter Represents a complex gaussian beam parameter
""" """
def __init__(self, q=0 + 1j, wavelength=1.064e-6): def __init__(self, q=0 + 1j, wavelength=1.064e-6):
self._lambda = wavelength self._wavelength = wavelength
self._q = q self._q = q
@classmethod @classmethod
...@@ -101,7 +101,7 @@ class GaussianBeam(): ...@@ -101,7 +101,7 @@ class GaussianBeam():
""" """
Returns the beam parameter after free-space propagation of d Returns the beam parameter after free-space propagation of d
""" """
return GaussianBeam(self._q + d) return GaussianBeam(self._q + d, self._wavelength)
def get_profile(self, zpoints): def get_profile(self, zpoints):
""" """
...@@ -110,9 +110,17 @@ class GaussianBeam(): ...@@ -110,9 +110,17 @@ class GaussianBeam():
quotient = (self._q.real + zpoints) / self._q.imag quotient = (self._q.real + zpoints) / self._q.imag
return self.w0 * np.sqrt(1 + quotient ** 2) return self.w0 * np.sqrt(1 + quotient ** 2)
@property
def wavelength(self):
return self._wavelength
@property
def q(self):
return self._q
@property @property
def w0(self): def w0(self):
return np.sqrt(self._q.imag * self._lambda / np.pi) return np.sqrt(self._q.imag * self._wavelength / np.pi)
@property @property
def z0(self): def z0(self):
...@@ -138,7 +146,7 @@ class GaussianBeam(): ...@@ -138,7 +146,7 @@ class GaussianBeam():
""" """
Calculate beam divergence (in radian). Calculate beam divergence (in radian).
""" """
return np.arctan(self._lambda / np.pi / self.w0) return np.arctan(self._wavelength / np.pi / self.w0)
def __repr__(self): def __repr__(self):
return "w0={w0} @ z0={z0}".format( return "w0={w0} @ z0={z0}".format(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment