cwitools.kinematics.basic_moments

cwitools.kinematics.basic_moments(x, y, y_var=[], pos_thresh=False, m1_init=None, window=30, get_err=True)

Calculate first and second moment.

Args:
x (np.array): Input coordinate values (e.g. wavelength). y (np.array): Input weights (i.e. intensity) pos_thresh (bool): Set to TRUE to exclude negative weights. m1_init (float): Initial guess for the first moment value window (float): Size of window, centered on m1_init, to use
Returns:
float: The first moment in x. float: The second moment in x.