IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 22429


Ignore:
Timestamp:
Feb 24, 2009, 11:02:06 AM (17 years ago)
Author:
bills
Message:

check in some changes that have been in use by the image quality folks
for awhile in the ~ipp/bills build

File:
1 edited

Legend:

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

    r18536 r22429  
    22
    33# ipp_image_path.pl print out the unix path name(s) for rawImage files for an exposure
    4 # Note this program should really be called gpc1_image_path since the camera is
    5 # hardcoded to gpc1 and the telescope is gpc1
    64#
    75
     
    108
    119# get images that are on ipp008 from alternative location until the
    12 # dataase is updated
    13 my $use_008_workaround  = 1;
     10# database is updated
     11my $use_008_workaround  = 0;
     12my $use_017_workaround  = 0;
    1413
    1514use vars qw( $VERSION );
     
    4140my $ota_num;
    4241if ($class_id) {
    43     # we accept class_id in 3 formats (all we care about is the number)
    44     # xy23
    45     # ota23
    46     # 23
    4742    $class_id = lc($class_id);
    4843    my $extra;
     
    7469    if ($from_registered) {
    7570        $query = "SELECT exp_id, class_id, uri FROM rawImfile"
    76                 . " WHERE exp_name = \'$exp_name\'"
    77                 . " AND camera = \'gpc1\' AND telescope = \'ps1\'";
     71                . " WHERE exp_name = \'$exp_name\'";
    7872        $query .= " AND class_id = \'xy$ota_num\'" if ($ota_num);
    7973    } else {
    80         $query = "SELECT exp_id FROM newExp WHERE tmp_exp_name = ?"
    81                 . " AND tmp_camera = \'gpc1\' AND tmp_telescope = \'ps1\'";
     74        $query = "SELECT exp_id FROM newExp WHERE tmp_exp_name = ?";
    8275        my $stmt = $dbh->prepare($query);
    8376        $stmt->execute($exp_name);
     
    10598            if ($use_008_workaround && ($uri =~ /ipp008/)) {
    10699                $path = resolve_ipp008_file($uri);
     100            } elsif ($use_017_workaround && ($uri =~ /4683/) &&
     101                    ($uri =~ /ipp017/)) {
     102                $path = resolve_ipp017_file($uri);
    107103            } else {
    108104                $path = $ipprc->file_resolve($uri);
     
    169165    return $path;
    170166}
     167
     168sub resolve_ipp017_file {
     169    my $uri = shift;
     170
     171    # uri's look like neb://ipp008.0/gpc1/20080625/o4642g0400o/o4642g0400o.ota24.fits
     172   
     173    my ($left, $middle, $ota, $fits) = split '\.', $uri;
     174   
     175    my $node = "ipp015";
     176
     177    die "can't find node for $ota: $uri" if (!$node);
     178
     179    my $path =  $uri;
     180   
     181    $path =~  s%neb://ipp017.0%/data/${node}.0/recover17%;
     182
     183    die "sorry backup image for $uri not found\n" if (!-e $path);
     184
     185    return $path;
     186}
Note: See TracChangeset for help on using the changeset viewer.