#!/usr/bin/env perl
#
# file to queue chipRuns for the MD07 exposures from April 1 - June 25 2009
# md07 fields
my @dates = qw(
 2009-04-19     
 2009-04-26     
 2009-04-29     
 2009-05-01     
 2009-05-02     
 2009-05-05     
 2009-05-06     
 2009-05-10     
 2009-05-22     
 2009-05-28     
 2009-05-31     
 2009-06-01     
 2009-06-02     
 2009-06-03     
 2009-06-04     
 2009-06-05     
 2009-06-07     
 2009-06-08     
 2009-06-09     
 2009-06-11     
 2009-06-12     
 2009-06-13     
 2009-06-14     
 2009-06-16     
 2009-06-17     
 2009-06-18     
 2009-06-20     
 2009-06-22     
 2009-06-25     
);

my $field = 'MD07';

foreach my $date (@dates) {

    my $tag = $date;
    $tag =~ s/\-//g;

    my $block = substr($date, 0, 7);
    $block =~ s/\-//g;
    $label = "$field.$block.v0";

    my $command = "chiptool -pretend -dbname gpc1 -definebyquery -set_label $label -dateobs_begin ${date}T00:00:00 -dateobs_end ${date}T23:59:59 -comment \'$field%\' -set_workdir neb://\@HOST\@.0/gpc1/$tag.stdsci.v0 -set_end_stage warp -set_tess_id $field -set_reduction STDSCIENCE_V0";

    print "$command\n";
}

