(file) Return to doleakage CVS log (file) (dir) Up to [Development] / JSOC / proj / globalhs / scripts

File: [Development] / JSOC / proj / globalhs / scripts / doleakage (download)
Revision: 1.4, Wed Feb 8 01:11:54 2017 UTC (20 months, 1 week ago) by tplarson
Branch: MAIN
CVS Tags: Ver_9-1, Ver_9-0
Changes since 1.3: +3 -8 lines
update tag handling

#!/bin/tcsh -f

setenv JSOCROOT /home/jsoc/cvs/Development/JSOC
setenv PATH     $JSOCROOT/bin/$JSOC_MACHINE':'$JSOCROOT/proj/globalhs/scripts':'$PATH
setenv IDL_PATH $JSOCROOT/proj/globalhs/scripts/idl:/home/jsoc/idl:'<IDL_DEFAULT>'

@ i = 1
while ($i <= $#argv )
  set $argv[$i]
@ i++
end

if (! $?label) then
  echo must specify parameter label
  exit 1
endif
setenv GLOBALHS_LABEL $label

echo `date` on $HOST
echo $PWD
echo $0 $argv

if (! $?deltal) set deltal = 6
if (! $?deltam) set deltam = 15
if (! $?xoffset) set xoffset = 0.0
if (! $?yoffset) set yoffset = 0.0
if (! $?pangle) set pangle = 0.0
if (! $?bangle) set bangle = 0.0
if (! $?obsdist) set obsdist = 1.000
if (! $?ndt) set ndt = 0
if (! $?tag) set tag = 'x'$xoffset'_y'$yoffset'_p'$pangle'_b'$bangle'_d'$obsdist
if (! $?seglist) set seglist = vradsum,vhorsum
set seglist = ( `echo $seglist | sed s/,/" "/g` )

if (! $?firststep) set firststep = ylms
if (! $?laststep) set laststep = leaks

if ($?v2tnjobs) then
  setenv GLOBALHS_V2TNJOBS $v2tnjobs
endif

if ($?ylmjobthreshold) then
  setenv GLOBALHS_YLMJOBTHRESHOLD $ylmjobthreshold
endif
if ($?v2tjobthreshold) then
  setenv GLOBALHS_V2TJOBTHRESHOLD $v2tjobthreshold
endif

if ($?ylmqueue) then
  setenv GLOBALHS_YLMQUEUE $ylmqueue
endif
if ($?v2tqueue) then
  setenv GLOBALHS_V2TQUEUE $v2tqueue
endif

if (! $?topdir) set topdir = /tmp28

set workdir = /$topdir/$USER/globalhs_work/$label/$tag
mkdir -p $workdir
cd $workdir

cp $JSOCROOT/proj/globalhs/scripts/parmtemplates/ylm.parms.$label ylm.parms.blank
set file = `cat ylm.parms.blank | grep -v "^[[:space:]]*#" | grep MODELIST= | cut -d= -f2`
cp $JSOCROOT/proj/globalhs/scripts/parmtemplates/$file .
set nim=`cat $file | wc -l`

set tstart = `cat ylm.parms.blank | grep -v "^[[:space:]]*#" | grep TSTART= | cut -d= -f2`
if ($#tstart == 0) then
@ line = `mkylms -H | grep -n "TSTART (time)" | cut -d: -f1` + 1
  set tstart = `mkylms -H | sed -n $line'p' | awk '{print $3}'`
endif
set startsecs = `time_convert o=jsoc time=$tstart`

goto $firststep

ylms:
domkylms xoffset=$xoffset yoffset=$yoffset pangle=$pangle bangle=$bangle obsdist=$obsdist ndt=$ndt >& ylmlog
if ($?) then
  echo failure to make ylms
  exit 1
endif

set out = `cat ylm.parms.blank | grep -v "^[[:space:]]*#" | grep out= | cut -d= -f2`
set epoch = `show_info -j $out | grep -i '^keyword:t_rec_epoch' | cut -d, -f5`
set epochsecs = `time_convert o=jsoc time=$epoch`
set trecstep = `show_info -j $out | grep -i '^keyword:t_rec_step' | cut -d, -f5`
set firstindex = `echo "($startsecs - $epochsecs)/$trecstep" | bc`

show_info $out"[#$firstindex/$nim][][][$xoffset][$yoffset][$pangle][$bangle][$obsdist][$file]" -APiR DRMS_RETENTION=1000 >& ylmout.tmp
if (`grep -c "/SUM.*/v.*\.fits" ylmout.tmp` != $nim) then
  echo failure of mkylms: some outputs missing
  exit 1
endif
rm suby.* ylm.parms.[0-9]* ylm.log.* mkylms.exitstatus.*
if ($laststep == ylms) goto end

ysht:
foreach segment ($seglist)
  mkdir -p $workdir/$segment
  cd $workdir/$segment
  cat $JSOCROOT/proj/globalhs/scripts/parmtemplates/v2t.parms.$label | sed s/XXXX/$xoffset/g | sed s/YYYY/$yoffset/g | sed s/PPPP/$pangle/g | sed s/BBBB/$bangle/g | sed s/DDDD/$obsdist/g > v2t.parms.blank

  doylmsht deltal=$deltal tag=$tag segment=$segment >& shtlog
  if ($?) then
    echo failure of sht of ylms for segment $segment
    exit 1
  endif

  set out = `cat v2t.parms.blank | grep -v "^[[:space:]]*#" | grep out= | cut -d= -f2`
  set epoch = `show_info -j $out | grep -i '^keyword:t_start_epoch' | cut -d, -f5`
  set epochsecs = `time_convert o=jsoc time=$epoch`
  set tstartstep = `show_info -j $out | grep -i '^keyword:t_start_step' | cut -d, -f5`
  set firstindex = `echo "($startsecs - $epochsecs)/$tstartstep" | bc`

  set tstep = `show_info -j $out | grep -i '^keyword:t_step' | cut -d, -f5`
  set tchunk = `cat v2t.parms.blank | grep -v "^[[:space:]]*#" | grep TCHUNK= | cut -d= -f2`
  set chunksecs = `durcon $tchunk`
  set chunkpts = `echo "$chunksecs/$tstep" | bc`
  @ nchunks = ( ( $nim - 1 ) / $chunkpts ) + 1
  set tag2 = $tag'_'$segment

  show_info $out"[#$firstindex/$nchunks][TAG = $tag2]" -APiR DRMS_RETENTION=1000 >& shtout.tmp
  if (`grep -c "/SUM.*/data\.fits" shtout.tmp` != $nchunks) then
    echo failure of sht: some outputs missing
    exit 1
  endif
  rm subt.* v2t.parms.[0-9]* v2t.log.* jv2ts.exitstatus.*
end
if ($laststep == ysht) goto end

leaks:
foreach segment ($seglist)
  cd $workdir/$segment
  domkleak deltal=$deltal deltam=$deltam tag=$tag segment=$segment >& mkleaklog
  if ($?) then
    echo failure to make leaks
    exit 1
  endif
end

end:
echo successful completion
exit 0

Karen Tian
Powered by
ViewCVS 0.9.4