no_plot = args.no_plot resolution = args.resolution interactive = args.interactive res_parts = resolution.split("x") if (len(res_parts) != 2): sys.stderr.write("ERROR: resolution must be of form 1024x768") sys.exit(1) res_x = res_parts[0] res_y = res_parts[1] # change to temp dir workdir = tempfile.mkdtemp() # check the DM2000 file exists dmlist = trans_paths.getConfigDir() + '/dm2000.list' try: fptr = open(dmlist, 'r') except IOError: print "ERROR: cannot open dmlist " + dmlist os.rmdir(workdir) sys.exit(1) else: # determine the dm index in the file that matches dm_idx = 0 lines = fptr.readlines() for line in lines: line = line.strip() if float(line) > dm: break
no_plot = args.no_plot resolution = args.resolution interactive = args.interactive res_parts = resolution.split("x") if len(res_parts) != 2: sys.stderr.write("ERROR: resolution must be of form 1024x768") sys.exit(1) res_x = res_parts[0] res_y = res_parts[1] # change to temp dir workdir = tempfile.mkdtemp() # check the DM2000 file exists dmlist = trans_paths.getConfigDir() + "/dm2000.list" try: fptr = open(dmlist, "r") except IOError: print "ERROR: cannot open dmlist " + dmlist os.rmdir(workdir) sys.exit(1) else: # determine the dm index in the file that matches dm_idx = 0 lines = fptr.readlines() for line in lines: line = line.strip() if float(line) > dm: break
#!/usr/bin/env python # # Filename: trans_cand_server.py # # * listen on socket # * return plots as binary data over socket LISTEN_HOST = "hipsr7.hipsr.local" LISTEN_PORT = 55555 FILTERBANK_DIR = "/nfs/raid0/bpsr/perm" import Dada, Bpsr, threading, sys, time, socket, select, signal, traceback import time, numpy, math, os, fnmatch, tempfile, Gnuplot, datetime import trans_paths DM_LIST = trans_paths.getConfigDir() + '/dm2000.list' PIDFILE = "trans_cand_server.pid" LOGFILE = "trans_cand_server.log" QUITFILE = "trans_cand_server.quit" DL = 2 ########################################################################### def signal_handler(signal, frame): print 'You pressed Ctrl+C!' global quit_event quit_event.set() class SNRDMPlot(object):
#!/usr/bin/env python # # Filename: trans_cand_server.py # # * listen on socket # * return plots as binary data over socket LISTEN_HOST = "hipsr7.hipsr.local" LISTEN_PORT = 55555 FILTERBANK_DIR = "/nfs/raid0/bpsr/perm" import Dada, Bpsr, threading, sys, time, socket, select, signal, traceback import time, numpy, math, os, fnmatch, tempfile, Gnuplot, datetime import trans_paths DM_LIST = trans_paths.getConfigDir() + '/dm4000_tol1.2.list' PIDFILE = "trans_cand_server.pid" LOGFILE = "trans_cand_server.log" QUITFILE = "trans_cand_server.quit" DL = 2 ########################################################################### def signal_handler(signal, frame): print 'You pressed Ctrl+C!' global quit_event quit_event.set() class SNRDMPlot(object):