Skip to content

Conversation

@gadorlhiac
Copy link
Contributor

@gadorlhiac gadorlhiac commented Sep 20, 2025

Description

This PR logs terminal output when running makepeds to a file in the operator home directory. Separately it addresses the spellcheck errors/warnings.

Motivation and Context

This PR is motivated to aid in debugging. Occassional issues with makepeds can be hard to debug. While logs are usually created on the S3DF-side, they can be hard to find. In the worst cases, not even these logs are available. This PR logs the terminal output that the operator sees to a file on the PCDS side to make debugging later easier.

How Has This Been Tested?

Tested by making a small change (not in PR), so I don't have to mess with the operator environment.

diff --git a/scripts/makepeds b/scripts/makepeds
index e2c5d08..69a4e1c 100755
--- a/scripts/makepeds
+++ b/scripts/makepeds
@@ -1,6 +1,7 @@
 #! /bin/bash
 
-DIR=$(dirname "$(readlink -f "$0")")
+#DIR=$(dirname "$(readlink -f "$0")")
+DIR=$(readlink -f "/cds/group/pcds/engineering_tools/mfx/scripts")
 PATH=$PATH:$DIR
 
 usage()

Example for mfx101344825 run 102.

mfx-daq:scripts> ./makepeds -e mfx101344825 -r 102 --user dorlhiac
This is a LCLS-II experiment
calling on SDF system: makepeds_psana2 --experiment mfx101344825 --run 102
Output will be logged to /cds/home/opr/mfxopr/makepeds_logs/mfx101344825/run0102_20250919_180919_dorlhiac.log
ssh -Y dorlhiac@psana.sdf /sdf/group/lcls/ds/tools/engineering_tools/R3.13.9/scripts/makepeds_psana2 --experiment mfx101344825 --run 102
dorlhiac@psana.sdf's password: 
XXXXXXXXXXXXXXXXX START MAKEPEDS at 18:09:32 on sdfiana001 XXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is a LCLS-II experiment
Use XTC files from /sdf/data/lcls/ds/mfx/mfx101344825/xtc.
We will work from directory /sdf/data/lcls/ds/mfx/mfx101344825/results/calib_view/pedestal_workdir
Check for data files:
5
-r--r-----+ 1 psdatmgr ps-data    1307850 Sep 18 17:44 /sdf/data/lcls/ds/mfx/mfx101344825/xtc/mfx101344825-r0102-s003-c000.xtc2
-r--r-----+ 1 psdatmgr ps-data     588050 Sep 18 17:44 /sdf/data/lcls/ds/mfx/mfx101344825/xtc/mfx101344825-r0102-s002-c000.xtc2
-r--r-----+ 1 psdatmgr ps-data   27690952 Sep 18 17:44 /sdf/data/lcls/ds/mfx/mfx101344825/xtc/mfx101344825-r0102-s000-c000.xtc2
-r--r-----+ 1 psdatmgr ps-data 3244503308 Sep 18 17:44 /sdf/data/lcls/ds/mfx/mfx101344825/xtc/mfx101344825-r0102-s001-c000.xtc2
-r--r-----+ 1 psdatmgr ps-data 3244503308 Sep 18 17:44 /sdf/data/lcls/ds/mfx/mfx101344825/xtc/mfx101344825-r0102-s004-c000.xtc2
Check detectors:
# ....
xxxxxxxxxxxxxxxxx END MAKEPEDS at 18:10:36 after  63.63237 XXXXXXXXXXXXXXXXXXXXXXX
pedestal mfx101344825 102
{'pedestal': 'done'}

NOTE: Output log is printed to the terminal: /cds/home/opr/mfxopr/makepeds_logs/mfx101344825/run0102_20250919_180919_dorlhiac.log

And, check the output log:

mfx-daq:scripts> ll ~/makepeds_logs/
total 0
drwxrwsr-x 1 mfxopr mfxopr 0 Sep 19 18:09 mfx101344825
mfx-daq:scripts> ll ~/makepeds_logs/mfx101344825/
total 44
-rw-rw-r-- 1 mfxopr mfxopr 44879 Sep 19 18:10 run0102_20250919_180919_dorlhiac.log
mfx-daq:scripts> ll ~/makepeds_logs/mfx101344825/run0102_20250919_180919_dorlhiac.log 
-rw-rw-r-- 1 mfxopr mfxopr 44879 Sep 19 18:10 /cds/home/opr/mfxopr/makepeds_logs/mfx101344825/run0102_20250919_180919_dorlhiac.log
mfx-daq:scripts> cat ~/makepeds_logs/mfx101344825/run0102_20250919_180919_dorlhiac.log 
Warning: Permanently added the ECDSA host key for IP address '172.24.49.11' to the list of known hosts.
XXXXXXXXXXXXXXXXX START MAKEPEDS at 18:09:32 on sdfiana001 XXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is a LCLS-II experiment
Use XTC files from /sdf/data/lcls/ds/mfx/mfx101344825/xtc.
We will work from directory /sdf/data/lcls/ds/mfx/mfx101344825/results/calib_view/pedestal_workdir
Check for data files:
5
# ...
[I] det_dark_proc.py L0155 DONE, consumed time 18.581 sec
xxxxxxxxxxxxxxxxx END MAKEPEDS at 18:10:36 after  63.63237 XXXXXXXXXXXXXXXXXXXXXXX
mfx-daq:scripts> 

Where Has This Been Documented?

From calibman, see the constants deployed (see _id_ts - above was run around 18:10 matching the log etc.)
image

@gadorlhiac gadorlhiac marked this pull request as ready for review September 20, 2025 01:17
@gadorlhiac gadorlhiac requested a review from a team as a code owner September 20, 2025 01:17
@gadorlhiac
Copy link
Contributor Author

To reviewers: Let me know if you'd like tests on each hutch for good measure.

Copy link
Collaborator

@silkenelson silkenelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silkenelson silkenelson merged commit 069d28d into pcdshub:master Sep 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants