IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33575 for trunk


Ignore:
Timestamp:
Mar 21, 2012, 11:32:34 AM (14 years ago)
Author:
bills
Message:

Create a temporary directory. In there create symlinks to the nebulous files
pass the symlink names to ds9. Thre result is a nice short useful filename in the ds9 screen
which is substr($filter, 0, 1) . basename($uri)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/dlapstacks

    r33524 r33575  
    3030my ($singleframe, $fitToFrame, $deasin, $save_temps, $data_group);
    3131
     32# XXX: get this from the ipprc
    3233my $temproot = '/local/ipp/tmp';
    3334my $outdir;
     
    201202        $imagesize = 680;
    202203    }
     204    my $tempdir;
     205    if (!$outdir) {
     206        $tempdir = tempdir ("$temproot/dlapstacks.temp.XXXX", CLEANUP => !$save_temps);
     207    }
    203208    if ($deasin) {
    204209        if ($outdir) {
    205             print "Saving deasined files to $outdir\n";
     210            print "Saving deasined files to $outdir\n" if $verbose;
    206211            # user specified output directory save the files there
    207212            if (!-d $outdir) {
     
    210215        } else {
    211216            # otherwise use a temporary directory
    212             $outdir = tempdir ("$temproot/dlapstacks.temp.XXXX", CLEANUP => !$save_temps);
    213217            print "deasined files will be saved to $outdir\n" if $save_temps;
     218            $outdir = $tempdir;
    214219        }
    215220    }
     
    222227        my $filename = $ipprc->file_resolve($pathname);
    223228        next if !$filename;
    224         # run ppstamp to undo the asin scaling. The output from ppstamp is linear F32 images
     229
     230        # prefix file name with filter
     231        # this will either be the ppstamp output filename or we
     232        # will put a symlink to it in tempdir
     233        my $base = basename($pathname);
     234        my $filt = substr $f->{filter}, 0, 1;
     235        $base = "$filt.$base";
    225236        if ($deasin) {
    226             my $base = basename($pathname);
     237            # run ppstamp to undo the asin scaling. The output from ppstamp is linear F32 images
     238
     239            # drop the .fits for the output path for ppstamp
    227240            my $destbase = $base;
    228 
    229             # drop the .fits for the output path for ppstamp
    230241            $destbase =~ s/\.fits//g;
     242
    231243
    232244            my $command = "$ppstamp -wholefile -file $filename $outdir/$destbase";
     
    241253            # new filename for ds9
    242254            $filename = "$outdir/$base";
     255        } else {
     256            my $nebname = $filename;
     257            $filename = "$tempdir/$base";
     258            symlink $nebname, $filename or die "failed to symlink $nebname";
    243259        }
    244260
Note: See TracChangeset for help on using the changeset viewer.