def residual_stddev(
    df,
    param=[
        "BTL_O",
        "BTL_C1",
        "BTL_C2",
        "C1_C2",
        "BTL_T1",
        "BTL_T2",
        "T1_T2",
        "BTL_SAL",
        "BTL_SAL_UP",
    ],
):
    """Calculate standard deviations of parameters or residuals.
    Input:
    df - dataframe containing all data from casts
    param - list of parameter names
    Output:
    output - dictionary, key = is parameter name or parameter deep, value is 2 stddevs
    """
    output = {}
    for x in param:
        output[f"{x}"] = df[f"{x}"].std() * 2
        df_deep = df[df["CTDPRS"] > 2000]
        output[f"{x}_DEEP"] = df_deep[f"{x}"].std() * 2
    return output