IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20814


Ignore:
Timestamp:
Nov 21, 2008, 11:55:10 AM (17 years ago)
Author:
Paul Price
Message:

Adding restriction on class_id.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/chip_outputs.pl

    r20591 r20814  
    1919
    2020my ($db_host, $db_name, $db_user, $db_pw); # Database details
    21 my ($chip_id);                  # Chip of interest
     21my ($chip_id, $class_id);       # Chip of interest
    2222my ($input);                    # Input list
    23 my ($products);                 # Products of interest
     23my ($products);                 # Products of interest
    2424
    2525GetOptions(
     
    2929           'dbpass=s' => \$db_pw, # Database p/w
    3030           'chip_id=s' => \$chip_id, # Chip identifier
    31            'products=s' => \$products, # Products of interest
     31           'class_id=s' => \$class_id, # Class identifier
     32           'products=s' => \$products, # Products of interest
    3233           ) or die "Unable to parse arguments.\n";
    3334die "Unknown option: @ARGV\n" if @ARGV;
     
    5051    " FROM chipProcessedImfile " .
    5152    " WHERE chip_id = $chip_id";
     53$sql .= " AND class_id = $class_id" if defined $class_id;
    5254
    5355# List of chips
    5456my $results = $db->selectall_arrayref( $sql ) or die "Unable to execute SQL: $DBI::errstr";
    5557
    56 my @products;                   # Array of products
     58my @products;                   # Array of products
    5759if (defined $products) {
    5860    @products = split /,/, $products;
     
    6264
    6365foreach my $row ( @$results ) {
    64     my $path = $$row[0];        # Path base
    65     my $class_id = $$row[1];    # Class identifier
     66    my $path = $$row[0];        # Path base
     67    my $class_id = $$row[1];    # Class identifier
    6668
    6769    my $name = "$path.$class_id"; # Full name
    6870    foreach my $product ( @products ) {
    69         copy_extension( $name, ${EXTENSIONS()}{$product} );
     71        copy_extension( $name, ${EXTENSIONS()}{$product} );
    7072    }
    7173}
     
    7779{
    7880    my $path = shift;           # Path to copy
    79     my $ext = shift;            # Extension to copy
     81    my $ext = shift;            # Extension to copy
    8082
    8183    my $neb = "$path$ext"; # Nebulous file
Note: See TracChangeset for help on using the changeset viewer.