IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18433


Ignore:
Timestamp:
Jul 7, 2008, 10:29:08 AM (18 years ago)
Author:
bills
Message:

in ipp_image_path.pl (the script Nick's analysis uses to find images)
get images that are on ipp008 from alternate location if the recovered
image exists

File:
1 edited

Legend:

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

    r17928 r18433  
    33# ipp_image_path.pl print out the unix path name(s) for rawImage files for an exposure
    44#
    5 # XXX TODO add argument to get paths to chip processed images
    65
    76use warnings;
    87use strict;
     8
     9# get images that are on ipp008 from alternative location until the
     10# dataase is updated
     11my $use_008_workaround  = 1;
    912
    1013use vars qw( $VERSION );
     
    9295            $path =  $uri;
    9396        } else {
    94             $path = $ipprc->file_resolve($uri);
     97            if ($use_008_workaround && ($uri =~ /ipp008/)) {
     98                $path = resolve_ipp008_file($uri);
     99            } else {
     100                $path = $ipprc->file_resolve($uri);
     101            }
    95102        }
    96103        if ($path) {
     
    127134}
    128135
     136sub resolve_ipp008_file {
     137    my %locations = ( "ota24" => "ipp006",
     138                      "ota25" => "ipp009",
     139                      "ota26" => "ipp011",
     140                      "ota27" => "ipp019",
     141                      "ota30" => "ipp020",
     142                      "ota31" => "ipp021"
     143                    );
     144
     145    my $uri = shift;
     146
     147    # uri's look like neb://ipp008.0/gpc1/20080625/o4642g0400o/o4642g0400o.ota24.fits
     148   
     149    my ($left, $middle, $ota, $fits) = split '\.', $uri;
     150   
     151    my $node = $locations{$ota};
     152
     153    die "can't find node for $ota: $uri" if (!$node);
     154
     155    my $path =  $uri;
     156   
     157    $path =~  s%neb://ipp008.0%/data/${node}.0/recover08%;
     158
     159    die "sorry backup image for $uri not found\n" if (!-e $path);
     160
     161    return $path;
     162}
Note: See TracChangeset for help on using the changeset viewer.