def leglab(title, word, colvals, colnam): """ make labels for the colormaps """ axis("off") x0 = -2.7 dx = 2.9 xw = 0.7 xo = 0.8 y0 = -1.74 dy = -0.1 yw = 0.1 yo = 0.02 i = -1 for ix in range(2): for iy in range(3): i=i+1 ll = [x0+ix*dx, y0+iy*dy] ur = [x0+ix*dx+xw, y0+iy*dy+yw] legbox(ll, ur, colnam[i+1]) if i<len(colvals)-1: string = " " + str(colvals[i]+1) + "-" + str(colvals[i+1]) + " " + word else: string = " >" + str(colvals[i]) + " " + word text(ll[0]+xo,ll[1]+yo, string, smallfont, horizontalalignment='left', color=colnam[i+1]) text(0.0,-1.6,title, bigfont, horizontalalignment='center', color=WHITE) axis([-3,3,-2.1,-1.55]) return
def infoWrite(sessionID, numfields, nums): """ add various information to the bottom of the plot """ axis("off") text(1.0,-0.6,socket.gethostname(),bigfont,horizontalalignment='right', color=WHITE) # Get a connection to the DB connection = openConnection () cursor = connection.cursor () sql = 'SELECT completion from SeqHistory where completion>.1 and sessionID = %d' % (sessionID) # Fetch the data from the DB sys.stderr.write ('Fetching data from the DB...\n') try: n = cursor.execute (sql) except: sys.stderr.write('Unable to execute SQL query (%s).' % (sql) ) try: resObs = cursor.fetchall () except: resObs = None numseq = len(resObs) string = "%d NEA sequences completed" % len(resObs) text(0.6,0.0,string,bigfont,horizontalalignment='left', color=WHITE) string = "%d fields observed" % numfields text(0.0,0.0,string,bigfont,horizontalalignment='left', color=WHITE) string = "%d r observations" % nums[0] text(0.0,-0.3,string,smallfont,horizontalalignment='left', color=WHITE) string = "%d g observations" % nums[1] text(0.0,-0.45,string,smallfont,horizontalalignment='left', color=WHITE) string = "%d i observations" % nums[2] text(0.0,-0.6,string,smallfont,horizontalalignment='left', color=WHITE) string = "%d z observations" % nums[3] text(0.3,-0.3,string,smallfont,horizontalalignment='left', color=WHITE) string = "%d y observations" % nums[4] text(0.3,-0.45,string,smallfont,horizontalalignment='left', color=WHITE) axis([0,1,0,1]) return
def leglab(title, word, colvals, colnam): """ make labels for the colormaps """ axis("off") x0 = -2.7 dx = 2.9 xw = 0.7 xo = 0.8 y0 = -1.74 dy = -0.1 yw = 0.1 yo = 0.02 i = -1 for ix in range(2): for iy in range(3): i = i + 1 ll = [x0 + ix * dx, y0 + iy * dy] ur = [x0 + ix * dx + xw, y0 + iy * dy + yw] legbox(ll, ur, colnam[i + 1]) if i < len(colvals) - 1: string = " " + str(colvals[i] + 1) + "-" + str( colvals[i + 1]) + " " + word else: string = " >" + str(colvals[i]) + " " + word text(ll[0] + xo, ll[1] + yo, string, smallfont, horizontalalignment='left', color=colnam[i + 1]) text(0.0, -1.6, title, bigfont, horizontalalignment='center', color=WHITE) axis([-3, 3, -2.1, -1.55]) return
def plotPanel(RA, Dec, nvisits, label, colvals, colnam): """ Plot a panel of visit data """ circlesize = 2 r = RA[:] d = Dec[:] n = nvisits[:] r = r * 15.0 # sort arrays ind = argsort(n) r = take(r, ind) d = take(d, ind) n = take(n, ind) r = where(r > 180.0, r - 360.0, r) axis("off") if label == "nea": aitoff_e() else: aitoff() cols = setcolors(n, colvals, colnam) docir(r, d, circlesize, n, cols) if label == "nea": label = "NEA Sequences" else: label = "WL Fields: " + label text(0, 1.51, label, bigfont, horizontalalignment='center') axis([-3, 3, -1.5, 1.5]) return
def plotPanel(RA, Dec, nvisits, label, colvals, colnam): """ Plot a panel of visit data """ circlesize = 2 r = RA[:] d = Dec[:] n = nvisits[:] r = r*15.0 # sort arrays ind = argsort(n) r = take(r,ind) d = take(d,ind) n = take(n,ind) r = where(r>180.0,r-360.0,r) axis("off") if label == "nea": aitoff_e() else: aitoff() cols = setcolors(n, colvals, colnam) docir(r, d, circlesize, n, cols) if label == "nea": label = "NEA Sequences" else: label = "WL Fields: "+ label text(0, 1.51, label, bigfont, horizontalalignment='center') axis([-3,3,-1.5,1.5]) return
def infoWrite(sessionID, numfields, nums): """ add various information to the bottom of the plot """ axis("off") text(1.0, -0.6, socket.gethostname(), bigfont, horizontalalignment='right', color=WHITE) # Get a connection to the DB connection = openConnection() cursor = connection.cursor() sql = 'SELECT completion from SeqHistory where completion>.1 and sessionID = %d' % ( sessionID) # Fetch the data from the DB sys.stderr.write('Fetching data from the DB...\n') try: n = cursor.execute(sql) except: sys.stderr.write('Unable to execute SQL query (%s).' % (sql)) try: resObs = cursor.fetchall() except: resObs = None numseq = len(resObs) string = "%d NEA sequences completed" % len(resObs) text(0.6, 0.0, string, bigfont, horizontalalignment='left', color=WHITE) string = "%d fields observed" % numfields text(0.0, 0.0, string, bigfont, horizontalalignment='left', color=WHITE) string = "%d r observations" % nums[0] text(0.0, -0.3, string, smallfont, horizontalalignment='left', color=WHITE) string = "%d g observations" % nums[1] text(0.0, -0.45, string, smallfont, horizontalalignment='left', color=WHITE) string = "%d i observations" % nums[2] text(0.0, -0.6, string, smallfont, horizontalalignment='left', color=WHITE) string = "%d z observations" % nums[3] text(0.3, -0.3, string, smallfont, horizontalalignment='left', color=WHITE) string = "%d y observations" % nums[4] text(0.3, -0.45, string, smallfont, horizontalalignment='left', color=WHITE) axis([0, 1, 0, 1]) return