docstr: Computes the sigma points for an unscented Kalman filter
  given the mean (x) and covariance(P) of the filter.
  Returns tuple of the sigma points and weights.
  
  Works with both scalar and array inputs:
  sigma_points (5, 9, 2) # mean 5, covariance 9
  sigma_points ([5, 2], 9*eye(2), 2) # means 5 and 2, covariance 9I
  
  Parameters
  ----------
  
  X An array-like object of the means of length n
      Can be a scalar if 1D.
      examples: 1, [1,2], np.array([1,2])
  
  P : scalar, or np.array
     Covariance of the filter. If scalar, is treated as eye(n)*P.
  
  Returns
  -------
  
  sigmas : np.array, of size (n, 2n+1)
      Two dimensional array of sigma points. Each column contains all of
      the sigmas for one dimension in the problem space.
  
      Ordered by Xi_0, Xi_{1..n}, Xi_{n+1..2n}
docstr_tok: ["Computes","the","sigma","points","for","an","unscented","Kalman","filter","given","the","mean","(","x",")","and","covariance","(","P",")","of","the","filter",".","Returns","tuple","of","the","sigma","points","and","weights",".","Works","with","both","scalar","and","array","inputs",":","sigma_points","(","5",",","9",",","2",")","#","mean","5",",","covariance","9","sigma_points","(","[","5",",","2","]",",","9","*","eye","(","2",")",",","2",")","#","means","5","and","2",",","covariance","9I","Parameters","--","--","--","--","--","X","An","array-like","object","of","the","means","of","length","n","Can","be","a","scalar","if","1D",".","examples",":","1",",","[","1,2","]",",","np.array","(","[","1,2","]",")","P",":","scalar",",","or","np.array","Covariance","of","the","filter",".","If","scalar",",","is","treated","as","eye","(","n",")","*","P.","Returns","--","--","--","-","sigmas",":","np.array",",","of","size","(","n",",","2n+1",")","Two","dimensional","array","of","sigma","points",".","Each","column","contains","all","of","the","sigmas","for","one","dimension","in","the","problem","space",".","Ordered","by","Xi_0",",","Xi_","{","1","..","n","}",",","Xi_","{","n+1","..","2n","}"]
code: def sigma_points(self, x, P):
      """Computes the sigma points for an unscented Kalman filter
      given the mean (x) and covariance(P) of the filter.
      Returns tuple of the sigma points and weights.
  
      Works with both scalar and array inputs:
      sigma_points (5, 9, 2) # mean 5, covariance 9
      sigma_points ([5, 2], 9*eye(2), 2) # means 5 and 2, covariance 9I
  
      Parameters
      ----------
  
      X An array-like object of the means of length n
          Can be a scalar if 1D.
          examples: 1, [1,2], np.array([1,2])
  
      P : scalar, or np.array
         Covariance of the filter. If scalar, is treated as eye(n)*P.
  
      Returns
      -------
  
      sigmas : np.array, of size (n, 2n+1)
          Two dimensional array of sigma points. Each column contains all of
          the sigmas for one dimension in the problem space.
  
          Ordered by Xi_0, Xi_{1..n}, Xi_{n+1..2n}
      """
  
      assert x.ndim == 2 and x.shape[1], "x must be a column vector"
  
      n = self.n
  
      if np.isscalar(P):
          P = np.eye(n) * P
      else:
          P = np.asarray(P)
  
      lambda_ = self.alpha**2 * (n + self.kappa) - n
      U = self.sqrt((lambda_ + n) * P)
  
      sigmas = np.zeros((n, 2 * n + 1))
      x0 = x[:, 0]
      sigmas[:, 0] = x0
      for k in range(n):
          sigmas[:, k + 1] = self.subtract(x0, -U[k])
          sigmas[:, n + k + 1] = self.subtract(x0, U[k])
  
      return sigmas
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import matplotlib.pyplot
  import numpy.random
  from numpy.random import randn
  from numpy import asarray
  import numpy
  from filterpy.kalman import UnscentedKalmanFilter
  from filterpy.kalman import unscented_transform, MerweScaledSigmaPoints, JulierSigmaPoints, SimplexSigmaPoints
  from filterpy.common import Q_discrete_white_noise
  import filterpy.stats
  from math import cos, sin
  from filterpy.kalman import UnscentedKalmanFilter2
label_desc: Use image node_id 3 for calling the MerweScaledSigmaPoints2 obj's underlying member method code with example usage: obj.sigma_points(x, P) and returns: sigmas