code: def qstd(x,quant=0.05,top=False,bottom=False):
      
      s = np.sort(x)
      n = np.size(x)
      lo = s[int(n*quant)]
      hi = s[int(n*(1-quant))]
      if top:
          w = np.where(x>=lo)
      elif bottom:
          w = np.where(x<=hi)
      else:
          w = np.where((x>=lo)&(x<=hi))
      return np.std(x[w])
docs: returns std, ignoring outer 'quant' pctiles