- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tools/diff_outputs.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/tools/diff_outputs.pl
r24224 r27840 8 8 use strict; 9 9 10 use Carp; 10 11 use DBI; 11 12 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; # Socket for mysql … … 15 16 use constant PRODUCTS => { 'REGULAR' => [ 'IMAGE', 'MASK', 'VARIANCE', 16 17 'SOURCES', 'JPEG1', 'JPEG2', 17 'KERNEL' ], 18 'ALL' => [ 'IMAGE', 'MASK', 'VARIANCE', 19 'SOURCES', 'JPEG1', 'JPEG2', 20 'KERNEL', 'INVERSE.IMAGE', 21 'INVERSE.MASK', 'INVERSE.VARIANCE', 22 'INVERSE.SOURCES' ], 18 'KERNEL', 'LOG' ], 19 'ALL' => [ 'IMAGE', 'MASK', 'VARIANCE', 'SOURCES', 'JPEG1', 'JPEG2', 'KERNEL', 20 'INVERSE.IMAGE', 'INVERSE.MASK', 'INVERSE.VARIANCE', 'INVERSE.SOURCES', 21 # 'INCONV.IMAGE', 'INCONV.MASK', 'INCONV.VARIANCE', 22 # 'REFCONV.IMAGE', 'REFCONV.MASK', 'REFCONV.VARIANCE', 23 'LOG', 24 ], 23 25 'INVERSE' => [ 'INVERSE.IMAGE', 'INVERSE.MASK', 24 26 'INVERSE.VARIANCE', 25 'INVERSE.SOURCES' ], 27 'INVERSE.SOURCES', 28 'LOG', ], 26 29 }; 27 30 … … 38 41 'INVERSE.VARIANCE' => '.inv.wt.fits', # Variance 39 42 'INVERSE.SOURCES' => '.inv.cmf', # Sources 43 'INCONV.IMAGE' => '.inConv.fits', # Convolved input image 44 'INCONV.MASK' => '.inConv.mk.fits', # Convolved input mask 45 'INCONV.VARIANCE' => '.inConv.wt.fits', # Convolved input variance 46 'REFCONV.IMAGE' => '.refConv.fits', # Convolved reference image 47 'REFCONV.MASK' => '.refConv.mk.fits', # Convolved reference mask 48 'REFCONV.VARIANCE' => '.refConv.wt.fits', # Convolved reference variance 49 'LOG' => '.log', # Log file 40 50 }; 51 52 # Products that get magicked 53 use constant MAGIC => { 'IMAGE' => 1, 54 'MASK' => 1, 55 'VARIANCE' => 1, 56 'SOURCES' => 1, 57 'INVERSE.IMAGE' => 1, 58 'INVERSE.MASK' => 1, 59 'INVERSE.VARIANCE' => 1, 60 'INVERSE.SOURCES' => 1, 61 }; 62 41 63 42 64 my ($db_host, $db_name, $db_user, $db_pw); # Database details … … 44 66 my ($input); # Input list 45 67 my ($products); # Products of interest 68 my ($muggle); # Not magicked? 46 69 47 70 GetOptions( … … 53 76 'skycell_id=s' => \$skycell_id, # Skycell identifier 54 77 'products=s' => \$products, # Products of interest 78 'muggle' => \$muggle, # Not magicked? 55 79 ) or die "Unable to parse arguments.\n"; 56 80 die "Unknown option: @ARGV\n" if @ARGV; … … 96 120 foreach my $product ( @products ) { 97 121 next if (not defined $diff->{bothways} or $diff->{bothways} eq 'NULL' or not $diff->{bothways}) and $product =~ /INVERSE/; 98 copy_extension( $diff->{path_base}, ${EXTENSIONS()}{$product} ); 122 my $path = $diff->{path_base}; 123 if (defined $muggle and defined ${MAGIC()}{$product}) { 124 my @path = split /\//, $path; 125 my $last = pop @path; 126 push @path, "SR_$last"; 127 $path = join '/', @path; 128 } 129 copy_extension( $path, ${EXTENSIONS()}{$product} ); 99 130 } 100 131 } … … 110 141 111 142 my $file = "$path$ext"; # File 112 my $source = `ipp_datapath.pl $file` or die "Unable to locate $file\n"; # Actual file143 my $source = `ipp_datapath.pl $file` or (carp "Unable to locate $file\n" and return); # Actual file 113 144 chomp $source; 114 145 my ($target) = $source =~ m|^.*[:/](.*)|; # Target name 115 !system "cp $source $target" or die"Unable to copy $source\n";146 !system "cp $source $target" or carp "Unable to copy $source\n"; 116 147 }
Note:
See TracChangeset
for help on using the changeset viewer.
