diff --git a/bin/read_sos.py b/bin/read_sos.py old mode 100644 new mode 100755 diff --git a/bin/sos_apocommand b/bin/sos_apocommand index 904bb944..c1301c4a 100755 --- a/bin/sos_apocommand +++ b/bin/sos_apocommand @@ -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 @@ -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 ;; diff --git a/bin/sos_aporedo b/bin/sos_aporedo index efba7f62..b61bfa2c 100755 --- a/bin/sos_aporedo +++ b/bin/sos_aporedo @@ -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 ;; diff --git a/bin/sos_filesequencer b/bin/sos_filesequencer index ea3389b6..f26af7b7 100755 --- a/bin/sos_filesequencer +++ b/bin/sos_filesequencer @@ -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" + @@ -69,7 +69,7 @@ class Config: "sosdir: " + self.sosdir + "\n" + "mjd: " + self.mjd + "\n" + "fps: " + self.fps + "\n" + - "nocal: " + self.nocal); + "nocal: " + self.nocal); @@ -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 @@ -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": diff --git a/pro/spec2d/prerun_readplugmap.pro b/pro/spec2d/prerun_readplugmap.pro index cd986b51..4702b7cb 100644 --- a/pro/spec2d/prerun_readplugmap.pro +++ b/pro/spec2d/prerun_readplugmap.pro @@ -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 diff --git a/pro/spec2d/readplugmap.pro b/pro/spec2d/readplugmap.pro index a2665608..2c87c489 100644 --- a/pro/spec2d/readplugmap.pro +++ b/pro/spec2d/readplugmap.pro @@ -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 @@ -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 @@ -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 @@ -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'