IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27690


Ignore:
Timestamp:
Apr 14, 2010, 4:49:51 PM (16 years ago)
Author:
Paul Price
Message:

Add muggle flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/chip_outputs.pl

    r27668 r27690  
    1212use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    1313
     14use constant MUGGLE => { 'IMAGE' => 1,
     15                         'MASK' => 1,
     16                         'VARIANCE' => 1,
     17};
     18
    1419use constant EXTENSIONS => { 'IMAGE' => '.ch.fits', # Image
    1520                             'MASK' => '.ch.mk.fits', # Mask
     
    2429my ($input);                    # Input list
    2530my ($products);                 # Products of interest
     31my ($muggle);                   # Retrieve un-magicked data?
    2632
    2733GetOptions(
     
    3339           'class_id=s' => \$class_id, # Class identifier
    3440           'products=s' => \$products, # Products of interest
     41           'muggle' => \$muggle, # Retrieve un-magicked data?
    3542           ) or die "Unable to parse arguments.\n";
    3643die "Unknown option: @ARGV\n" if @ARGV;
     
    6067my @products;                   # Array of products
    6168if (defined $products) {
    62     @products = split /,/, $products;
     69    @products = split(/,/, $products);
    6370} else {
    6471    @products = keys %{EXTENSIONS()};
     
    7178    my $name = "$path.$class_id"; # Full name
    7279    foreach my $product ( @products ) {
    73         copy_extension( $name, ${EXTENSIONS()}{$product} );
     80        my $base = $name;
     81        if ($muggle and defined ${MUGGLE()}{$product}) {
     82            my @file = split /\//, $base;
     83            my $last = pop @file;
     84            push @file, "SR_$last";
     85            $base = join '/', @file;
     86        }
     87        copy_extension( $base, ${EXTENSIONS()}{$product} );
    7488    }
    7589}
Note: See TracChangeset for help on using the changeset viewer.