def summary(x, rm_nan=False, debug=False):
    if type(x) is np.ndarray:
        xx = np.copy(x)
    else:
        if type(x) is list:
            xx = np.array(x)
        else:
            raise ValueError('x=' + str(x) + ' must be a numpy.ndarray')
    if xx.ndim is not 1:
        raise ValueError('xx.dim=' + str(xx.ndim) + ' must be 1')
    if rm_nan:
        xx = xx[np.logical_not(np.isnan(xx))]
    npoints = len(xx)
    ok = npoints > 0
    result = {
        'npoints' : npoints,
        'minimum' : np.min(xx) if ok else 0,
        'percentile25' : np.percentile(xx, 25) if ok else 0,
        'median' : np.percentile(xx, 50) if ok else 0,
        'mean' : np.mean(xx) if ok else 0,
        'percentile75': np.percentile(xx, 75) if ok else 0,
        'maximum' : np.max(xx) if ok else 0,
        'std': np.std(xx) if ok else 0,
        'robust_std' : robust_std(xx) if ok else 0,
        'percentile15': np.percentile(xx, 15.86553) if ok else 0,
        'percentile84': np.percentile(xx, 84.13447) if ok else 0
    }
    if debug:
        print('>>> ========================================')
        print('>>> STATISTICAL SUMMARY:')
        print('>>> ----------------------------------------')
        print('>>> Number of points.........:', result['npoints'])
        print('>>> Minimum..................:', result['minimum'])
        print('>>> 1st Quartile.............:', result['percentile25'])
        print('>>> Median...................:', result['median'])
        print('>>> Mean.....................:', result['mean'])
        print('>>> 3rd Quartile.............:', result['percentile75'])
        print('>>> Maximum..................:', result['maximum'])
        print('>>> ----------------------------------------')
        print('>>> Standard deviation.......:', result['std'])
        print('>>> Robust standard deviation:', result['robust_std'])
        print('>>> 0.1586553 percentile.....:', result['percentile15'])
        print('>>> 0.8413447 percentile.....:', result['percentile84'])
        print('>>> ========================================')
    return result