+ if origin:
+ if ',' in origin:
+ # TODO coordinate
+ coords = origin.split(',')
+ if len(coords) != 2:
+ raise RuntimeError('Grid origin expects origin with x,y coordinates.')
+ origin = (float(coords[0]), float(coords[1]))
+ elif origin in ALIASES:
+ origin = ALIASES[origin]
+ else:
+ raise RuntimeError('Grid origin must be either coordinate or alias.')
+ else:
+ origin = (0.0, 0.0)
+