#!/usr/bin/env perl
#
# file to queue chipRuns for the MD08 exposures from April 1 - June 25 2009
# md08 fields
my @dates = qw(
2009-04-19
2009-04-20
2009-04-29
2009-04-30
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-02
2009-06-03
2009-06-04
2009-06-05
2009-06-11
2009-06-13
2009-06-14
2009-06-15
2009-06-16
2009-06-17
2009-06-18
2009-06-20
2009-06-22
2009-06-25
);

my $field = 'MD08';

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";
}
