IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 6, 2010, 9:43:18 AM (16 years ago)
Author:
rhenders
Message:

More meaningful argument names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/scripts/ippToPsps_run.pl

    r27847 r27869  
    1212
    1313# globals
    14 my ($verbose, $save_temps, $no_op, $no_update, $camera, $product, $output, $dvodb, $datastoreProduct, $label, $singleExpId, $no_publish);
     14my ($verbose, $save_temps, $no_op, $no_update, $camera, $batchType, $output, $dvodb, $datastoreProduct, $label, $singleExpId, $no_publish);
    1515
    1616# TODO temporary until we use database to store current jobid
     
    3131GetOptions(
    3232        'output|o=s' => \$output,
    33         'product|p=s' => \$product,
     33        'batch|b=s' => \$batchType,
    3434        'dvodb|d=s' => \$dvodb,
    3535        'label|l=s' => \$label,
    3636        'expid|e=s' => \$singleExpId,
    37         'dsproduct|s=s' => \$datastoreProduct,
     37        'product|p=s' => \$datastoreProduct,
    3838        'no_publish' => \$no_publish,
    3939        'verbose|v' => \$verbose,
     
    5353        "--dvodb <path>\n".
    5454        "\n   Optional:\n\n".
    55         "--dsproduct <datastoreProductName>\n".
     55        "--product <datastoreProduct>\n".
    5656        "--no_publish - won't publish to datastore\n".
    5757        "--save_temps - will save temporary files\n".
     
    6060        -exitval => 3
    6161        ) unless
    62 defined $product and
     62defined $batchType and
    6363defined $output and
    6464defined $dvodb and
     
    190190
    191191        # run IppToPsps program
    192         if (runIppToPsps($db, $expId, $batchOutputPath, $product)) {
     192        if (runIppToPsps($db, $expId, $batchOutputPath, $batchType)) {
    193193
    194194            # write batch manifest and tar and zip up
    195             if (writeBatchManifest($batchOutputPath, $batchDir, $product)) {
     195            if (writeBatchManifest($batchOutputPath, $batchDir, $batchType)) {
    196196
    197197                if (tarAndZipDirectory($jobOutputPath, $batchDir)) {
     
    225225        }
    226226
    227         if ($product eq "init" ) {print "* Wrote initialisation batch\n"; last;}
     227        if ($batchType eq "init" ) {print "* Wrote initialisation batch\n"; last;}
    228228
    229229
     
    278278#######################################################################################
    279279sub runIppToPsps {
    280     my ($db, $expId, $batchOutputPath, $product) = @_;
     280    my ($db, $expId, $batchOutputPath, $batchType) = @_;
    281281
    282282    my $success = 0;
    283283
    284284    # before anything else, we can publish the init batch
    285     if ($product =~ /init/) {
     285    if ($batchType =~ /init/) {
    286286        $success = produceInit($batchOutputPath);
    287287    }
    288     elsif ($product =~ /det/) {
     288    elsif ($batchType =~ /det/) {
    289289        $success = produceDetections($db, $expId, $batchOutputPath);
    290290    }
    291     elsif ($product =~ /diff/) {
     291    elsif ($batchType =~ /diff/) {
    292292        $success = produceDiffs($db, $expId, $batchOutputPath);
    293293    }
     
    344344sub writeBatchManifest {
    345345
    346     my ($path,$batch,$product) = @_;
     346    my ($path,$batch,$batchType) = @_;
    347347
    348348    use XML::Writer;
     
    359359    # determine batch 'type'
    360360    my $type;
    361     if($product eq 'init') {$type = "IN";}
    362     elsif($product eq 'det') {$type = "P2";}
    363     elsif ($product eq 'stack') {$type = "ST";}
    364     elsif ($product eq 'diff') {$type = "OB";}
     361    if($batchType eq 'init') {$type = "IN";}
     362    elsif($batchType eq 'det') {$type = "P2";}
     363    elsif ($batchType eq 'stack') {$type = "ST";}
     364    elsif ($batchType eq 'diff') {$type = "OB";}
    365365    else {$type = "UNKNOWN";}
    366366
     
    373373    my $maxObjId;
    374374    my $filename;
    375     if($product eq 'det') {
     375    if($batchType eq 'det') {
    376376
    377377        while (<MYFILE>) {
     
    410410
    411411            # write manifest element TODO untidy
    412             if($product eq 'det' && $filename eq $f) {
     412            if($batchType eq 'det' && $filename eq $f) {
    413413
    414414                $writer->startTag('manifest',
     
    437437            #$writer->startTag('md5'); $writer->characters("$md5sum"); $writer->endTag();
    438438
    439             #if($product eq 'det' && $filename eq $f) {
     439            #if($batchType eq 'det' && $filename eq $f) {
    440440
    441441                #    $writer->startTag('minObjId'); $writer->characters("$minObjId"); $writer->endTag();
     
    584584    my ($outputPath) = @_;
    585585
    586     my $success = runProgram( "NULL", $outputPath, 0, $product);
     586    my $success = runProgram( "NULL", $outputPath, 0, $batchType);
    587587    return $success;
    588588}
     
    628628        close $tempFile;
    629629
    630         $success = runProgram($tempName, $outputPath, $expId, $product);
     630        $success = runProgram($tempName, $outputPath, $expId, $batchType);
    631631        return $success;
    632632    }
     
    677677    }
    678678
    679     my $ret = runProgram($tempName, $outputPath, $expId, $product);
     679    my $ret = runProgram($tempName, $outputPath, $expId, $batchType);
    680680
    681681    close $tempFile;
     
    690690#######################################################################################
    691691sub runProgram {
    692     my ($input, $output, $expid, $product) = @_;
     692    my ($input, $output, $expid, $batchType) = @_;
    693693
    694694    # build command
     
    699699    $command .= " -config config"; # TODO
    700700    $command .= " -expid $expid";
    701     $command .= " -product $product";
     701    $command .= " -product $batchType";
    702702    $command .= " -results $resultsFileName";
    703703
Note: See TracChangeset for help on using the changeset viewer.