def gstd(data, channels=None):
    """
    Calculate the geometric std. dev. of the events in an FCSData object.

    Parameters
    ----------
    data : FCSData or numpy array
        NxD flow cytometry data where N is the number of events and D is
        the number of parameters (aka channels).
    channels : int or str or list of int or list of str, optional
        Channels on which to calculate the statistic. If None, use all
        channels.

    Returns
    -------
    float or numpy array
        The geometric standard deviation of the events in the specified
        channels of `data`.

    """
    # Slice data to take statistics from
    if channels is None:
        data_stats = data
    else:
        data_stats = data[:, channels]

    # Calculate and return statistic
    return np.exp(np.std(np.log(data_stats), axis=0))
Calculate the geometric std. dev. of the events in an FCSData object.

    Parameters
    ----------
    data : FCSData or numpy array
        NxD flow cytometry data where N is the number of events and D is
        the number of parameters (aka channels).
    channels : int or str or list of int or list of str, optional
        Channels on which to calculate the statistic. If None, use all
        channels.

    Returns
    -------
    float or numpy array
        The geometric standard deviation of the events in the specified
        channels of `data`.