confined function

Restrict data in a given interval