IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30759


Ignore:
Timestamp:
Feb 24, 2011, 2:52:59 PM (15 years ago)
Author:
bills
Message:

one last fix (this actually works for all of the raw destreak faults we just had)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110218/ippScripts/scripts/magic_destreak_revert.pl

    r30755 r30759  
    163163        $image = $path_base . ".fits";
    164164    }
    165     $bimage = $backup_path_base . ".fits";
     165    if ($backup_path_base =~ /.*\.fits$/) {
     166        $bimage = $backup_path_base;
     167    } else {
     168        $bimage = $backup_path_base . ".fits";
     169    }
    166170} elsif ($stage eq "chip") {
    167171    # Check to see if we're using dynamic masks
     
    303307sub revert_files {
    304308    my $replace = shift;
    305     return if !$replace;
     309#    return if !$replace;
    306310
    307311    my $image = shift;
     
    317321
    318322    if ($image) {
    319         revert_file($image, $bimage) or
     323        revert_file($replace, $image, $bimage) or
    320324            &my_die("failed to restore image file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    321325    }
    322326
    323327    if ($mask) {
    324         if (!revert_file($mask, $bmask)) {
     328        if (!revert_file($replace, $mask, $bmask)) {
    325329            &my_die("failed to restore mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    326330        }
     
    328332
    329333    if ($ch_mask) {
    330         if (!revert_file($ch_mask, $bch_mask)) {
     334        if (!revert_file($replace, $ch_mask, $bch_mask)) {
    331335            &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    332336        }
     
    335339
    336340    if ($weight) {
    337         revert_file($weight, $bweight) or
     341        revert_file($replace, $weight, $bweight) or
    338342            &my_die("failed to restore variance image", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    339343    }
    340344
    341345    if ($sources) {
    342         revert_file($sources, $bsources) or
     346        revert_file($replace, $sources, $bsources) or
    343347            &my_die("failed to restore sources file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    344348    }
    345349
    346350    if ($astrom) {
    347         revert_file($astrom, $bastrom) or
     351        revert_file($replace, $astrom, $bastrom) or
    348352            &my_die("failed to restore astrometry file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    349353    }
     
    367371sub revert_file
    368372{
     373    my $replace = shift;
    369374    my $original = shift;
    370375    my $backup   = shift;
Note: See TracChangeset for help on using the changeset viewer.