#!/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 -obs_mode 3PI"
set common_opts = "$common_opts -obs_mode OSS"
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"

## set common_opts = "$common_opts -ra_min   0.0"
## set common_opts = "$common_opts -ra_max 362.0" ; # need to go beyond 360 to get all exposures.
## set common_opts = "$common_opts -decl_min 75.0"
## set common_opts = "$common_opts -decl_max 90.0"

## test set:
set common_opts = "$common_opts -ra_min 130.0"
set common_opts = "$common_opts -ra_max 190.0" ; # need to go beyond 360 to get all exposures.
set common_opts = "$common_opts -decl_min 86.0"
set common_opts = "$common_opts -decl_max 90.0"

set common_opts = "$common_opts -dateobs_begin 2010-01-01T00:00:00"
set common_opts = "$common_opts -dateobs_end 2015-02-28T00:00:00"

set common_opts = "$common_opts -set_reduction LAP_POLE"

## for test set, just run i-band:
#chiptool $pretend $common_opts -filter g.00000
#chiptool $pretend $common_opts -filter r.00000
 chiptool $pretend $common_opts -filter i.00000
#chiptool $pretend $common_opts -filter z.00000
#chiptool $pretend $common_opts -filter y.00000
