cwitools.kinematics.second_moment¶
-
cwitools.kinematics.second_moment(x, y, m1=None, y_var=[], get_err=False)¶ Calculate first moment.
- Args:
- x (np.array): Input coordinate values (e.g. wavelength). y (np.array): Input weights (i.e. intensity) m1 (float): The first moment. Calculated if not provided. y_var (np.array): Variance on y. Taken as var(y) if not provided. get_err (bool): Set to TRUE to return (moment, error), tuple
- Returns:
- float: The second moment in x. float: The error on the second moment (if get_err == True)