trimWeights function

Trim sampling weights