this_ft1_start = event_file_start + i * args.interval this_ft1_stop = event_file_start + (i + 1) * args.interval temp_ft1 = "__temp%s_ft1.fit" % i print "Intends to make ft1 cut beginning at %s, ending at %s (%sth cut)" % ( this_ft1_start, this_ft1_stop, i) # Pre-cut the FT1 file for speed cmd_line = "fcopy '%s[EVENTS][TIME >= %s && TIME =< %s]' '!%s'" % ( args.in_ft1, this_ft1_start - 1000.0, this_ft1_stop + 1000.0, temp_ft1) # execute cut execute_command(cmd_line) # cut ft1 out_ft1 = str(this_ft1_start) + '_ft1.fit' gtselect = GtApp('gtselect') gtselect['infile'] = temp_ft1 gtselect['outfile'] = out_ft1 gtselect['tmin'] = this_ft1_start gtselect['tmax'] = this_ft1_stop gtselect['evclass'] = args.evclass
for i in range(n_days_rounded): this_ft1_start = event_file_start + i * args.interval this_ft1_stop = event_file_start + (i + 1) * args.interval temp_ft1 = "__temp%s_ft1.fit" % i print "Intends to make ft1 cut beginning at %s, ending at %s (%sth cut)" % (this_ft1_start, this_ft1_stop, i) # Pre-cut the FT1 file for speed cmd_line = "fcopy '%s[EVENTS][TIME >= %s && TIME =< %s]' '!%s'" % (args.in_ft1, this_ft1_start - 1000.0, this_ft1_stop + 1000.0, temp_ft1) # execute cut execute_command(cmd_line) # cut ft1 out_ft1 = str(this_ft1_start) + '_ft1.fit' gtselect = GtApp('gtselect') gtselect['infile'] = temp_ft1 gtselect['outfile'] = out_ft1 gtselect['tmin'] = this_ft1_start gtselect['tmax'] = this_ft1_stop gtselect['evclass'] = args.evclass
# else using real data else: out_name = str(args.date) + '_detections.txt' cmd_line = "search_for_transients.py --date %s --irf %s --probability %s --min_dist %s " \ "--out_file %s" % (args.date, args.irf, args.probability, args.min_dist, out_name) try: # Do search print("\n\nAbout to execute command:") print(cmd_line) print('\n') execute_command(cmd_line) except: print("Cannot execute command: %s" % cmd_line) print("Maybe this will help:") print("\nContent of directory:\n") execute_command("ls") print("\nFree space on disk:\n") execute_command("df . -h") else: # Stage-out