I think we've chatted about this somewhere before but not sure where.
How's about something like ```mdi = new_values[np.isfinite(new_values)].max() * 1.1``` in case 1e20 is a valid value?