IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 28, 2009, 3:50:48 PM (17 years ago)
Author:
bills
Message:

added code to revert .smf files that have been censored
at the camera stage

File:
1 edited

Legend:

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

    r24856 r24936  
    9595} elsif ($stage eq "diff") {
    9696    $skycell_id = $component;
    97 } else {
     97} elsif ($stage ne "camera") {
    9898    &my_die("Invalid value for stage: $stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    9999}
     
    142142
    143143
    144 my ($image, $mask, $ch_mask, $weight, $sources);
    145 my ($bimage, $bmask, $bch_mask, $bweight, $bsources);
     144my ($image, $mask, $ch_mask, $weight, $sources, $astrom);
     145my ($bimage, $bmask, $bch_mask, $bweight, $bsources, $bastrom);
    146146
    147147if ($stage eq "raw") {
     
    167167    $bch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $backup_path_base, $class_id);
    168168    $bweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $backup_path_base, $class_id);
     169} elsif ($stage eq "camera") {
     170    $astrom =  $ipprc->filename("PSASTRO.OUTPUT", $path_base);
     171    $bastrom = $ipprc->filename("PSASTRO.OUTPUT", $backup_path_base);
    169172} elsif ($stage eq "warp") {
    170173    $image  = $ipprc->filename("PSWARP.OUTPUT", $path_base);
     
    188191}
    189192
    190 revert_file($image, $bimage) or
     193if ($image) {
     194    revert_file($image, $bimage) or
    191195        &my_die("failed to restore image file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    192 
    193 # don't commit next the next couple of lines and see xxx below
    194 # change to if 0 to revert chip runs without masks
     196}
     197
    195198if ($mask) {
    196199    if (!revert_file($mask, $bmask)) {
    197200        if ($stage eq 'chip') {
    198             # XXX: don't fail if the mask file fails to revert. It probably doesn't exist
    199             # Handle this properly
     201            # don't fail if the mask file (from the camera stage) fails to revert.
     202            # It probably doesn't exist
     203            # XXX: Handle this properly
    200204            print STDERR "failure to revert mask file, ignored\n";
    201205        } else {
     
    206210
    207211if ($ch_mask) {
    208     # Handle this properly
    209212    if (!revert_file($ch_mask, $bch_mask)) {
    210         # print STDERR "failure to revert chip mask file, ignored\n";
    211213        &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    212214    }
     
    222224    revert_file($sources, $bsources) or
    223225        &my_die("failed to restore sources file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
     226}
     227
     228if ($astrom) {
     229    revert_file($astrom, $bastrom) or
     230        &my_die("failed to restore astrometry file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    224231}
    225232
Note: See TracChangeset for help on using the changeset viewer.