#!/bin/csh -f

if ($#argv != 2) then
  echo "USAGE: 00_chips.cmd (label) [commit]"
  exit 2
endif

set label = $1
if ("$2" == "commit") then
  set pretend = ""
else
  set pretend = "-pretend"
endif

set common_opts = ""
set common_opts = "$common_opts -dbname gpc1"
set common_opts = "$common_opts -definebyquery"
set common_opts = "$common_opts -set_label $label"
set common_opts = "$common_opts -set_data_group $label"
set common_opts = "$common_opts -set_end_stage warp"
set common_opts = "$common_opts -set_tess_id RINGS.V3"
set common_opts = "$common_opts -set_workdir neb://@HOST@.0/POLE/$label"
set common_opts = "$common_opts -simple -set_dist_group SAS"

# I initially used 2015.01.01, but the original PV3.LAP used a later date
# set common_opts = "$common_opts -dateobs_end 2015-01-01T00:00:00"

set common_opts = "$common_opts -set_reduction LAP_POLE"

# I put these in the label PV3.Pole.Reprocess.20180510.extra
# chiptool $pretend $common_opts -exp_name o5078g0145o 
# chiptool $pretend $common_opts -exp_name o5078g0156o 
# chiptool $pretend $common_opts -exp_name o4992g0280o 
# chiptool $pretend $common_opts -exp_name o4995g0257o 
# chiptool $pretend $common_opts -exp_name o4995g0275o 
# chiptool $pretend $common_opts -exp_name o4997g0277o 
# chiptool $pretend $common_opts -exp_name o4985g0060o 
# chiptool $pretend $common_opts -exp_name o4985g0066o 
# chiptool $pretend $common_opts -exp_name o4985g0046o 
# chiptool $pretend $common_opts -exp_name o5077g0226o 
# chiptool $pretend $common_opts -exp_name o5077g0243o 
# chiptool $pretend $common_opts -exp_name o5078g0232o 
# chiptool $pretend $common_opts -exp_name o5078g0249o 
# chiptool $pretend $common_opts -exp_name o5078g0224o 
# chiptool $pretend $common_opts -exp_name o5078g0241o 
# chiptool $pretend $common_opts -exp_name o5194g0570o 
# chiptool $pretend $common_opts -exp_name o5194g0583o 
# chiptool $pretend $common_opts -exp_name o4988g0361o 
# chiptool $pretend $common_opts -exp_name o4988g0378o 
# chiptool $pretend $common_opts -exp_name o5078g0160o 
# chiptool $pretend $common_opts -exp_name o5078g0149o 
# chiptool $pretend $common_opts -exp_name o4999g0273o 
# chiptool $pretend $common_opts -exp_name o4999g0286o 
# chiptool $pretend $common_opts -exp_name o5076g0278o 
# chiptool $pretend $common_opts -exp_name o5076g0295o 

# I put these in the label PV3.Pole.Reprocess.20180510
chiptool $pretend $common_opts -exp_name o7049g0085o 
chiptool $pretend $common_opts -exp_name o7049g0086o 
chiptool $pretend $common_opts -exp_name o7050g0081o 
chiptool $pretend $common_opts -exp_name o7050g0082o 
