IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32438


Ignore:
Timestamp:
Sep 23, 2011, 3:13:34 PM (15 years ago)
Author:
watersc1
Message:

final version of this iteration on LAP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110622/ippScripts/scripts/lap_science.pl

    r32433 r32438  
    2727my ( $camera, $dbname);
    2828my ( $lap_id );
     29my ( $queue_list );
    2930my ( $chip_mode, $monitor_mode, $cleanup_mode);
    3031
     
    4445   
    4546    'lap_id=s'     => \$lap_id,
     47    'queue_list=s' => \$queue_list,
    4648
    4749    'chip_mode'    => \$chip_mode,
     
    261263        return($exposure);
    262264    }
     265
     266    if (($chip->{state} eq 'goto_cleaned')||
     267        ($warp->{state} eq 'goto_cleaned')||
     268        ($chip->{dsRun_state} eq 'goto_cleaned')) {
     269        $exposure->{data_state} = 'pending_update';
     270        &update_this_exposure($exposure);
     271        return($exposure);
     272    }
     273
    263274   
    264275    my $chiptool_update_cmd = "chiptool -setimfiletoupdate -chip_id $exposure->{chip_id} -set_label $label";
     
    621632            $have_diff ++;
    622633            $are_magicked ++;
     634            next;
     635        }
     636
     637        if ($exposure->{data_state} eq 'pending_update') {
     638            $exposure->{data_state} = 'update';
     639            $exposure = &remake_this_exposure_by_update($exposure);
     640            &update_this_exposure($exposure);
    623641            next;
    624642        }
     
    12021220sub cleanup_mode {
    12031221    my $lap_id = shift;
     1222
     1223    if (defined($queue_list)) {
     1224        my $successful = 1;
     1225        open(Q,$queue_list) or ($successful = 0);
     1226        if ($successful == 1) {
     1227            while(<Q>) {
     1228                chomp;
     1229                my $cmd = $_;
     1230                my ($projection_cell,$seq_id,$filter,$label);
     1231                $projection_cell = $cmd;
     1232                $projection_cell =~ s/.*?-projection_cell (skycell.\w+?) .*/$1/;
     1233                $seq_id = $cmd;
     1234                $seq_id =~ s/.*-seq_id (\d+?) .*/$1/;
     1235                $filter = $cmd;
     1236                $filter =~ s/.*-filter (\w\.00000) .*/$1/;
     1237                if ($filter =~ /\s+?/) {
     1238                    $filter =~ s/.*-filter (\w\.00000)$/$1/;
     1239                }
     1240                $label = $cmd;
     1241                $label =~ s/.*-label (.+?) .*/$1/;
     1242               
     1243                my $response;
     1244                chomp($response =
     1245                      `laptool -dbname gpc1 -listrun -projection_cell $projection_cell -seq_id $seq_id -filter $filter -label $label -simple`);
     1246                my $state = (split /\s+/, $response)[5];
     1247               
     1248                unless (defined($state)) {
     1249                    if ($verbose) {
     1250                        print "Queuing: $cmd\n";
     1251                    }
     1252                    system($cmd);
     1253                   
     1254                    my $i = 0;
     1255                    do {
     1256                        sleep(5);
     1257                        chomp($response =
     1258                              `laptool -dbname gpc1 -listrun -projection_cell $projection_cell -seq_id $seq_id -filter $filter -label $label -simple`);
     1259                        $state = (split /\s+/, $response)[5];
     1260                        $i++;
     1261                        unless(defined($state)) {
     1262                            $successful = 0;
     1263                        }
     1264                    } while (($state ne 'run')&&($i < 20)&&($successful));
     1265                    last;
     1266                }
     1267            }
     1268            close(Q);
     1269        }
     1270    }
     1271
    12041272    my $command = "$laptool -inactiveexp -lap_id $lap_id ";
    12051273    $command .= " -dbname $dbname " if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.