IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29193


Ignore:
Timestamp:
Sep 22, 2010, 9:15:55 AM (16 years ago)
Author:
rhenders
Message:

Added ability to choose starting exp ID when generating list of exposures to process

Location:
trunk/ippToPsps/perl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/ippToPsps/Gpc1Db.pm

    r28877 r29193  
    9090###########################################################################
    9191sub getExposureListFromDvoDb {
    92     my ($self, $dvoDb, $exposures) = @_;
     92    my ($self, $dvoDb, $exposures, $lastExposure) = @_;
     93
     94    if (!defined $lastExposure) {$lastExposure = 0;}
    9395
    9496    my $query = $self->{_db}->prepare(<<SQL);
     
    100102        WHERE addRun.dvodb LIKE '$dvoDb'
    101103        AND addRun.state = 'full'
     104        AND rawExp.exp_id > $lastExposure
    102105        ORDER BY exp_id ASC;
    103106SQL
    104107
    105     #AND rawExp.exp_id > 133887
    106     #AND filter = 'r.00000'
    107     #AND rawExp.dateobs <= '2010-03-12'
    108     #AND rawExp.exp_id > $lastExpId
    109     #AND camRun.label LIKE '%$label%'
    110     #AND rawExp.exp_id > 136561
    111     #AND camRun.dist_group LIKE 'sas'
    112108    #AND rawExp.decl >= '-0.157079633' AND rawExp.decl <= '0.157079633' Jims Dec range
    113109
     
    115111    ${$exposures} = $query->fetchall_arrayref();
    116112    my $numOfExposures = scalar @{${$exposures}};
    117     if ($numOfExposures > 0) {
    118    
    119         print "* Found $numOfExposures exposures in DVO Db '$dvoDb'\n";
    120         return 1;
    121     }
    122113
    123     print "* No exposures found in DVO Db '$dvoDb'\n";
    124     return 0;
     114    # message
     115    if ($numOfExposures) {print "* Found $numOfExposures exposures";}
     116    else { print "* No exposures found"; }
     117    print " in DVO Db '$dvoDb' (counting from exposure $lastExposure)\n";
     118
     119    return ($numOfExposures) ? 1 : 0;
    125120}
    126121
  • trunk/ippToPsps/perl/makeDetections.pl

    r29188 r29193  
    2121my $output = undef;
    2222my $singleExpId = undef;
     23my $lastExpId = undef;
    2324my $datastoreProduct = undef;
    2425my $force = undef;
     
    3334        'dvolocation|l=s' => \$dvoPath,
    3435        'expid|e=s' => \$singleExpId,
     36        'lastexpid|x=s' => \$lastExpId,
    3537        'product|p=s' => \$datastoreProduct,
    3638        'verbose|v' => \$verbose,
     
    6668    $singleExpId = -1;
    6769    print "* OPTIONAL: a single exposure ID            -e <expID>           (default = none)\n";
     70}
     71if (!defined $lastExpId) {
     72    $lastExpId = 0;
     73    print "* OPTIONAL: process from last exp ID        -x <expID>           (default = $lastExpId)\n";
    6874}
    6975if (!defined $datastoreProduct) {
     
    107113else {
    108114
    109     if (!$gpc1Db->getExposureListFromDvoDb($dvoDb, \$exposures)) {exit;}
     115    if (!$gpc1Db->getExposureListFromDvoDb($dvoDb, \$exposures, $lastExpId)) {exit;}
    110116}
    111117
Note: See TracChangeset for help on using the changeset viewer.