#!/usr/bin/env python from __future__ import division from intervals import Interval # img, (mint,maxt,cnt) rulers = { 44: (Interval(1.54813, 1.54837), Interval(1.59641, 1.59651), 43), 45: (Interval(1.54798, 1.54837), Interval(1.59690, 1.59709), 44), 46: (Interval(1.54813, 1.54837), Interval(1.59661, 1.59695), 44), 47: (Interval(1.54793, 1.54813), Interval(1.59617, 1.59632), 44), 48: (Interval(1.54793, 1.54822), Interval(1.59680, 1.59700), 45), 49: (Interval(1.54808, 1.54832), Interval(1.59637, 1.59661), 45), 50: (Interval(1.54740, 1.54755), Interval(1.59671, 1.59685), 46), 51: (Interval(1.53376, 1.53395), Interval(1.58311, 1.58331), 44), 52: (Interval(1.53395, 1.53429), Interval(1.58292, 1.58326), 44), 53: (Interval(1.53422, 1.53451), Interval(1.58288, 1.58303), 44), 54: (Interval(1.53276, 1.53284), Interval(1.55656, 1.55667), 21), # extremely shitty 55: (Interval(1.53271, 1.53305), Interval(1.55656, 1.55670), 21), # extremely shitty 56: (Interval(1.53231, 1.53245), Interval(1.55598, 1.55611), 21), # extremely shitty 57: (Interval(1.53284, 1.53305), Interval(1.55640, 1.55664), 21), # extremely shitty 58: (Interval(1.53303, 1.53329), Interval(1.55640, 1.55667), 21), # extremely shitty dupe? 59: (Interval(1.53208, 1.53231), Interval(1.55660, 1.55680), 22), # extremely shitty 60: (Interval(1.53258, 1.53287), Interval(1.55593, 1.55619), 21), # extremely shitty 61: (Interval(1.53292, 1.53316), Interval(1.55622, 1.55640), 21), # extremely shitty 62: (Interval(1.53287, 1.53311), Interval(1.55614, 1.55635), 21), # extremely shitty 63: (Interval(1.52041, 1.52060), Interval(1.56913, 1.56942), 44), } # first part: result = Interval(0.001067, 0.001127) result = Interval(0.001067, 0.001142381) # total. for i, (mint, maxt, cnt) in sorted(rulers.items()): if i == 44: continue r = (maxt - mint)/cnt print(r) assert(result.contains(r)) print(result) # bei 54 ist g/n == Interval(0.736,0.8)