IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29999


Ignore:
Timestamp:
Dec 9, 2010, 12:08:53 PM (15 years ago)
Author:
rhenders
Message:

new summary

Location:
trunk/ippToPsps/perl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/exposureSummary.pl

    r29989 r29999  
    1111use ippToPsps::IppToPspsDb;
    1212use ippToPsps::Gpc1Db;
    13 use ippToPsps::Batch;
     13use ippToPsps::DetectionBatch;
    1414
    1515my $dvoDb = undef;
     
    1717my $endExp = undef;
    1818my $verbose = undef;
     19my $checkNeb = undef;
    1920my $save_temps = undef;
    2021
     
    2324        'endexpi|e=s' => \$endExp,
    2425        'dvodb|d=s' => \$dvoDb,
     26        'checkNeb|n' => \$checkNeb,
    2527        'verbose|v' => \$verbose,
    2628        'save_temps|s' => \$save_temps
     
    3739if (!defined $beginExp) {
    3840    $quit = 1;
    39     print "* REQUIRED: a begin exp_id                  -b <name>\n";
     41    print "* REQUIRED: a begin exp_id                              -b <name>\n";
    4042}
    4143if (!defined $endExp) {
    4244    $quit = 1;
    43     print "* REQUIRED: an end exp_id                   -e <name>\n";
     45    print "* REQUIRED: an end exp_id                               -e <name>\n";
    4446}
    4547if (!defined $dvoDb) {
    4648    $quit = 1;
    47     print "* REQUIRED: a dvo Db name                   -d <name>\n";
     49    print "* REQUIRED: a dvo Db name                               -d <name>\n";
     50}
     51if (!defined $checkNeb) {
     52    $checkNeb = 0;
     53    print "* OPTIONAL: check nebulous for unprocessed exposures    -n      (default = $checkNeb)\n";
    4854}
    4955if (!defined $verbose) {
    5056    $verbose = 0;
    51     print "* OPTIONAL: run in verbose mode             -v                   (default = $verbose)\n";
     57    print "* OPTIONAL: run in verbose mode                         -v      (default = $verbose)\n";
    5258}
    5359if (!defined $save_temps) {
    5460    $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";
    5662}
    5763print "*\n*******************************************************************************\n";
     
    7379    exit;
    7480}
     81
     82my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
     83my $timeStamp = sprintf "%4d-%02d-%02d %02d:%02d:%02d", $year+1900,$mon+1,$mday,$hour,$min,$sec;
    7584
    7685my $exposure;
     
    8291my $totalLoadFailed = 0;
    8392my $totalUnderObjIdLimit = 0;
    84 my @unprocessedExposures;
    85 my @odmFailures;
     93my $totalUnprocessed = 0;
     94my $totalUnprocessedAvailableSmfs = 0;
     95my $totalOdmFailures = 0;
     96my $totalUnprocessedMissingSmfs = 0;
     97
     98
     99open (UNPRO, ">unprocessedExposures.txt") or print "* Problem opening data file for unprocessed exposures\n";
     100open (ODMFAIL, ">odmFailures.txt") or print "* Problem opening data file for ODM failures\n";
     101
     102if ($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}
    86107
    87108foreach $exposure ( @{$exposures} ) {
    88     my ($expId) = @{$exposure};
     109    my ($batchId, $expId) = @{$exposure};
    89110
    90111    if ($ippToPspsDb->isExposureMerged($expId)) {next;}
     
    114135                }
    115136                else {
    116                
    117                     push(@odmFailures, $expId);
     137
     138                    $totalOdmFailures++;
     139                    print ODMFAIL "$expId\n";
    118140                }
    119141            }
     
    122144    else {
    123145
    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
    125178    }
    126179}
    127180
    128 my $totalUnprocessed = @unprocessedExposures;
    129 my $totalOdmFailures = @odmFailures;
     181close(UNPRO);
     182close(ODMFAIL);
     183if ($checkNeb) {
     184
     185    close(MISSSMF);
     186    close(NOTMISSSMF);
     187}
    130188my $totalProcessedNotOnDatastore = $totalProcessed - $totalOnDatastore;
    131189my $totalOnDatastoreNotLoaded = $totalOnDatastore - $totalLoadedToOdm;
    132190print "***********************************************************\n";
    133 print "* Summary of IPP->PSPS loading from the '$dvoDb' DVO database for exposures between $beginExp and $endExp:\n";
     191print "*    Summary of IPP->PSPS loading as of $timeStamp\n";
     192print "*    DVO Db = '$dvoDb'\n";
     193print "*    Exposures between $beginExp and $endExp\n";
    134194print "*\n";
    135195print "* total Exposures                            = $totalExposures\n";
     
    137197print "*   un-merged                                = $totalUnmerged\n";
    138198print "*     unprocessed by ippToPsps               = $totalUnprocessed\n";
     199if ($checkNeb) {
     200    print "*       missing SMF files                    = $totalUnprocessedMissingSmfs\n";
     201    print "*       available SMF files                  = $totalUnprocessedAvailableSmfs\n";
     202}
    139203print "*     processed by ippToPsps                 = $totalProcessed\n";
    140204print "*       not on datastore                     = $totalProcessedNotOnDatastore\n";
     
    147211print "***********************************************************\n";
    148212
    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  
    1515use ippToPsps::IppToPspsDb;
    1616use ippToPsps::Datastore;
     17#use ippToPsps::BatchManager;
    1718
    1819# globals
     
    112113my $datastore = undef;
    113114if ($datastoreProduct) {$datastore = new ippToPsps::Datastore($datastoreProduct, $verbose, $save_temps);}
     115#my $batchManager = new ippToPsps::BatchManager($ippToPspsDb, $output, $verbose, $save_temps);
    114116
    115117# check we can run programs and get camera config
Note: See TracChangeset for help on using the changeset viewer.