IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27026


Ignore:
Timestamp:
Feb 22, 2010, 12:11:41 PM (16 years ago)
Author:
Paul Price
Message:

Allow un-magicked data to be retrieved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diff_outputs.pl

    r26797 r27026  
    3535                             'JPEG1' => '.b1.jpg', # Binned JPEG
    3636                             'JPEG2' => '.b2.jpg', # Binned JPEG
    37                              'KERNEL' => '.subkernel', # Convolution kernel
     37#                             'KERNEL' => '.subkernel', # Convolution kernel
    3838                             'INVERSE.IMAGE' => '.inv.fits', # Image
    3939                             'INVERSE.MASK' => '.inv.mask.fits', # Mask
     
    4949                         };
    5050
     51# Products that get magicked
     52use constant MAGIC => { 'IMAGE' => 1,
     53                        'MASK' => 1,
     54                        'VARIANCE' => 1,
     55                        'SOURCES' => 1,
     56                        'INVERSE.IMAGE' => 1,
     57                        'INVERSE.MASK' => 1,
     58                        'INVERSE.VARIANCE' => 1,
     59                        'INVERSE.SOURCES' => 1,
     60};
     61
     62
    5163my ($db_host, $db_name, $db_user, $db_pw); # Database details
    5264my ($diff_id, $skycell_id);     # Diff and skycell of interest
    5365my ($input);                    # Input list
    5466my ($products);                 # Products of interest
     67my ($muggle);                   # Not magicked?
    5568
    5669GetOptions(
     
    6275           'skycell_id=s' => \$skycell_id, # Skycell identifier
    6376           'products=s' => \$products, # Products of interest
     77           'muggle'   => \$muggle, # Not magicked?
    6478           ) or die "Unable to parse arguments.\n";
    6579die "Unknown option: @ARGV\n" if @ARGV;
     
    105119    foreach my $product ( @products ) {
    106120        next if (not defined $diff->{bothways} or $diff->{bothways} eq 'NULL' or not $diff->{bothways}) and $product =~ /INVERSE/;
    107         copy_extension( $diff->{path_base}, ${EXTENSIONS()}{$product} );
     121        my $path = $diff->{path_base};
     122        if (defined $muggle and defined ${MAGIC()}{$product}) {
     123            my @path = split /\//, $path;
     124            my $last = pop @path;
     125            push @path, "SR_$last";
     126            $path = join '/', @path;
     127        }
     128        copy_extension( $path, ${EXTENSIONS()}{$product} );
    108129    }
    109130}
Note: See TracChangeset for help on using the changeset viewer.