New code for binned masking

Deals with non-integer frequencies - manual only! Beware!