Changeset 20434 for trunk/tools/stack_inputs.pl
- Timestamp:
- Oct 28, 2008, 9:25:52 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/tools/stack_inputs.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/stack_inputs.pl
r20432 r20434 12 12 13 13 # Extensions of the path_base to grab 14 use constant EXTENSIONS => ['.fits', # Image15 ' .mask.fits', # Mask16 ' .wt.fits', # Weight17 ' .cmf', # Sources18 ' .psf', # PSF19 ];14 use constant EXTENSIONS => { 'IMAGE' => '.fits', # Image 15 'MASK' => '.mask.fits', # Mask 16 'WEIGHT' => '.wt.fits', # Weight 17 'SOURCES' => '.cmf', # Sources 18 'PSF' => '.psf', # PSF 19 }; 20 20 21 21 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 23 23 my ($db_host, $db_name, $db_user, $db_pw); # Database details 24 24 my ($stack_id); # Stack of interest 25 my ($input); # Input list 25 26 26 27 GetOptions( … … 30 31 'dbpass=s' => \$db_pw, # Database p/w 31 32 'stack_id=s' => \$stack_id, # Stack identifier 33 'input=s' => \$input, # Input list to generate 32 34 ) or die "Unable to parse arguments.\n"; 33 35 die "Unknown option: @ARGV\n" if @ARGV; … … 59 61 $db->disconnect; 60 62 63 my $list; # List of inputs 64 if (defined $input) { 65 open $list, "> $input"; 66 print $list "INPUT MULTI\n\n"; 67 } 68 61 69 foreach my $warp_path ( @$warps ) { 62 foreach my $ext ( @{EXTENSIONS()} ) { 70 print $list "INPUT METADATA\n" if defined $input; 71 foreach my $type ( keys @{EXTENSIONS()} ) { 72 my $ext = ${EXTENSIONS()}{$type}; # Extension 63 73 my $neb = "$warp_path$ext"; # Nebulous file 64 74 my $source = `neb-locate --path $neb` or die "Unable to locate $neb\n"; # Actual file … … 66 76 my ($target) = $source =~ m|^.*:(.*)|; # Target name 67 77 !system "cp $source $target" or die "Unable to copy $source\n"; 78 print $list "\t$type\tSTR\t$target\n" if defined $input; 68 79 } 80 print $list "END\n\n" if defined $input; 69 81 } 82
Note:
See TracChangeset
for help on using the changeset viewer.
