IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32792


Ignore:
Timestamp:
Nov 23, 2011, 2:26:50 PM (15 years ago)
Author:
bills
Message:

fix some issues with videophot processsing

Location:
tags/ipp-20111110
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20111110/ippScripts/scripts/videophot_process.pl

    r32753 r32792  
    3232my $listvideocells = can_run('listvideocells.pl') or (warn "Can't find listvideocells.pl" and $missing_tools = 1);
    3333my $dsreg = can_run('dsreg') or (warn "Can't find dsreg" and $missing_tools = 1);
     34my $nebrepair = can_run('neb-repair') or (warn "Can't find neb-repair" and $missing_tools = 1);
    3435if ($missing_tools) {
    3536    warn("Can't find required tools.");
     
    116117        run(command => $command, verbose => $verbose);
    117118    unless ($success) {
     119        check_input_file($uri, $vp_id, $class_id, 'nocell');
    118120        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    119121        &my_die("Unable to perform $command: $error_code", $vp_id, $error_code);
     
    244246exit 0;
    245247
     248sub check_input_file {
     249    my $uri = shift;
     250    my $vp_id = shift;
     251    my $class_id = shift;
     252    my $cell_id = shift;
     253    my $resolved = $ipprc->file_resolve($uri);
     254
     255    my $tryrepair = 0;
     256    if (!-e $resolved) {
     257        printf STDERR "instance $resolved for $uri does not exist\n";
     258        $tryrepair = 1;
     259    } elsif (-s $resolved == 0) {
     260        printf STDERR "instance $resolved for $uri is empty\n";
     261        $tryrepair = 1;
     262    }
     263    if ($tryrepair) {
     264        my $scheme = file_scheme($uri);
     265        if ($scheme and ($scheme = 'neb')) {
     266            my $command = "$nebrepair $uri";
     267            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     268                run(command => $command, verbose => $verbose);
     269            unless ($success) {
     270                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     271                my $err_message = "Unable to perform nebrepair";
     272                &my_die("$err_message: $error_code", $vp_id, $error_code);
     273            }
     274       }
     275    }
     276}
     277
    246278sub my_die
    247279{
  • tags/ipp-20111110/psvideophot/src

  • tags/ipp-20111110/psvideophot/src/psvideoLoop.c

    r32556 r32792  
    234234                    Centering(readout->image, EDGE, &vpSum, xy, median);
    235235
    236                     vpFlux = SubSum(readout->image, xy, median);
     236                    if (isfinite(xy[0]) && isfinite(xy[1])) {
     237                        vpFlux = SubSum(readout->image, xy, median);
     238                    }
    237239
    238240//                    printf("%4d %9.2f %9.2f %9.2f %.1f %.1f %9.2f\n",
Note: See TracChangeset for help on using the changeset viewer.