From 434c177ece897407735d512371e93d157e64c5b7 Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Sun, 10 Nov 2024 03:56:16 +0100 Subject: [PATCH 1/6] useful aliases for interactie work --- bin/lmtoy_functions2.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bin/lmtoy_functions2.sh diff --git a/bin/lmtoy_functions2.sh b/bin/lmtoy_functions2.sh new file mode 100644 index 0000000..1064fc4 --- /dev/null +++ b/bin/lmtoy_functions2.sh @@ -0,0 +1,15 @@ +# interactive helpers for those who need it + +lmtoy_version2="10-nov-2024" + +echo "LMTOY>> lmtoy_functions2 $lmtoy_version2 via $0" +echo "LMTOY>> useful aliases loaded:" +echo " lmtoy_run [projectID]" + +function lmtoy_run { + if [ -z $1 ]; then + (cd $WORK_LMT/lmtoy_run/; ls -d lmtoy_* | sed s/lmtoy_//g | pr -4 -t) + else + cd $WORK_LMT/lmtoy_run/lmtoy_$1 + fi +} From 8b5799b0eecab38fc5beee14a9f44d7e76503165 Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Sun, 10 Nov 2024 03:58:38 +0100 Subject: [PATCH 2/6] preserve wf.pdf --- bin/lmtoy_functions.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/lmtoy_functions.sh b/bin/lmtoy_functions.sh index 9174644..24db525 100755 --- a/bin/lmtoy_functions.sh +++ b/bin/lmtoy_functions.sh @@ -260,9 +260,10 @@ function lmtoy_rsr1 { # as well as process old data. Thus we want all 'bad_lagsC' in dreampyrc to be "" if [[ $first == 1 ]]; then # 1. - echo "LMTOY>> python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do -w rsr.wf0.pdf -p -b $blo $t1 $t2" - python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do -w rsr.wf0.pdf -p -b $blo $t1 $t2 > rsr_driver0.log 2>&1 + echo "LMTOY>> python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do $w -p -b $blo $t1 $t2" + python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do $w -p -b $blo $t1 $t2 > rsr_driver0.log 2>&1 mv rsr.driver.png rsr.driver0.png + mv rsr.wf.pdf rsr.wf0.pdf # 2. echo "LMTOY>> rsr_tsys.py -y rsr.tsys0.png $obsnum" rsr_tsys.py -y rsr.tsys0.png $obsnum > rsr_tsys0.log 2>&1 @@ -297,10 +298,9 @@ function lmtoy_rsr1 { badlags=rsr.$obsnum.badlags # this gives 'BADCB1' - # 4. - echo "LMTOY>> python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do -w rsr.wf.pdf -p -b $blo $t1 $t2 --badlags $badlags" - python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do -w rsr.wf.pdf -p -b $blo $t1 $t2 --badlags $badlags > rsr_driver1.log 2>&1 - + # 4. redo rsr_driver but now with badlags applied + echo "LMTOY>> python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do $w -p -b $blo $t1 $t2 --badlags $badlags" + python $LMTOY/RSR_driver/rsr_driver.py rsr.obsnum $o $do $w -p -b $blo $t1 $t2 --badlags $badlags > rsr_driver1.log 2>&1 # Tsys plot: rsr.tsys.png - only done for single obsnum - also lists BADCB's # rsr.spectra.png - another way to view each chassis spectrum From 78346ad459918694ed214a09edb6f45ceaa4a437 Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Sun, 10 Nov 2024 03:59:07 +0100 Subject: [PATCH 3/6] reminder how to sbatch --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 1b34b0e..87a6cb7 100644 --- a/Makefile +++ b/Makefile @@ -353,6 +353,7 @@ bench: bench1 bench2 bench3 ## bench1: RSR benchmark: obsnum=33551 bench1: + @echo sbatch_lmtoy.sh etc/bench1.run $(TIME) SLpipeline.sh obsnum=33551 restart=1 linecheck=1 public=2020-12-31 qagrade=3 admit=$(ADMIT) meta=$(META) @bash -c 'source lmtoy_functions.sh ; printf_green_file etc/bench1.txt' @echo "=================================================================================================================" @@ -368,6 +369,7 @@ bench1b: ## bench2: SEQ benchmark: obsnum=79448 bench2: + @echo sbatch_lmtoy.sh etc/bench2.run $(TIME) SLpipeline.sh obsnum=79448 restart=1 map_coord_use=1 public=2020-12-31 qagrade=3 maskmoment=$(ADMIT) admit=$(ADMIT) meta=$(META) @bash -c 'source lmtoy_functions.sh ; printf_green_file etc/bench2.txt' @echo "========================================================================================" @@ -379,6 +381,7 @@ bench2a: ## bench3: SEQ dual IF benchmark (about 1.5 min) bench3: + @echo sbatch_lmtoy.sh etc/bench3.run $(TIME) SLpipeline.sh obsnum=110399 restart=1 extent=120 maskmoment=$(ADMIT) public=2020-12-31 qagrade=3 admit=$(ADMIT) meta=$(META) @bash -c 'source lmtoy_functions.sh ; printf_green_file etc/bench3.txt' @echo "========================================================================================" From b935301ba958f8ce961240ab2736206e755b5c3a Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Sun, 10 Nov 2024 04:23:29 +0100 Subject: [PATCH 4/6] add run as well --- bin/lmtoy_functions2.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/lmtoy_functions2.sh b/bin/lmtoy_functions2.sh index 1064fc4..99e4b3c 100644 --- a/bin/lmtoy_functions2.sh +++ b/bin/lmtoy_functions2.sh @@ -5,6 +5,7 @@ lmtoy_version2="10-nov-2024" echo "LMTOY>> lmtoy_functions2 $lmtoy_version2 via $0" echo "LMTOY>> useful aliases loaded:" echo " lmtoy_run [projectID]" +echo " run [projectID]" function lmtoy_run { if [ -z $1 ]; then @@ -13,3 +14,11 @@ function lmtoy_run { cd $WORK_LMT/lmtoy_run/lmtoy_$1 fi } + +function run { + if [ -z $1 ]; then + (cd $WORK_LMT/lmtoy_run/; ls -d lmtoy_* | sed s/lmtoy_//g | pr -4 -t) + else + cd $WORK_LMT/lmtoy_run/lmtoy_$1 + fi +} From 80848a9bbfdc447273b614a94a76d06c645a7eb6 Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Sun, 10 Nov 2024 04:26:45 +0100 Subject: [PATCH 5/6] add PID search option --- bin/source_obsnum.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/bin/source_obsnum.sh b/bin/source_obsnum.sh index 0d4ff6b..cbc3dab 100755 --- a/bin/source_obsnum.sh +++ b/bin/source_obsnum.sh @@ -3,9 +3,13 @@ # find which source/obsnum combinations are in an LMT project # +_version="10-nov-2024" + usage() { - echo "Usage: $0 [options] ProjectId" + echo "Usage: $0 [options] [ProjectId]" + echo "Version: $_version" echo " Makes a list of obsnums, sorted per source, for a given ProjectId, ready for the script generator" + echo " If no ProjectId given and inside an lmtoy_run directory with the PID file, it will use that PID" echo " Options:" echo " -l report LineCheck instead of Science intent. Useful for RSR only" echo " -p report Pointing instead of Science intent." @@ -27,8 +31,13 @@ mk_trailer() { } if [ -z "$1" ]; then - usage - exit 0 + if [ -e PID ]; then + source PID + pid=$PID + else + usage + exit 0 + fi fi intent="Science" @@ -47,6 +56,17 @@ fi pid=$1 +if [ -z $pid]; then + if [ -e PID ]; then + source PID + pid=$PID + else + usage + exit 0 + fi +fi + + dat=$DATA_LMT/data_lmt.log log=$WORK_LMT/tmp/$pid.obsnums.log g=1 From f2b7efa28f5641d2eb34ece82f765a7a5c84120b Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Tue, 12 Nov 2024 06:59:09 +0100 Subject: [PATCH 6/6] rename since lmtoy_run is used --- bin/lmtoy_functions2.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/bin/lmtoy_functions2.sh b/bin/lmtoy_functions2.sh index 99e4b3c..b8e0d98 100644 --- a/bin/lmtoy_functions2.sh +++ b/bin/lmtoy_functions2.sh @@ -1,21 +1,13 @@ # interactive helpers for those who need it -lmtoy_version2="10-nov-2024" +lmtoy_version2="12-nov-2024" echo "LMTOY>> lmtoy_functions2 $lmtoy_version2 via $0" echo "LMTOY>> useful aliases loaded:" -echo " lmtoy_run [projectID]" -echo " run [projectID]" +echo " cdrun [projectID] -- cd to where an lmtoy_PID is" -function lmtoy_run { - if [ -z $1 ]; then - (cd $WORK_LMT/lmtoy_run/; ls -d lmtoy_* | sed s/lmtoy_//g | pr -4 -t) - else - cd $WORK_LMT/lmtoy_run/lmtoy_$1 - fi -} -function run { +function cdrun { if [ -z $1 ]; then (cd $WORK_LMT/lmtoy_run/; ls -d lmtoy_* | sed s/lmtoy_//g | pr -4 -t) else