a python port of PiezoD