cwitools.kinematics.first_moment¶
-
cwitools.kinematics.first_moment(x, y, 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) 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 first moment in x. float: The error on the first moment (if get_err == True)