anomdictlist.append(dict2) dict3['level'] = level+5 dict3['x'] = (currx+1)*32 dict3['y'] = (curry+1)*32 anomdictlist.append(dict3) dict4['level'] = level+5 dict4['x'] = (currx+1)*32 dict4['y'] = 32*curry anomdictlist.append(dict4) currdict['tileSelection'] = anomdictlist currdict['name'] = "anomaly" + str(i+1) # use this name to get the run number # anomdict['name'] = jsonIn['feature']['name'] + "anomaly" + str(i+1) latlon = convertCoords(currx, curry, level) geo = [latlon[0],latlon[1]] currdict['geoCenter'] = geo currdict['zoomLevel'] = level-1 currdict['resolution'] = 7 currdict['description'] = "Anomaly found at nanocube level " + str(level) + " and at day " + str(datetime.datetime.fromtimestamp(currentTime)) currdict['timeSelect'] = dict() currdict['timeZoom'] = dict() #These are where the timeline while zoom is on currdict['timeSelect']['startMilli'] = long(currentTime*1000 - msecondsperbin) currdict['timeSelect']['endMilli'] = long(currentTime*1000 + msecondsperbin) #zooming calculation if window * 0.10 > 3: windowpercent = int(window * 0.10) else:
elif j == 1: currdict["x"] = x1 currdict["y"] = y2 elif j == 2: currdict["x"] = x2 currdict["y"] = y2 elif j == 3: currdict["x"] = x2 currdict["y"] = y1 currdictlist.append(currdict) #need to find the center of of the box in latitude/longitude xavg = (x1+x2)/2 yavg = (y1+y2)/2 latlon = convertCoords(xavg, yavg, currlevel) #these coordinates are the geocenter (where the map will center on) geo = [latlon[0],latlon[1]] anomdict['tileSelection'] = currdictlist anomdict['description'] = "Time bucket: "+ str(anomaly) + " \nthis anomaly occured around " + str(datetime.datetime.fromtimestamp(currentTime)) anomdict['geoCenter'] = geo anomdict['resolution'] = currjson['resolution'] anomdict['timeSelect'] = dict() anomdict['timeZoom'] = dict() #These are where the timeline while zoom is on anomdict['timeSelect']['startMilli'] = long(currentTime*1000 - msecondsperbin) anomdict['timeSelect']['endMilli'] = long(currentTime*1000 + msecondsperbin) #zooming calculation