This function returns the positions needed for resampling a "gappy" vector 
    
    :keyword dt: Force sampling at a given resolution. Otherwise uses main data sampling (computed by getting the median value of the derivative)

def argresample(a,**kwargs):
    '''
    This function returns the positions needed for resampling a "gappy" vector 
    
    :keyword dt: Force sampling at a given resolution. Otherwise uses main data sampling (computed by getting the median value of the derivative)
    '''
    
    dt=kwargs.get('dt',np.median(deriv(a)))
    
    h,_=np.histogram(a, bins=(a.max()-a.min())/dt + 1, range=[a.min()-dt/2.,a.max()+dt/2.])
    
    return h.astype(bool)