diff --git a/ap/ap.py b/ap/ap.py index aadbd97..883946a 100644 --- a/ap/ap.py +++ b/ap/ap.py @@ -13,7 +13,6 @@ parser.add_argument("--beamline", default="alvra", help="beamline") parser.add_argument("--pgroup", default="p18674", help="pgroup") parser.add_argument("--detector", default="JF06T08V02", help="detector") parser.add_argument("--logbook", default=None, help="url to logbook") -parser.add_argument("--online_hits_threshold", default = 15, type=int, help="number of peaks to consider frame a hit") parser.add_argument("--dir_ap", default=None, help="path to ap code") args = parser.parse_args() @@ -21,7 +20,6 @@ args = parser.parse_args() beamline = args.beamline pgroup = args.pgroup detector = args.detector -online_hits_threshold = args.online_hits_threshold logbook_url = args.logbook dir_ap = args.dir_ap @@ -172,17 +170,17 @@ for run in range(1, last_run+1): all_lines = hits_file.read().splitlines() for line in all_lines: lp = line.split() - pulseid, frame_good, n_peaks_online, laser_on = lp[0], lp[1], lp[2], lp[3] + pulseid, frame_good, is_frame_hit, laser_on = lp[0], lp[1], lp[2], lp[4] pulseid = int(pulseid) if pulseid < start_pulse_id or pulseid > stop_pulse_id: continue + is_frame_hit = True if is_frame_hit == "True" else False laser_on = True if laser_on == "True" else False - n_peaks_online = int(n_peaks_online) if laser_on: all_light.append(pulseid) else: all_dark.append(pulseid) - if n_peaks_online >= online_hits_threshold: + if is_frame_hit: if laser_on: hits_light.append(pulseid) else: diff --git a/scripts/ap.sh b/scripts/ap.sh index edc3e2b..c0f0814 100755 --- a/scripts/ap.sh +++ b/scripts/ap.sh @@ -11,6 +11,14 @@ fi while true do + + if [ -e STOP ] + then + echo "STOP file present - exiting AP now" + echo "to run AP, remove STOP file with rm STOP" + exit + fi + echo "Running "`date` python ${DIR_AP}/ap/ap.py --pgroup ${PGROUP} --beamline ${BEAMLINE} --detector ${DETECTOR_NAME} --logbook ${LOGBOOK} --dir_ap ${DIR_AP} diff --git a/scripts/jobs_overview.sh b/scripts/jobs_overview.sh old mode 100644 new mode 100755 diff --git a/scripts/re-insert-spearsheet.base.sh b/scripts/re-insert-spearsheet.base.sh old mode 100644 new mode 100755