Skip to content

Commit

Permalink
add obsnum range reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Nov 22, 2024
1 parent 2245b05 commit 9370fd1
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions lmtoy/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
import sys

_version = "3-nov-2024"
_version = "19-nov-2024"

def pix_list(pl):
""" convert a strong like "-0,-1" to proper pixlist by removing
Expand Down Expand Up @@ -146,6 +146,9 @@ def mk_runs(project, on, pars1, pars2, pars3=None, argv=None):
pars1,2,3 - SLpipeline parameters for this tier-1,2,3 run (called a,b,c)
argv - optional for CLI
"""
io = "TBD"
o_min = -1
o_max = -1

if argv != None:
if len(argv) > 1:
Expand All @@ -157,6 +160,7 @@ def mk_runs(project, on, pars1, pars2, pars3=None, argv=None):
print(" -c produce a config/obsnum list [takes time]")
print(" -b show all failed obsnums")
print(" -B show all failed obsnums and add the word QAFAIL for comments.txt")
print(" -io TBD")
sys.exit(0)
elif argv[1] == '-o':
for s in on.keys():
Expand Down Expand Up @@ -234,12 +238,12 @@ def mk_runs(project, on, pars1, pars2, pars3=None, argv=None):
o = abs(o1)
os = repr(o)
if s in pars1:
cmd1[0] = "SLpipeline.sh obsnum=%d _s=%s %s restart=1 " % (o,s,pars1[s])
cmd1[0] = "SLpipeline.sh obsnum=%d _io=%s _s=%s %s restart=1 " % (o,io,s,pars1[s])
if s in pars2:
cmd1[1] = "SLpipeline.sh obsnum=%d _s=%s %s %s" % (o,s,pars2[s], getargs(os,pars4))
cmd1[1] = "SLpipeline.sh obsnum=%d _io=%s _s=%s %s %s" % (o,io,s,pars2[s], getargs(os,pars4))
if pars3 != None and s in pars3:
cmd1[2] = "SLpipeline.sh obsnum=%d _s=%s %s %s" % (o,s, pars3[s], getargs(os,pars5))
cmd1[3] = "SLpipeline.sh obsnum=%d _s=%s archive=1" % (o,s)
cmd1[2] = "SLpipeline.sh obsnum=%d _io=%s _s=%s %s %s" % (o,io,s, pars3[s], getargs(os,pars5))
cmd1[3] = "SLpipeline.sh obsnum=%d _io=%s _s=%s archive=1" % (o,io,s)
for i in range(4):
if len(cmd1[i]) > 0: fp1[i].write("%s\n" % cmd1[i])
n1 = n1 + 1
Expand All @@ -266,12 +270,12 @@ def mk_runs(project, on, pars1, pars2, pars3=None, argv=None):
cmd2 = ["" for i in range(4)]

if s in pars1:
cmd2[0] = "SLpipeline.sh _s=%s admit=0 restart=1 obsnums=%s" % (s, obsnums)
cmd2[0] = "SLpipeline.sh _io=%s _s=%s admit=0 restart=1 obsnums=%s" % (io, s, obsnums)
if s in pars2:
cmd2[1] = "SLpipeline.sh _s=%s admit=1 srdp=1 obsnums=%s %s" % (s, obsnums, getargs(o_o,pars4))
cmd2[1] = "SLpipeline.sh _io=%s _s=%s admit=1 srdp=1 obsnums=%s %s" % (io, s, obsnums, getargs(o_o,pars4))
if pars3 != None and s in pars3:
cmd2[2] = "SLpipeline.sh _s=%s admit=1 srdp=1 obsnums=%s %s" % (s, obsnums, getargs(o_o,pars5))
cmd2[3] = "SLpipeline.sh obsnums=%s _s=%s archive=1" % (obsnums,s)
cmd2[2] = "SLpipeline.sh _io=%s _s=%s admit=1 srdp=1 obsnums=%s %s" % (io, s, obsnums, getargs(o_o,pars5))
cmd2[3] = "SLpipeline.sh obsnums=%s _io=%s _s=%s archive=1" % (obsnums,io,s)
for i in range(4):
if len(cmd2[i]) > 0: fp2[i].write("%s\n" % cmd2[i])
n2 = n2 + 1
Expand All @@ -284,4 +288,10 @@ def mk_runs(project, on, pars1, pars2, pars3=None, argv=None):
print(run1c)
print(run2c)
print("Where there are %d single obsnum runs, and %d combination obsnums" % (n1,n2))
obsnums=[]
for s in on.keys():
for o1 in on[s]:
obsnums.append(abs(o1))
obsnums.sort()
print("First and last obsnum are %d and %d" % (obsnums[0], obsnums[-1]))
print("Also note the archiving runs (run1x and run2x) when QA is done")

0 comments on commit 9370fd1

Please sign in to comment.