IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27699 for trunk/ippToPsps


Ignore:
Timestamp:
Apr 15, 2010, 3:24:42 PM (16 years ago)
Author:
rhenders
Message:

Added ability to run for just one exposure; improved argument handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/scripts/ippToPsps_run.pl

    r27669 r27699  
    1212
    1313# globals
    14 my ($verbose, $save_temps, $no_op, $no_update, $camera, $product, $output, $dvodb, $label, $no_publish);
     14my ($verbose, $save_temps, $no_op, $no_update, $camera, $product, $output, $dvodb, $label, $singleExpId, $no_publish);
    1515
    1616# TODO temporary until we use database to store current jobid
     
    2525$camera = 'GPC1';
    2626$output = undef;
     27$singleExpId = undef;
    2728
    2829# get user args
    2930GetOptions(
    30         'output=s' => \$output,
    31         'product=s' => \$product,
    32         'dvodb=s' => \$dvodb,
    33         'label=s' => \$label,
     31        'output|o=s' => \$output,
     32        'product|p=s' => \$product,
     33        'dvodb|d=s' => \$dvodb,
     34        'label|l=s' => \$label,
     35        'expid|e=s' => \$singleExpId,
    3436        'no_publish' => \$no_publish,
    35         'verbose' => \$verbose,
     37        'verbose|v' => \$verbose,
    3638        'save_temps' => \$save_temps,
    3739        'no-op' => \$no_op,
     
    4648        "--product <init|det|diff|stack>\n".
    4749        "--output <path>\n".
    48         "--label <label>\n" .
     50        "--label <label> | --expid <expid>\n" .
    4951        "--dvodb <path>\n\n",
    5052        -exitval => 3
     
    5355defined $output and
    5456defined $dvodb and
    55 defined $label;
     57( defined $label or defined $singleExpId );
    5658
    5759# check we can run programs and get camera config
     
    8587            ) or die "Unable to connect to database $DBI::errstr\n";
    8688
    87     # query to retrieve all exposures with the provided label
    88     my $query =
    89         "SELECT DISTINCT rawExp.exp_id ".
    90         "FROM camRun, chipRun, rawExp ".
    91         "WHERE camRun.chip_id = chipRun.chip_id ".
    92         "AND chipRun.exp_id = rawExp.exp_id ".
    93         "AND camRun.label like '%$label%' ".
    94     #    "AND rawExp.decl >= '-0.157079633' AND rawExp.decl <= '0.157079633' ". # TODO Jim's decl range
    95         "ORDER BY rawExp.exp_id ASC";
    96 
     89    my $query;
     90    if (!$singleExpId) {
     91
     92        # query to retrieve all exposures with the provided label
     93        $query =
     94            "SELECT DISTINCT rawExp.exp_id ".
     95            "FROM camRun, chipRun, rawExp ".
     96            "WHERE camRun.chip_id = chipRun.chip_id ".
     97            "AND chipRun.exp_id = rawExp.exp_id ".
     98            "AND camRun.label like '%$label%' ".
     99            #    "AND rawExp.decl >= '-0.157079633' AND rawExp.decl <= '0.157079633' ". # TODO Jim's decl range
     100            "ORDER BY rawExp.exp_id ASC";
     101    }
     102    else {
     103
     104        $query = "SELECT DISTINCT exp_id FROM rawExp WHERE rawExp.exp_id = $singleExpId"
     105
     106    }
    97107
    98108    if ($verbose) { print"$query\n";}
Note: See TracChangeset for help on using the changeset viewer.