Returns copy of constraint, with mask rearranged according to indices

def resample(self, inds):
        """Returns copy of constraint, with mask rearranged according to indices
        """
        new = copy.deepcopy(self)
        for arr in self.arrays:
            x = getattr(new, arr)
            setattr(new, arr, x[inds])
        return new