IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 12:45:24 PM (17 years ago)
Author:
eugene
Message:

update from mainline

Location:
branches/eam_branches/20090715
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715

  • branches/eam_branches/20090715/ippScripts/scripts/magic_destreak_revert.pl

    r24726 r25022  
    6060
    6161pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    62 pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component --uri --path_base --outroot",
     62pod2usage( -msg => "Required options: --magic_ds_id --camera --stage --stage_id --component --path_base --outroot",
    6363           -exitval => 3) unless
    6464    defined $magic_ds_id and
     
    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);
    145 my ($bimage, $bmask, $bch_mask, $bweight);
     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);
    171174    $mask   = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base);
    172175    $weight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $path_base);
     176    $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $path_base);
    173177    $bimage  = $ipprc->filename("PSWARP.OUTPUT", $backup_path_base);
    174178    $bmask   = $ipprc->filename("PSWARP.OUTPUT.MASK", $backup_path_base);
    175179    $bweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $backup_path_base);
     180    $bsources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $backup_path_base);
    176181} elsif ($stage eq "diff") {
    177182    my $name = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; # Base name for images
     
    179184    $mask   = $ipprc->filename("$name.MASK", $path_base);
    180185    $weight = $ipprc->filename("$name.VARIANCE", $path_base);
     186    $sources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $path_base);
    181187    $bimage  = $ipprc->filename($name, $backup_path_base);
    182188    $bmask   = $ipprc->filename("$name.MASK", $backup_path_base);
    183189    $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
    184 }
    185 
    186 revert_file($image, $bimage) or
     190    $bsources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $backup_path_base);
     191}
     192
     193if ($image) {
     194    revert_file($image, $bimage) or
    187195        &my_die("failed to restore image file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    188 
    189 # don't commit next the next couple of lines and see xxx below
    190 # change to if 0 to revert chip runs without masks
    191 if (0) {
     196}
    192197
    193198if ($mask) {
    194199    if (!revert_file($mask, $bmask)) {
    195200        if ($stage eq 'chip') {
    196             # XXX: don't fail if the mask file fails to revert. It probably doesn't exist
    197             # 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
    198204            print STDERR "failure to revert mask file, ignored\n";
    199205        } else {
     
    204210
    205211if ($ch_mask) {
    206     # Handle this properly
    207212    if (!revert_file($ch_mask, $bch_mask)) {
    208         # print STDERR "failure to revert chip mask file, ignored\n";
    209213        &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    210214    }
    211215}
    212216
    213 # xxx don't commmit next line
    214 }
    215217
    216218if ($weight) {
    217219    revert_file($weight, $bweight) or
    218220        &my_die("failed to restore variance image", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
     221}
     222
     223if ($sources) {
     224    revert_file($sources, $bsources) or
     225        &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);
    219231}
    220232
Note: See TracChangeset for help on using the changeset viewer.