IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35901 for trunk/pstamp


Ignore:
Timestamp:
Aug 7, 2013, 12:27:21 PM (13 years ago)
Author:
bills
Message:

extract calibration information from database and insert into postage stamp headers

Location:
trunk/pstamp/scripts
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/Makefile.am

    r33324 r35901  
    2121        pstamp_get_image_job.pl \
    2222        psmkreq \
     23        psgetcalibinfo \
    2324        psstatus \
    2425        pstampstopfaulted \
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r35900 r35901  
    7878my $ppstamp    = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1);
    7979my $pstamp_get_image_job    = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1);
     80my $psgetcalibinfo    = can_run('psgetcalibinfo') or (warn "Can't find psgetcalibinfo" and $missing_tools = 1);
    8081my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1);
    81 my $streaksreplace = can_run('streaksreplace')  or (warn "Can't find streaksreplace"  and $missing_tools = 1);
    8282my $whichnode = can_run('whichnode') or (warn "can't find whichnode" and $missing_tools = 1);
    8383
     
    151151    # find our output directory
    152152    my $outdir = dirname($outputBase);
    153     my ($tmpImage, $tmpMask, $tmpVariance, $tmproot);
    154    
     153
     154    my ($calib_fd, $calibfile);
     155    if ($stage eq 'chip' or $stage eq 'warp') {
     156        my $cam_id = $params->{cam_id};
     157        ($calib_fd, $calibfile) = tempfile ("$outdir/calib.XXXX", UNLINK => !$save_temps);
     158        close $calib_fd;
     159
     160        my $command = "$psgetcalibinfo --cam_id $cam_id --output $calibfile";
     161        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     162            run(command => $command, verbose => $verbose);
     163
     164        my $exitStatus;
     165        if (WIFEXITED($error_code)) {
     166            $exitStatus = WEXITSTATUS($error_code);
     167        } else {
     168            print STDERR "psgetcalibinfo failed error_code: $error_code\n";
     169            $exitStatus = $PS_EXIT_SYS_ERROR;
     170        }
     171        exit $exitStatus if $exitStatus;
     172
     173        if (-s $calibfile == 0) {
     174            print "no calibration information found for $cam_id\n";
     175            $calibfile = undef;
     176        }
     177    }
     178
     179    # my ($tmpImage, $tmpMask, $tmpVariance, $tmproot);
     180
    155181    my $command = "$ppstamp $outputBase $argString $fileArgs";
    156182    $command .= " -write_jpeg" if ($options & $PSTAMP_SELECT_JPEG);
    157183    $command .= " -nocompress" if ($options & $PSTAMP_SELECT_UNCOMPRESSED);
    158184    $command .= " -stage $stage";
     185    $command .= " -forheader $calibfile" if $calibfile;
    159186    $command .= " -dbname $dbname" if $dbname;
    160187    $command .= " -dbserver $dbserver" if $dbserver;
Note: See TracChangeset for help on using the changeset viewer.