IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 9, 2010, 10:53:10 AM (16 years ago)
Author:
bills
Message:

If skycell file doesn't exist create a temporary template one.
This happens when re-doing restreaking after cleanup/update
if the corresponding diffRun has been cleaned.

File:
1 edited

Legend:

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

    r26461 r26554  
    1515
    1616use IPC::Cmd 0.36 qw( can_run run );
    17 use File::Temp qw( tempfile );
     17use File::Temp qw( tempfile tempdir );
    1818use File::Basename qw( basename dirname );
    1919use PS::IPP::Metadata::Config;
     
    179179}
    180180
     181my $temp_dir;
     182
    181183if ($stage ne "camera") {
    182184    # get skycell list if needed
     
    200202                    &my_die("Unable to parse metadata list", $magic_ds_id, $component, $PS_EXIT_PROG_ERROR);
    201203
     204            $temp_dir = tempdir( CLEANUP => !$save_temps);
    202205            ($sfh, $skycell_list) = tempfile( "/tmp/skycell_list.XXXX", UNLINK => !$save_temps);
    203206
    204207            foreach my $skycell (@$skycells) {
    205                 my $skycell_uri = $ipprc->filename("PPSUB.OUTPUT", $skycell->{path_base});
     208                my $skycell_uri;
     209                if ($skycell->{data_state} eq "full") {
     210                    $skycell_uri = $ipprc->filename("PPSUB.OUTPUT", $skycell->{path_base});
     211                } else {
     212                    # diff run must have been cleaned up, need to create this skycell file on the fly
     213                    my $skycell_id = $skycell->{skycell_id};
     214                    $skycell_uri = "$temp_dir/$skycell_id";
     215                    $ipprc->skycell_file($skycell->{tess_id}, $skycell_id, $skycell_uri, $verbose) or
     216                        &my_die("failed to create skycell file for $skycell_id", $magic_ds_id, $component, $PS_EXIT_PROG_ERROR);
     217                }
    206218                print $sfh "$skycell_uri\n";
    207219            }
    208             close $sfh;
     220            close $sfh
    209221        }
    210222    }
Note: See TracChangeset for help on using the changeset viewer.