Write final ranks to json file, avoid looking up negative indices in prob_interval