def getQscanTable(opts,type): summary = readSummaryFiles() if "FG" in type: type_string = "foreground" elif "BG" in type: type_string = "background" if eval("opts.qscan_cache_" + type_string): qscanList = stfu_pipe.getParamsFromCache(eval("opts.qscan_cache_" + type_string),type) else: try: inputPath = eval("opts." + type_string + "_input_path") qscanList = parseDirectoryList(inputPath) except: print >> sys.stderr, "cannot get input path for " + type_string print >> sys.stderr, "specify at least one of the following options:" print >> sys.stderr, "--qscan-cache, --" + type_string + "-input-path" sys.exit(1) table = summary.parseQscanList(qscanList) # perform a sanity check if not (len(table['channel_name']) == len(table['qscan_dir'])): print >> sys.stderr, "the length of channel_name does not match the length of qscan_dir in the " + type_string + " table" print >> sys.stderr, "check for data corruption in the qscan summary files in the " + type_string + " table" sys.exit(1) return table
if opts.type: type = opts.type else: print >> sys.stderr, "Please specify the option --type= TYPE" sys.exit(1) if opts.ifo_times: ifo = opts.ifo_times else: ifo = None if opts.gps_string: time_string = opts.gps_string else: time_string = None if opts.qscan_cache_foreground: candidates_path = stfu_pipe.getParamsFromCache(opts.qscan_cache_foreground,type,ifo,time_string) else: print >> sys.stderr, "Please specify the option --qscan-cache= FILE" sys.exit(1) else: candidates_path = parseDirectoryList(opts.foreground_input_path) for candidate in candidates_path : outputdir = opts.output_path # extract the information about the candidate in the foreground table candidateSummary = readSummaryFiles() candidateTable = candidateSummary.extractFromTable(foregroundTable,candidate[2],candidate[3],candidate[0]) # extract the information about the foreground for this specific type and ifo