Changeset 22429
- Timestamp:
- Feb 24, 2009, 11:02:06 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_image_path.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_image_path.pl
r18536 r22429 2 2 3 3 # 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 is5 # hardcoded to gpc1 and the telescope is gpc16 4 # 7 5 … … 10 8 11 9 # 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 11 my $use_008_workaround = 0; 12 my $use_017_workaround = 0; 14 13 15 14 use vars qw( $VERSION ); … … 41 40 my $ota_num; 42 41 if ($class_id) { 43 # we accept class_id in 3 formats (all we care about is the number)44 # xy2345 # ota2346 # 2347 42 $class_id = lc($class_id); 48 43 my $extra; … … 74 69 if ($from_registered) { 75 70 $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\'"; 78 72 $query .= " AND class_id = \'xy$ota_num\'" if ($ota_num); 79 73 } 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 = ?"; 82 75 my $stmt = $dbh->prepare($query); 83 76 $stmt->execute($exp_name); … … 105 98 if ($use_008_workaround && ($uri =~ /ipp008/)) { 106 99 $path = resolve_ipp008_file($uri); 100 } elsif ($use_017_workaround && ($uri =~ /4683/) && 101 ($uri =~ /ipp017/)) { 102 $path = resolve_ipp017_file($uri); 107 103 } else { 108 104 $path = $ipprc->file_resolve($uri); … … 169 165 return $path; 170 166 } 167 168 sub 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.
