IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2013, 10:59:24 AM (13 years ago)
Author:
bills
Message:

check for existence of raw imfile instance and if not found try running neb-repair

File:
1 edited

Legend:

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

    r35811 r35894  
    348348            }
    349349        }
     350        # resolve uri
     351        my $uriReal = $ipprc->file_resolve( $uri );
     352        # If instance is not found or if it doesn't exist try running neb-repair on it
     353        # Note: file_exists returns false if the file exists but has zero size
     354        if (!$uriReal or !$ipprc->file_exists($uriReal)) {
     355            my $repair_cmd = "$nebrepair $uri";
     356            my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
     357            unless ($repair_success) {
     358                &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     359            }
     360            $uriReal = $ipprc->file_resolve( $uri );
     361        }
     362           
     363        &my_die("Unable to resolve $uri on $host", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) if !$uriReal;
    350364
    351365        # if recipe option PPIMAGE:APPLY.BURNTOOL is set and the burntool information is stored in
     
    378392            my ($tempFile, $tempName) = tempfile( "/tmp/chip.$exp_id.$class_id.deburned.XXXX",
    379393                                              UNLINK => !$save_temps, SUFFIX => '.fits' );
    380 
    381             # get the UNIX version of the (possible) neb: or path: filename
    382             my $uriReal = $ipprc->file_resolve( $uri );
    383                 # Catch errors here
    384             if (!$uriReal) {
    385                 my $repair_cmd = "$nebrepair $uri";
    386                 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
    387                 unless ($repair_success) {
    388                     &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    389                 }
    390                 $uriReal = $ipprc->file_resolve( $uri );
    391             }
    392                
    393             &my_die("Unable to resolve $uri on $host", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) if !$uriReal;
    394394
    395395            # funpack into the temp file.
Note: See TracChangeset for help on using the changeset viewer.