Skip to content

Commit

Permalink
SOS Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean-Morrison committed Apr 13, 2022
1 parent 1120698 commit 09048b3
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
Empty file modified bin/read_sos.py
100644 → 100755
Empty file.
7 changes: 4 additions & 3 deletions bin/sos_apocommand
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ function usage
echo " -m MJD"
echo " "
echo " -d Dry run."
echo " -e FPS mode"
echo " -e FPS mode"
echo " -a no cal mode"
echo " "
echo "All parameters except -d and -e are required, FPS mode is set by default."
echo "All parameters except -d, -a, and -e are required, FPS mode is set by default."
echo "Normally $execName will be called by sos_runnerd."
) >&2
exit 1
Expand Down Expand Up @@ -127,7 +128,7 @@ plugDir=""
MJD=""
SOSDir=""

while getopts "f:i:p:l:s:m:a:de" argname; do
while getopts "f:i:p:l:s:m:ade" argname; do
case $argname in
f) fitsName=$OPTARG ;;
i) inDir=$OPTARG ;;
Expand Down
2 changes: 1 addition & 1 deletion bin/sos_aporedo
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ go=false
FPSmod="T"
nocal="F"

while getopts "wthrdfm:z:n:g" argname; do
while getopts "wthrdfm:z:ng" argname; do
case $argname in
w) doWait=true ;;
# X) svnMode=""; svnCheck=true ;;
Expand Down
10 changes: 5 additions & 5 deletions bin/sos_filesequencer
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Config:
self.sosdir = ""
self.mjd = ""
self.fps = "T"
self.nocal = "F"
self.nocal = "F"

def __str__(self):
return ("fitname: " + self.fitname + "\n" +
Expand All @@ -69,7 +69,7 @@ class Config:
"sosdir: " + self.sosdir + "\n" +
"mjd: " + self.mjd + "\n" +
"fps: " + self.fps + "\n" +
"nocal: " + self.nocal);
"nocal: " + self.nocal);



Expand Down Expand Up @@ -110,8 +110,8 @@ def parseCmdLine(args):
cfg.mjd = value
if opt == "-e":
cfg.fps = value
if opt == "-a":
cfg.nocal = value
if opt == "-a":
cfg.nocal = value
print("Config values: \n" + str(cfg))

return cfg
Expand Down Expand Up @@ -171,7 +171,7 @@ def processFile(cfg, flavor=""):
cmd += " -p " + cfg.plugname
cmd += " -l " + cfg.plugpath
cmd += " -s " + cfg.sosdir
cmd += " -m " + cfg.mjd
cmd += " -m " + cfg.mjd
if cfg.fps == "T":
cmd += " -e "
if cfg.nocal == "T":
Expand Down
1 change: 0 additions & 1 deletion pro/spec2d/prerun_readplugmap.pro
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ function prerun_readplugmap, plugfile, outfile, plugdir=plugdir, apotags=apotags
endif else begin
PMobjName='FIBERMAP'
maptype='confSummary'
print,plugfile, plugdir
if keyword_set(plugdir) then begin
thisfile = (findfile(djs_filepath(plugfile, root_dir=plugdir, subdir='*'), count=ct))[0]
endif else begin
Expand Down
17 changes: 10 additions & 7 deletions pro/spec2d/readplugmap.pro
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ end

;------------------------------------------------------------------------------

function get_parent_plugfile, pf, cloned_from, plugdir
function get_parent_plugfile, pf, cloned_from, plugdir=plugdir
;plugdir = file_dirname(file_dirname(pf),/MARK_DIRECTORY)
if plugdir eq './' then begin
if not keyword_set(plugdir) then begin
thisplug = FILE_DIRNAME(FILE_DIRNAME(pf))
confile = (findfile(filepath('confSummaryF-'+strtrim(cloned_from,2)+'.par',$
root_dir='./'), count=ct))[0]
root_dir=thisplug, subdir='*'), count=ct))[0]
if (ct ne 0) then ppf = 'confSummaryF-'+strtrim(cloned_from,2)+'.par' $
else ppf = 'confSummary-'+strtrim(cloned_from,2)+'.par'
pfp = ppf
Expand Down Expand Up @@ -162,9 +163,9 @@ function readplugmap, plugfile, spectrographid, plugdir=plugdir, savdir=savdir,
hdr = ['cut']
plugmap = []
fibermask = [-100]
plugdir_raw = plugdir
if keyword_set(plugdir) then plugdir_raw = plugdir
foreach pf, plugfile do begin
plugdir = plugdir_raw
if keyword_set(plugdir_raw) then plugdir = plugdir_raw
if keyword_set(plugdir) then $
yanny_read, (findfile(djs_filepath(pf, root_dir=plugdir, subdir='*'), count=ct))[0], junk, hdr=filehdr, /anonymous $
else yanny_read, pf, junk, hdr=filehdr, /anonymous
Expand All @@ -176,7 +177,7 @@ function readplugmap, plugfile, spectrographid, plugdir=plugdir, savdir=savdir,
cloned_to_conf = yanny_par(filehdr, 'configuration_id')
cloned_to_design = yanny_par(filehdr, 'design_id')
if (( cloned_from_conf NE '-999') AND (cnt NE 0)) then begin
ppf = get_parent_plugfile(pf,cloned_from_conf,plugdir)
ppf = get_parent_plugfile(pf,cloned_from_conf,plugdir=plugdir)
endif else ppf = pf
endelse

Expand Down Expand Up @@ -217,7 +218,9 @@ function readplugmap, plugfile, spectrographid, plugdir=plugdir, savdir=savdir,
'configuration_id '+string(cloned_to_conf)
hdr1[where(strmatch(hdr1, '*design_id*',/FOLD_CASE) EQ 1)] = $
'design_id '+strtrim(cloned_to_design,2)
hdr1=[hdr1,'cloned_from '+strtrim(cloned_from_conf,2)]
hdr1[where(strmatch(hdr1, '*cloned_from*',/FOLD_CASE) EQ 1)] = $
'cloned_from '+strtrim(cloned_from_conf,2)
; hdr1=[hdr1,'cloned_from '+strtrim(cloned_from_conf,2)]
endif
hdrf = yanny_to_fits_hdr(hdr1)
sxaddpar, hdrf, 'EXTNAME', file_basename(pf), ' Complete Plugmap/confSummary'
Expand Down

0 comments on commit 09048b3

Please sign in to comment.