def squish(incs, f):
    """
    This function applies an flattening factor (f) to inclination data
    (incs) and returns 'squished' values.

    Parameters
    ----------
    incs : list of inclination values or a single value
    f : flattening factor (between 0.0 and 1.0)

    Returns
    ---------
    incs_squished : List of flattened directions (in degrees)

    Examples
    --------
    Take a list of inclinations, flatten them.

    >>> inclinations = [43,47,41]
    >>> ipmag.squish(inclinations,0.4)
    [20.455818908027187, 23.216791019112204, 19.173314360172309]
    """
    try:
        length = len(incs)
        incs_squished = []
        for n in range(0, length):
            inc_rad = incs[n] * np.pi / 180.  # convert to radians
            inc_new_rad = f * np.tan(inc_rad)
            inc_new = np.arctan(inc_new_rad) * 180. / \
                np.pi  # convert back to degrees
            incs_squished.append(inc_new)
        return incs_squished
    except:
        inc_rad = incs * np.pi / 180.  # convert to radians
        inc_new_rad = f * np.tan(inc_rad)
        inc_new = np.arctan(inc_new_rad) * 180. / \
            np.pi  # convert back to degrees
        return inc_new
This function applies an flattening factor (f) to inclination data
    (incs) and returns 'squished' values.

    Parameters
    ----------
    incs : list of inclination values or a single value
    f : flattening factor (between 0.0 and 1.0)

    Returns
    ---------
    incs_squished : List of flattened directions (in degrees)

    Examples
    --------
    Take a list of inclinations, flatten them.

    >>> inclinations = [43,47,41]
    >>> ipmag.squish(inclinations,0.4)
    [20.455818908027187, 23.216791019112204, 19.173314360172309]