IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18056


Ignore:
Timestamp:
Jun 10, 2008, 10:04:29 AM (18 years ago)
Author:
eugene
Message:

tess_id to tess_dir

File:
1 edited

Legend:

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

    r17943 r18056  
    2525my $ipprc = PS::IPP::Config->new(); # IPP configuration
    2626
    27 my ($warp_id, $skycell_id, $tess_id, $camera, $dbname, $outroot, $verbose, $no_update, $no_op, $save_temps);
     27my ($warp_id, $skycell_id, $tess_dir, $camera, $dbname, $outroot, $verbose, $no_update, $no_op, $save_temps);
    2828GetOptions(
    2929    'warp_id|i=s'       => \$warp_id, # Warp identifier
    3030    'skycell_id|s=s'    => \$skycell_id, # Skycell identifier
    31     'tess_id|s=s'       => \$tess_id, # Tesselation identifier
     31    'tess_dir|s=s'       => \$tess_dir, # Tesselation identifier
    3232    'camera|c=s'        => \$camera, # Camera name
    3333    'dbname|d=s'        => \$dbname, # Database name
     
    4141pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4242pod2usage(
    43     -msg => "Required options: --warp_id --skycell_id --tess_id --camera --outroot",
     43    -msg => "Required options: --warp_id --skycell_id --tess_dir --camera --outroot",
    4444    -exitval => 3,
    4545) unless defined $warp_id
    4646    and defined $skycell_id
    47     and defined $tess_id
     47    and defined $tess_dir
    4848    and defined $camera
    4949    and defined $outroot;
     
    7979my $imfiles;
    8080{
    81     my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id";
     81    # XXX change -tess_id to -tess_dir when db schema is updated
     82    my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_dir";
    8283    $command .= " -dbname $dbname" if defined $dbname;
    8384    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    8586    unless ($success) {
    8687        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    87         &my_die("Unable to perform warptool -scmap: $error_code", $warp_id, $skycell_id, $tess_id, $error_code);
     88        &my_die("Unable to perform warptool -scmap: $error_code", $warp_id, $skycell_id, $tess_dir, $error_code);
    8889    }
    8990
    9091    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    91         &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     92        &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
    9293    $imfiles = parse_md_list($metadata) or
    93         &my_die("Unable to parse metadata list", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     94        &my_die("Unable to parse metadata list", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
    9495}
    9596
     
    121122
    122123my $skyFile = $ipprc->filename("SKYCELL.TEMPLATE", $outroot, $skycell_id );
    123 $ipprc->skycell_file( $tess_id, $skycell_id, $skyFile, $verbose ) or &my_die("Unable to generate template skycell", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR);
     124$ipprc->skycell_file( $tess_dir, $skycell_id, $skyFile, $verbose ) or &my_die("Unable to generate template skycell", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR);
    124125
    125126# Get list of filenames
     
    136137    my $weight = $ipprc->filename("PPIMAGE.CHIP.WEIGHT", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
    137138
    138     &my_die("Couldn't find input file: $image", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($image);
    139     &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);
     139    &my_die("Couldn't find input file: $image", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($image);
     140    &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);
    140141
    141142    my $astrom;         # Astrometry file
     
    148149    }
    149150
    150     &my_die("Couldn't find input file: $astrom", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless defined $astrom and $ipprc->file_exists($astrom);
     151    &my_die("Couldn't find input file: $astrom", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless defined $astrom and $ipprc->file_exists($astrom);
    151152
    152153    print $imageFile  "$image\n";
     
    187188    unless ($success) {
    188189        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    189         &my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $tess_id, $error_code);
     190        &my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $tess_dir, $error_code);
    190191    }
    191192
    192193    # Check first for the stats file, and if the ACCEPT flag is set.
    193     &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);
     194    &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);
    194195    # Get the statistics on the warped image
    195196    my $statsFile;              # File handle
     
    200201
    201202    my $metadata = $mdcParser->parse($contents)
    202         or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
     203        or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
    203204    $accept = metadataLookupBool($metadata, "ACCEPT");
    204205    if ($accept) {
    205         $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR);
    206 
    207         &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);
    208         &my_die("Couldn't find expected output file: $outputMask", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
    209         &my_die("Couldn't find expected output file: $outputWeight", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
    210         &my_die("Couldn't find expected output file: $outputSources", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
    211         &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF);
    212 #    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
    213 #    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
     206        $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);
     207
     208        &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);
     209        &my_die("Couldn't find expected output file: $outputMask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);
     210        &my_die("Couldn't find expected output file: $outputWeight", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);
     211        &my_die("Couldn't find expected output file: $outputSources", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources);
     212        &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputPSF);
     213#    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);
     214#    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);
    214215    }
    215216}
    216217
    217218unless ($no_update) {
    218     my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id";
     219    # XXX change -tess_id to -tess_dir when db is updated
     220    my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_dir";
    219221    $command .= " -ignore" if not $accept; # Completed succesfully, but can't produce product
    220222    $command .= " -uri $outputImage -path_base $outroot" if $accept;
     
    237239    my $warp_id = shift;        # Warp identifier
    238240    my $skycell_id = shift;     # Skycell identifier
    239     my $tess_id = shift;        # Tesselation identifier
     241    my $tess_dir = shift;        # Tesselation identifier
    240242    my $exit_code = shift;      # Exit code to add
    241243
    242244    warn($msg);
    243     if (defined $warp_id and defined $skycell_id and defined $tess_id and not $no_update) {
    244         my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id -code $exit_code";
     245    if (defined $warp_id and defined $skycell_id and defined $tess_dir and not $no_update) {
     246        # XXX change -tess_id to -tess_dir when db is updated
     247        my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_dir -code $exit_code";
    245248        $command .= " -hostname $host" if defined $host;
    246249        $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.