IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24859


Ignore:
Timestamp:
Jul 20, 2009, 10:17:07 AM (17 years ago)
Author:
eugene
Message:

add rerun_from_first option and use ordered_by_date

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/ipp_apply_burntool.pl

    r24679 r24859  
    2020use Pod::Usage qw( pod2usage );
    2121
    22 my ( $class_id, $dateobs_begin, $dateobs_end, $skip_burned, $dbname, $logfile, $verbose, $save_temps);
     22my ( $class_id, $dateobs_begin, $dateobs_end, $skip_burned, $rerun_from_first, $dbname, $logfile, $verbose, $save_temps);
    2323GetOptions(
    2424    'class_id=s'        => \$class_id, # chip identifier
     
    2828    'logfile=s'         => \$logfile,
    2929    'skip_burned'       => \$skip_burned,   # Print to stdout
     30    'rerun_from_first'  => \$rerun_from_first,   # Print to stdout
    3031    'verbose'           => \$verbose,   # Print to stdout
    3132    'save-temps'        => \$save_temps, # Save temporary files?
     
    4243    defined $dbname;
    4344
     45if ($skip_burned and $rerun_from_first) { &my_die("-rerun_from_first and -skip_burned are incompatible"); }
     46
    4447my $missing_tools;
    4548my $regtool  = can_run('regtool')  or (warn "Can't find regtool" and $missing_tools = 1);
     
    5861$command .= " -dateobs_begin $dateobs_begin";
    5962$command .= " -dateobs_end $dateobs_end";
    60 # $command .= " -limit 20";
     63$command .= " -ordered_by_date";
    6164$command .= " -dbname $dbname" if defined $dbname;
    6265
     
    101104if (! $skip_burned)  {
    102105    foreach my $file (@files) {
     106       
     107        # rerun_from_first treats the first image as already burned (if it is already burned)
     108        # the artifact table from the first file is used for the rest of the sequence.
     109        if ($rerun_from_first) {
     110            $skip_burned = 1;
     111            $rerun_from_first = 0;
     112            next;
     113        }
    103114        my $exp_id = $file->{exp_id};
    104115
     
    108119            &my_die("failed to update imfile");
    109120        }
     121        $file->{user_1} = 0.1;
    110122    }
    111123}
     
    122134        ($rawImfileReal) = $rawImfile =~ m|^neb:/(.*)|;
    123135    }
    124     # print "rawImfile: $rawImfile -> $rawImfileReal\n";
     136    print "rawImfile: $rawImfile -> $rawImfileReal\n";
    125137
    126138    # mangle name, create tmp file (always a UNIX file)
     
    149161    }
    150162
     163    print "$rawImfile : $skip_burned, $file->{user_1}\n";
     164
    151165    if (! ($skip_burned and ($file->{user_1} > 0.5))) {
     166        print "running on: $rawImfile\n";
    152167        # uncompress the image (do we need to check if it is compressed?)
    153168        my $status = vsystem ("$funpack -S $rawImfileReal > $tmpImfileReal", $REALRUN);
Note: See TracChangeset for help on using the changeset viewer.