IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 30, 2010, 9:31:50 AM (16 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/automate_stacks.pl

    r28439 r28794  
    2121my $stacktool= can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1);
    2222my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1);
     23my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1);
    2324my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
    2425my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
     
    4041# Grab options
    4142my ( $date, $camera, $dbname, $logfile, $verbose, $manual);
    42 my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only, $check_mode);
     43my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only, $this_mode_only, $check_mode);
    4344my ( $check_registration, $define_burntool, $queue_burntool, $check_chips, $queue_chips);
    4445my ( $check_stacks, $queue_stacks, $check_diffs, $queue_diffs, $clean_old);
     
    5960    'this_target_only=s'   => \$this_target_only,
    6061    'this_filter_only=s'   => \$this_filter_only,
     62    'this_mode_only=s'     => \$this_mode_only,
    6163    'check_registration'   => \$check_registration,
    6264    'define_burntool'      => \$define_burntool,
     
    8688           --this_target_only     Process only a single target.
    8789           --this_filter_only     Process only a single filter.
     90           --this_mode_only       Process only a single clean mode.
    8891        Modes:
    8992           --check_registration   Confirm the data downloaded correctly.
     
    129132my %detfilter_list = ();
    130133my %detmax_list = ();
     134my @mode_list = ();
    131135my %clean_commands = ();
    132136my %clean_retention = ();
     
    151155            if (${ $mentry }{name} eq 'MODE') {
    152156                $this_mode = ${ $mentry }{value};
     157                push @mode_list, $this_mode;
    153158            }
    154159            elsif (${ $mentry }{name} eq 'COMMAND') {
     
    263268    }
    264269    die("$this_filter_only is invalid.") if ($#filter_list != 0);
     270}
     271
     272if (defined($this_mode_only)) {
     273    foreach my $t (@mode_list) {
     274        if ($t eq $this_mode_only) {
     275            @mode_list = ($this_mode_only);
     276            last;
     277        }
     278    }
     279    die("$this_mode_only is invalid.") if ($#mode_list != 0);
    265280}
    266281
     
    717732    my $date = shift;
    718733
    719     my $command = construct_dqstatstool_cmd($date);
     734    my $command = construct_dqstats_cmd($date);
    720735    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    721736        run ( command => $command, verbose => $verbose );
     
    754769   
    755770    my $select = "-select_dateobs_begin ${date}T00:00:00 -select_dateobs_end ${date}T23:59:59 ";
     771    my $use_limits = " -use_begin ${date}T00:00:00 -use_end ${date}T23:59:59 ";
    756772    $date =~ s/-//g;
    757773
     
    766782    $cmd .= " -workdir $workdir ";
    767783    $cmd .= " -label $label ";
     784    $cmd .= " $use_limits ";
    768785    if ($maxN > 0) {
    769786        $cmd .= " -random_subset -random_limit $maxN ";
     
    839856    }
    840857    if (($metadata_out{nsState} eq 'CHECKDETRENDS') && ($exposures > 0)) {
    841         $metadata_out{nsState} eq 'QUEUE_DETRENDS';
     858        $metadata_out{nsState} eq 'QUEUEDETRENDS';
    842859    }
    843860}
     
    10211038    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($cleaning_date,$target);
    10221039    my $args = $command;
    1023     if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode})) {
     1040    if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) {
    10241041        $args .= " -dbname $dbname -updaterun -set_state goto_cleaned -full -set_label goto_cleaned -time_stamp_end $cleaning_date ";
     1042    }
     1043    elsif ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'B')) {
     1044        $args .= " -dbname $dbname -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label $label ";
    10251045    }
    10261046    else {
     
    10371057    my $pretend = shift;
    10381058
    1039     foreach my $mode (sort (keys (%clean_commands))) {
    1040         if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode})) {
     1059    foreach my $mode (@mode_list) {
     1060        if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) {
    10411061            my ($cleaning_date,$command) = construct_cleantool_args($date,"",$mode);
    10421062            if ($cleaning_date eq 'no clean') {
     
    10501070                unless ($success) {
    10511071                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    1052                     &my_die("Unable to perform stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     1072                    &my_die("Unable to perform cleantool ($command): $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
    10531073                }
    10541074            }
     
    10701090                    unless ($success) {
    10711091                        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    1072                         &my_die("Unable to perform stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     1092                        &my_die("Unable to perform cleantool ($command): $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
    10731093                    }
    10741094                }
Note: See TracChangeset for help on using the changeset viewer.