Beispiel #1
0
    def get_Gamma(self, omega, step):
        """Return the overlap factor.
        Assume that omega is part of current center omegas.

        Parameters
        ----------
        omega :
            The angular frequency.  :math:`[rad\cdot ps^{-1}]`
        step :
            The current step of the computation.

        Returns
        -------
        :
            The overlap factor at the specified space step.

        """
        # Handle isinstance(omega, float) ------------------------------
        revert = False
        if (isinstance(omega, float)):
            omega = np.array([omega])
            revert = True
        # Getter -------------------------------------------------------
        res = np.zeros_like(omega)
        for i in range(len(omega)):
            if (util.is_float_in_list(omega[i], self._center_omega_s)):
                res[i] = self._overlap_s(self.get_eff_area(omega[i], step))
            else:
                res[i] = self._overlap_p(self.get_eff_area(omega[i], step))
        # Revert float type of omega -----------------------------------
        if (revert):
            res = res[0]

        return res
Beispiel #2
0
    def get_n_0(self, omega):
        """Return the ground refractive index of the core.
        Assume that omega is part of current center omegas.

        Parameters
        ----------
        omega :
            The angular frequency.  :math:`[rad\cdot ps^{-1}]`

        Returns
        -------
        :
            The ground refractive index of the core.

        """
        # Handle isinstance(omega, float) ------------------------------
        revert = False
        if (isinstance(omega, float)):
            omega = np.array([omega])
            revert = True
        # Getter -------------------------------------------------------
        if (self._calc_n_core is not None):
            res = self._calc_n_core.n(omega)
        else:
            res = np.zeros_like(omega)
            for i in range(len(omega)):
                if (util.is_float_in_list(omega[i], self._center_omega_s)):
                    res[i] = self._n_0_s_value
                else:
                    res[i] = self._n_0_p_value
        # Revert float type of omega -----------------------------------
        if (revert):
            res = res[0]

        return res
Beispiel #3
0
    def get_n_clad(self, omega, step):
        """Return the refractive index of the core.
        Assume that omega is part of current center omegas.
        N.B. : variable step currently not considered, but could be if
        cladding doped.

        Parameters
        ----------
        omega :
            The angular frequency.  :math:`[rad\cdot ps^{-1}]`
        step :
            The current step of the computation.

        Returns
        -------
        :
            The refractive index of the core.

        """
        # Handle isinstance(omega, float) ------------------------------
        revert = False
        if (isinstance(omega, float)):
            omega = np.array([omega])
            revert = True
        # Getter -------------------------------------------------------
        res = np.zeros_like(omega)
        for i in range(len(omega)):
            if (util.is_float_in_list(omega[i], self._center_omega_s)):
                if (self._calc_n_clad is None):
                    res[i] = self._n_clad_s_value
                else:
                    res[i] =\
                        self._calc_n_clad(self._NA_value_s,
                                          self.get_n_core(omega[i], step))
            else:
                if (self._calc_n_clad is None):
                    res[i] = self._n_clad_p_value
                else:
                    res[i] =\
                        self._calc_n_clad(self._NA_value_p,
                                          self.get_n_core(omega[i], step))
        # Revert float type of omega -----------------------------------
        if (revert):
            res = res[0]

        return res
Beispiel #4
0
    def get_sigma_e(self, omega, step):
        """Return the emission cross section.
        Assume that omega is part of current center omegas.
        Variable 'step' currently not considered, only for constitency.

        Parameters
        ----------
        omega :
            The angular frequency.  :math:`[rad\cdot ps^{-1}]`
        step :
            The current step of the computation.

        Returns
        -------
        :
            The emission cross section. :math:`[nm^2]`

        """
        # Handle isinstance(omega, float) ------------------------------
        revert = False
        if (isinstance(omega, float)):
            omega = np.array([omega])
            revert = True
        # Getter -------------------------------------------------------
        res = np.zeros_like(omega)
        for i in range(len(omega)):
            if (self._stimu is not None):
                res[i] = self._stimu.get_cross_section(omega[i])
            else:
                if (self._sigma_e_mccumber):
                    # Assume omega = center_omega
                    res[i] = McCumber.calc_cross_section_emission(
                        self.get_sigma_a(omega, step), 0.0, 0.0,
                        self.N_0[step], self.N_1[step], self._T)
                else:
                    if (util.is_float_in_list(omega[i], self._center_omega_s)):
                        res[i] = self._sigma_e_s_value
                    else:
                        res[i] = self._sigma_e_p_value
        # Revert float type of omega -----------------------------------
        if (revert):
            res = res[0]

        return res
Beispiel #5
0
    def get_eff_area(self, omega, step):
        """Return the effective area.
        Assume that omega is part of current center omegas.

        Parameters
        ----------
        omega :
            The angular frequency.  :math:`[rad\cdot ps^{-1}]`
        step :
            The current step of the computation.

        Returns
        -------
        :
            The effective area at the specified space step.
            :math:`[\mu m^2]`

        """
        # Handle isinstance(omega, float) ------------------------------
        revert = False
        if (isinstance(omega, float)):
            omega = np.array([omega])
            revert = True
        # Getter -------------------------------------------------------
        NA = NumericalAperture.calc_NA(self.get_n_core(omega, step),
                                       self.get_n_clad(omega, step))
        res = np.zeros_like(omega)
        self._eff_area_s.NA = NA
        self._eff_area_p.NA = NA
        for i in range(len(omega)):
            if (util.is_float_in_list(omega[i], self._center_omega_s)):
                res[i] = self._eff_area_s(omega[i])
            else:
                res[i] = self._eff_area_p(omega[i])
        # Revert float type of omega -----------------------------------
        if (revert):
            res = res[0]

        return res