Changeset 27838 for branches/tap_branches/tools/chip_outputs.pl
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tools/chip_outputs.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/tools/chip_outputs.pl
r24624 r27838 12 12 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 13 13 14 use constant MUGGLE => { 'IMAGE' => 1, 15 'MASK' => 1, 16 'VARIANCE' => 1, 17 }; 18 14 19 use constant EXTENSIONS => { 'IMAGE' => '.ch.fits', # Image 15 20 'MASK' => '.ch.mk.fits', # Mask 16 21 'VARIANCE' => '.ch.wt.fits', # Variance 17 22 'SOURCES' => '.cmf', # Sources 23 'PSF' => '.psf', # Point-spread function 24 'LOG' => '.log', # Processing log 18 25 }; 19 26 … … 22 29 my ($input); # Input list 23 30 my ($products); # Products of interest 31 my ($muggle); # Retrieve un-magicked data? 24 32 25 33 GetOptions( … … 31 39 'class_id=s' => \$class_id, # Class identifier 32 40 'products=s' => \$products, # Products of interest 41 'muggle' => \$muggle, # Retrieve un-magicked data? 33 42 ) or die "Unable to parse arguments.\n"; 34 43 die "Unknown option: @ARGV\n" if @ARGV; … … 58 67 my @products; # Array of products 59 68 if (defined $products) { 60 @products = split /,/, $products;69 @products = split(/,/, $products); 61 70 } else { 62 71 @products = keys %{EXTENSIONS()}; … … 69 78 my $name = "$path.$class_id"; # Full name 70 79 foreach my $product ( @products ) { 71 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} ); 72 88 } 73 89 } … … 83 99 my $neb = "$path$ext"; # Nebulous file 84 100 my $source = `neb-locate --path $neb`; 85 if (!$source) { 86 print "Unable to locate $neb\n"; # Actual file87 return;101 if (!$source) { 102 print "Unable to locate $neb\n"; # Actual file 103 return; 88 104 } 89 105 chomp $source; … … 91 107 my $status = system "cp $source $target"; 92 108 if ($status) { 93 print "Unable to copy $source\n";94 return;109 print "Unable to copy $source\n"; 110 return; 95 111 } 96 112 }
Note:
See TracChangeset
for help on using the changeset viewer.
