data.py 347 B

12345678910111213
  1. from collections import namedtuple
  2. LocationData = namedtuple('LocationData',
  3. 'hwid lat lon eig prec yaw press timestamp')
  4. def have_location(x):
  5. return x.lat != None and x.lon != None
  6. def maybe_entry(x):
  7. return x.eig < 5 and (x.prec > 40 or x.prec < 0)
  8. def maybe_indoor(x):
  9. return x.eig < 1 and (x.prec > 400 or x.prec < 0)