- Timestamp:
- Oct 21, 2010, 2:45:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/ippToPsps/perl/getSmfForThisBatch.pl
r29124 r29515 7 7 use ippToPsps::Gpc1Db; 8 8 use ippToPsps::IppToPspsDb; 9 use PS::IPP::Config 1.01 qw( :standard );9 use ippToPsps::DetectionBatch; 10 10 11 11 my $camera = undef; 12 my $ singleBatch = undef;12 my $batch = undef; 13 13 my $verbose = undef; 14 14 my $save_temps = undef; 15 15 16 16 GetOptions( 17 'batch|b=s' => \$ singleBatch,17 'batch|b=s' => \$batch, 18 18 'verbose|v' => \$verbose, 19 19 'save_temps|t' => \$save_temps, … … 26 26 if (@ARGV) { 27 27 $quit=1; 28 print "* UNKN KOWN: option @ARGV\n";28 print "* UNKNOWN: option @ARGV\n"; 29 29 } 30 if (!defined $ singleBatch) {30 if (!defined $batch) { 31 31 $quit=1; 32 32 print "* REQUIRED: need to provide a batch -b <batch>\n"; 33 33 } 34 if (!defined $ verbose) {34 if (!defined $camera) { 35 35 $camera = "GPC1"; 36 36 print "* OPTIONAL: select a camera -c (default = $camera)\n"; … … 51 51 my $gpc1Db = new ippToPsps::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser", $verbose, $save_temps); 52 52 my $ippToPspsDb = new ippToPsps::IppToPspsDb("ippToPsps", "ippdb01", "ipp", "ipp", $verbose, $save_temps); 53 my $ipprc = PS::IPP::Config->new($camera) or (warn "Can't get camera configuration" and exit($PS_EXIT_CONFIG_ERROR));54 53 54 my $detectionBatch = ippToPsps::DetectionBatch->existing( 55 $camera, 56 $gpc1Db, 57 $batch, 58 $ippToPspsDb, 59 "./", 60 $verbose, 61 $save_temps); 55 62 56 my $batches; 57 my $numOfBatches; 58 59 if (defined $singleBatch ) { $numOfBatches = $ippToPspsDb->getBatch($singleBatch, \$batches);} 60 if ($numOfBatches < 1) {return 0;} 61 62 63 # loop round batches 64 my $batch; 65 my $numChecked = 0; 66 foreach $batch ( @{$batches} ) { 67 my ($timestamp, $expId, $batchId, $surveyType, $deleted, $dvoDb, $processed, $onDatastore, $loadedToOdm, $mergeWorthy, $merged) = @{$batch}; 68 69 print "* found $timestamp, $expId, $batchId, $surveyType, $deleted $dvoDb\n"; 70 71 my $nebPath = $gpc1Db->getCameraStageSmfForThisDvoDb($dvoDb, $expId); 72 if (!$nebPath) { print "* Could not determind neb path for SMF\n"; exit; } 73 74 # get real filename from neb 'key' 75 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",$nebPath) or return 0; 76 my $realFile = $ipprc->file_resolve($fpaObjects) or return 0; 77 78 print "$realFile\n"; 79 63 my $smf = $detectionBatch->getSmfFile(); 64 if (defined $smf) { 65 print "$smf\n"; 80 66 } 81 82 67 else { 68 print "* Could not find an smf file for batch $batch\n"; 69 }
Note:
See TracChangeset
for help on using the changeset viewer.
