IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2008, 10:17:34 AM (17 years ago)
Author:
bills
Message:

Rework the diff stage to process the skycells from an exposure in a single
diffRun

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/diff_skycell.pl

    r20928 r20973  
    2727use Pod::Usage qw( pod2usage );
    2828
    29 my ($diff_id, $diff_skyfile_id, $dbname, $threads, $outroot, $reduction, $verbose, $no_update, $no_op, $redirect);
     29my ($diff_id, $dbname, $threads, $outroot, $reduction, $verbose, $no_update, $no_op, $redirect);
     30my $skycell_id;                 # Skycell identifier
    3031GetOptions(
    31     'diff_id|d=s'         => \$diff_id, # Diff identifier
    32     'diff_skyfile_id|d=s' => \$diff_skyfile_id, # Unique skyfile identifier
    33     'dbname|d=s'          => \$dbname, # Database name
    34     'threads=s'           => \$threads,   # Number of threads to use
    35     'outroot=s'           => \$outroot, # Output root name
    36     'reduction=s'         => \$reduction, # Reduction class
    37     'verbose'             => \$verbose,   # Print to stdout
    38     'no-update'           => \$no_update, # Don't update the database?
    39     'no-op'               => \$no_op, # Don't do any operations?
    40     'redirect-output'     => \$redirect,
     32    'diff_id=s'         => \$diff_id, # Diff identifier
     33    'skycell_id=s'      => \$skycell_id, # Diff identifier
     34    'dbname|d=s'        => \$dbname, # Database name
     35    'threads=s'         => \$threads,   # Number of threads to use
     36    'outroot=s'         => \$outroot, # Output root name
     37    'reduction=s'       => \$reduction, # Reduction class
     38    'verbose'           => \$verbose,   # Print to stdout
     39    'no-update'         => \$no_update, # Don't update the database?
     40    'no-op'             => \$no_op, # Don't do any operations?
     41    'redirect-output'   => \$redirect,
    4142) or pod2usage( 2 );
    4243
    4344pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4445pod2usage(
    45     -msg => "Required options: --diff_id --outroot",
     46    -msg => "Required options: --diff_id --skycell_id --outroot",
    4647    -exitval => 3,
    4748          ) unless defined $diff_id
     49    and defined $skycell_id
    4850    and defined $outroot;
    4951
     
    5355my $logDest = "$outroot.log";
    5456$ipprc->redirect_output($logDest) if $redirect;
    55 
    56 my $image_id = $diff_skyfile_id;
    57 my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_DIFF);
    5857
    5958# Look for programs we need
     
    7170my $files;
    7271{
    73     my $command = "$difftool -inputskyfile -diff_id $diff_id";
     72    my $command = "$difftool -inputskyfile -diff_id $diff_id -skycell_id $skycell_id";
    7473    $command .= " -dbname $dbname" if defined $dbname;
    7574    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    9392my ($template, $templateMask, $templateWeight, $templatePath, $templateSources); # Template files and path
    9493my $tess_id;                    # Tesselation identifier
    95 my $skycell_id;                 # Skycell identifier
    9694my $camera;                     # Camera
    9795foreach my $file (@$files) {
     
    214212    $command .= " -dumpconfig $configuration";
    215213    $command .= " -dbname $dbname" if defined $dbname;
    216     # $command .= " -image_id $image_id" if defined $image_id;
    217     # $command .= " -source_id $source_id" if defined $source_id;
    218214
    219215    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    226222    &my_die("Couldn't find expected output file: $outputMask", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
    227223    &my_die("Couldn't find expected output file: $outputWeight", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
    228     &my_die("Couldn't find expected output file: $outputSources", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
     224#    &my_die("Couldn't find expected output file: $outputSources", $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
    229225#    &my_die("Couldn't find expected output file: $bin1Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin1Name);
    230226#    &my_die("Couldn't find expected output file: $bin2Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
     
    251247    # Add the subtraction result
    252248    {
    253         my $command = "$difftool -adddiffskyfile -diff_id $diff_id -uri $outputName -path_base $outroot";
     249        my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id -uri $outputName -path_base $outroot";
    254250        $command .= " $cmdflags";
    255251        $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
     
    275271    warn($msg);
    276272    if (defined $diff_id and not $no_update) {
    277         my $command = "$difftool -adddiffskyfile -diff_id $diff_id -code $exit_code";
     273        my $command = "$difftool -adddiffskyfile -diff_id $diff_id -skycell_id $skycell_id -code $exit_code";
    278274        $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
    279275        $command .= " -hostname $host" if defined $host;
Note: See TracChangeset for help on using the changeset viewer.