acoustic_data_science/processing/process_data.py
def tag_short_transients(df):
    """
    Tags loud events lasting less than 0.5 s as short transients.
    """

    logging.info("Tagging short transients.")

    df["trans_shft_down"] = np.concatenate((np.array([True]), df["loud"][:-1]))
    df["trans_shft_up"] = np.concatenate((df["loud"][1:], np.array([True])))
    df["short_transient"] = (
        df["loud"]
        & (df["trans_shft_down"] == False)
        & (df["trans_shft_up"] == False)
    )
    df.drop(columns=["trans_shft_down", "trans_shft_up"], inplace=True)

    return df

    Tags loud events lasting less than 0.5 s as short transients.
    
Tags loud events lasting less than 0.5 s as short transients.
Tags loud events lasting less than 0 . 5 s as short transients .
def tag_short_transients(df):
    logging.info("Tagging short transients.")
    df["trans_shft_down"] = np.concatenate((np.array([True]), df["loud"][:-1]))
    df["trans_shft_up"] = np.concatenate((df["loud"][1:], np.array([True])))
    df["short_transient"] = (
        df["loud"]
        & (df["trans_shft_down"] == False)
        & (df["trans_shft_up"] == False)
    )
    df.drop(columns=["trans_shft_down", "trans_shft_up"], inplace=True)
    return df
def tag_short_transients ( df ) : logging . info ( "Tagging short transients." ) df [ "trans_shft_down" ] = np . concatenate ( ( np . array ( [ True ] ) , df [ "loud" ] [ : - 1 ] ) ) df [ "trans_shft_up" ] = np . concatenate ( ( df [ "loud" ] [ 1 : ] , np . array ( [ True ] ) ) ) df [ "short_transient" ] = ( df [ "loud" ] & ( df [ "trans_shft_down" ] == False ) & ( df [ "trans_shft_up" ] == False ) ) df . drop ( columns = [ "trans_shft_down" , "trans_shft_up" ] , inplace = True ) return df
Tags loud events lasting less than 0.5 s as short transients.
Tags loud events lasting less than 0 . 5 s as short transients .
"""
    Tags loud events lasting less than 0.5 s as short transients.
    """
df