docs: def function(self, x, y, amp, R_sersic, n_sersic, center_x=0, center_y=0):
          """
          returns Sersic profile
          """
          #if n_sersic < 0.2:
          #    n_sersic = 0.2
          #if R_sersic < 10.**(-6):
          #    R_sersic = 10.**(-6)
          R_sersic = np.maximum(0, R_sersic)
          x_shift = x - center_x
          y_shift = y - center_y
          R = np.sqrt(x_shift*x_shift + y_shift*y_shift)
          if isinstance(R, int) or isinstance(R, float):
              R = max(self._smoothing, R)
          else:
              R[R < self._smoothing] = self._smoothing
          _, bn = self.k_bn(n_sersic, R_sersic)
          R_frac = R/R_sersic
          #R_frac = R_frac.astype(np.float32)
          if isinstance(R, int) or isinstance(R, float):
              if R_frac > 100:
                  result = 0
              else:
                  exponent = -bn*(R_frac**(1./n_sersic)-1.)
                  result = amp * np.exp(exponent)
          else:
              R_frac_real = R_frac[R_frac <= 100]
              exponent = -bn*(R_frac_real**(1./n_sersic)-1.)
              result = np.zeros_like(R)
              result[R_frac <= 100] = amp * np.exp(exponent)
          return np.nan_to_num(result)