Changeset 29999
- Timestamp:
- Dec 9, 2010, 12:08:53 PM (15 years ago)
- Location:
- trunk/ippToPsps/perl
- Files:
-
- 2 edited
-
exposureSummary.pl (modified) (10 diffs)
-
ippToPsps_run.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/exposureSummary.pl
r29989 r29999 11 11 use ippToPsps::IppToPspsDb; 12 12 use ippToPsps::Gpc1Db; 13 use ippToPsps:: Batch;13 use ippToPsps::DetectionBatch; 14 14 15 15 my $dvoDb = undef; … … 17 17 my $endExp = undef; 18 18 my $verbose = undef; 19 my $checkNeb = undef; 19 20 my $save_temps = undef; 20 21 … … 23 24 'endexpi|e=s' => \$endExp, 24 25 'dvodb|d=s' => \$dvoDb, 26 'checkNeb|n' => \$checkNeb, 25 27 'verbose|v' => \$verbose, 26 28 'save_temps|s' => \$save_temps … … 37 39 if (!defined $beginExp) { 38 40 $quit = 1; 39 print "* REQUIRED: a begin exp_id -b <name>\n";41 print "* REQUIRED: a begin exp_id -b <name>\n"; 40 42 } 41 43 if (!defined $endExp) { 42 44 $quit = 1; 43 print "* REQUIRED: an end exp_id -e <name>\n";45 print "* REQUIRED: an end exp_id -e <name>\n"; 44 46 } 45 47 if (!defined $dvoDb) { 46 48 $quit = 1; 47 print "* REQUIRED: a dvo Db name -d <name>\n"; 49 print "* REQUIRED: a dvo Db name -d <name>\n"; 50 } 51 if (!defined $checkNeb) { 52 $checkNeb = 0; 53 print "* OPTIONAL: check nebulous for unprocessed exposures -n (default = $checkNeb)\n"; 48 54 } 49 55 if (!defined $verbose) { 50 56 $verbose = 0; 51 print "* OPTIONAL: run in verbose mode -v(default = $verbose)\n";57 print "* OPTIONAL: run in verbose mode -v (default = $verbose)\n"; 52 58 } 53 59 if (!defined $save_temps) { 54 60 $save_temps = 0; 55 print "* OPTIONAL: keep temp files -t(default = $save_temps)\n";61 print "* OPTIONAL: keep temp files -t (default = $save_temps)\n"; 56 62 } 57 63 print "*\n*******************************************************************************\n"; … … 73 79 exit; 74 80 } 81 82 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); 83 my $timeStamp = sprintf "%4d-%02d-%02d %02d:%02d:%02d", $year+1900,$mon+1,$mday,$hour,$min,$sec; 75 84 76 85 my $exposure; … … 82 91 my $totalLoadFailed = 0; 83 92 my $totalUnderObjIdLimit = 0; 84 my @unprocessedExposures; 85 my @odmFailures; 93 my $totalUnprocessed = 0; 94 my $totalUnprocessedAvailableSmfs = 0; 95 my $totalOdmFailures = 0; 96 my $totalUnprocessedMissingSmfs = 0; 97 98 99 open (UNPRO, ">unprocessedExposures.txt") or print "* Problem opening data file for unprocessed exposures\n"; 100 open (ODMFAIL, ">odmFailures.txt") or print "* Problem opening data file for ODM failures\n"; 101 102 if ($checkNeb) { 103 104 open (MISSSMF, ">missingSmfs.txt") or print "* Problem opening data file for missing smfs\n"; 105 open (NOTMISSSMF, ">notMissingSmfs.txt") or print "* Problem opening data file for missing smfs\n"; 106 } 86 107 87 108 foreach $exposure ( @{$exposures} ) { 88 my ($ expId) = @{$exposure};109 my ($batchId, $expId) = @{$exposure}; 89 110 90 111 if ($ippToPspsDb->isExposureMerged($expId)) {next;} … … 114 135 } 115 136 else { 116 117 push(@odmFailures, $expId); 137 138 $totalOdmFailures++; 139 print ODMFAIL "$expId\n"; 118 140 } 119 141 } … … 122 144 else { 123 145 124 push(@unprocessedExposures, $expId); 146 147 $totalUnprocessed++; 148 print UNPRO "$expId\n"; 149 150 # if flag is set, then attempt to get smf file from nebulous for this unprocessed exposure 151 if ($checkNeb) { 152 153 my $detectionBatch = ippToPsps::DetectionBatch->existing( 154 "GPC1", 155 $gpc1Db, 156 $batchId, 157 $ippToPspsDb, 158 ".", 159 $verbose, 160 $save_temps); 161 162 163 my $path = $detectionBatch->getSmfFile(); 164 if (!$path) { 165 print "no smf file for $expId\n"; 166 167 $totalUnprocessedMissingSmfs++; 168 print MISSSMF "$expId\n"; 169 } 170 else { 171 172 $totalUnprocessedAvailableSmfs++; 173 print NOTMISSSMF "$expId\n"; 174 175 } 176 } 177 125 178 } 126 179 } 127 180 128 my $totalUnprocessed = @unprocessedExposures; 129 my $totalOdmFailures = @odmFailures; 181 close(UNPRO); 182 close(ODMFAIL); 183 if ($checkNeb) { 184 185 close(MISSSMF); 186 close(NOTMISSSMF); 187 } 130 188 my $totalProcessedNotOnDatastore = $totalProcessed - $totalOnDatastore; 131 189 my $totalOnDatastoreNotLoaded = $totalOnDatastore - $totalLoadedToOdm; 132 190 print "***********************************************************\n"; 133 print "* Summary of IPP->PSPS loading from the '$dvoDb' DVO database for exposures between $beginExp and $endExp:\n"; 191 print "* Summary of IPP->PSPS loading as of $timeStamp\n"; 192 print "* DVO Db = '$dvoDb'\n"; 193 print "* Exposures between $beginExp and $endExp\n"; 134 194 print "*\n"; 135 195 print "* total Exposures = $totalExposures\n"; … … 137 197 print "* un-merged = $totalUnmerged\n"; 138 198 print "* unprocessed by ippToPsps = $totalUnprocessed\n"; 199 if ($checkNeb) { 200 print "* missing SMF files = $totalUnprocessedMissingSmfs\n"; 201 print "* available SMF files = $totalUnprocessedAvailableSmfs\n"; 202 } 139 203 print "* processed by ippToPsps = $totalProcessed\n"; 140 204 print "* not on datastore = $totalProcessedNotOnDatastore\n"; … … 147 211 print "***********************************************************\n"; 148 212 149 my $gnuplotDat = "gnuplot.dat"; 150 open (FILE, ">$gnuplotDat") or print "* Problem opening data file for gnuplot\n"; 151 152 print FILE "totalExposures $totalExposures"; 153 print FILE "mergedintoPSPS $totalMerged\n"; 154 print FILE "un-merged $totalUnmerged\n"; 155 print FILE "unprocessedbyippToPsps $totalUnprocessed\n"; 156 print FILE "processedbyippToPsps $totalProcessed\n"; 157 print FILE "notondatastore $totalProcessedNotOnDatastore\n"; 158 print FILE "ondatastore $totalOnDatastore\n"; 159 print FILE "notloadedtoODM $totalOnDatastoreNotLoaded\n"; 160 print FILE "loadedtoODMbutrejected $totalLoadedToOdm\n"; 161 print FILE "ODMfailures $totalLoadFailed\n"; 162 print FILE "under-30declimit $totalUnderObjIdLimit\n"; 163 print FILE "remainingODMfailures $totalOdmFailures\n"; 164 close (FILE); 165 166 167 # save list of unprocessed exposures to file 168 open (FILE, ">unprocessedExposures.txt") or print "* Problem opening data file for unprocessed exposures\n"; 169 foreach my $exp_id (@unprocessedExposures) { 170 171 print FILE "$exp_id\n"; 172 } 173 close (FILE); 174 175 # save list of ODM failed exposures to file 176 open (FILE, ">odmFailures.txt") or print "* Problem opening data file for ODM failures\n"; 177 foreach my $exp_id (@odmFailures) { 178 179 print FILE "$exp_id\n"; 180 } 181 close (FILE); 182 183 184 sub plot { 185 186 open (GP, "|/usr/bin/gnuplot -persist") or die "no gnuplot"; 187 use FileHandle; 188 GP->autoflush(1); 189 190 print GP 191 #"set term png font \"/usr/share/fonts/corefonts/arial.ttf\" 8;" . 192 "set term X11;" . 193 "set output \"summary.png\";" . 194 "set title \"Summary of IPP->PSPS loading from the '$dvoDb' DVO database\nfor exposures between $beginExp and $endExp\";" . 195 "set grid;" . 196 "set boxwidth;" . 197 "set style data histogram;" . 198 "set style fill solid border -1;" . 199 "set ylabel \"Exposures\";" . 200 "set boxwidth 0.75;" . 201 "plot '$gnuplotDat' using 2:xtic(1) notitle, '' using 3 notitle, '' using 4 notitle;" . 202 "\n"; 203 204 close GP; 205 206 207 } 208 209 213 -
trunk/ippToPsps/perl/ippToPsps_run.pl
r29089 r29999 15 15 use ippToPsps::IppToPspsDb; 16 16 use ippToPsps::Datastore; 17 #use ippToPsps::BatchManager; 17 18 18 19 # globals … … 112 113 my $datastore = undef; 113 114 if ($datastoreProduct) {$datastore = new ippToPsps::Datastore($datastoreProduct, $verbose, $save_temps);} 115 #my $batchManager = new ippToPsps::BatchManager($ippToPspsDb, $output, $verbose, $save_temps); 114 116 115 117 # check we can run programs and get camera config
Note:
See TracChangeset
for help on using the changeset viewer.
