- Timestamp:
- Aug 20, 2009, 11:49:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/cleanup/ippScripts/scripts/publish_file.pl
r25051 r25150 39 39 40 40 # Parse the command-line arguments 41 my ( $pub_id, $ exp_id, $camera, $stage, $stage_id, $format, $product, $workdir );41 my ( $pub_id, $camera, $stage, $stage_id, $format, $product, $workdir ); 42 42 my ( $dbname, $verbose, $no_update, $save_temps, $redirect ); 43 43 44 44 GetOptions( 45 45 'pub_id=s' => \$pub_id, # Publish identifier 46 'exp_id=s' => \$exp_id, # Exposure identifier47 46 'camera=s' => \$camera, # Camera name 48 47 'stage=s' => \$stage, # Stage of interest … … 58 57 59 58 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 60 pod2usage( -msg => "Required options: --pub_id -- exp_id --camera --stage --stage_id --product --workdir",59 pod2usage( -msg => "Required options: --pub_id --camera --stage --stage_id --product --workdir", 61 60 -exitval => $PS_EXIT_CONFIG_ERROR) unless 62 61 defined $pub_id and 63 defined $exp_id and64 62 defined $camera and 65 63 defined $product and … … 68 66 defined $workdir; 69 67 70 my $outroot = "$workdir/$product.$pub_id .$exp_id"; # Output root name68 my $outroot = "$workdir/$product.$pub_id"; # Output root name 71 69 72 70 my $ipprc = PS::IPP::Config->new( $camera ) or … … 83 81 my %files; # Input filenames 84 82 my %zp; # Zero points 83 my %exp_id; # Exposure identifiers 84 my %exp_name; # Exposure names 85 my %direction; # Direction of subtraction 85 86 { 86 87 my $command; # Command to run … … 114 115 if ($stage eq 'diff') { 115 116 my $skycell_id = $comp->{skycell_id}; 117 118 # Positive direction 116 119 $files{"$skycell_id.pos"} = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base ); 117 $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base ) if118 defined $comp->{bothways} and $comp->{bothways};119 120 $zp{"$skycell_id.pos"} = $zp; 120 $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways}; 121 $exp_id{"$skycell_id.pos"} = $comp->{exp_id_1}; 122 $exp_name{"$skycell_id.pos"} = $comp->{exp_name_1}; 123 $direction{"$skycell_id.pos"} = 1; 124 125 # Negative direction 126 if (defined $comp->{bothways} and $comp->{bothways}) { 127 $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base ); 128 $zp{"$skycell_id.neg"} = $zp; 129 $exp_id{"$skycell_id.neg"} = $comp->{exp_id_2}; 130 $direction{"$skycell_id.neg"} = 0; 131 $exp_name{"$skycell_id.neg"} = $comp->{exp_name_2}; 132 } 133 121 134 } elsif ($stage eq 'camera') { 122 135 my $cam_id = $comp->{cam_id}; 123 136 $files{$cam_id} = $ipprc->filename( "PSASTRO.OUTPUT", $path_base ); 124 137 $zp{$cam_id} = $zp; 138 $exp_id{$cam_id} = $comp->{exp_id}; 139 $exp_name{$cam_id} = $comp->{exp_name}; 140 $direction{$cam_id} = 1; 125 141 } 126 142 } … … 137 153 138 154 my $zp = $zp{$comp}; 155 my $exp_id = $exp_id{$comp}; 156 my $exp_name = $exp_name{$comp}; 157 my $direction = $direction{$comp}; 139 158 if ($product eq "IPP-MOPS") { 140 159 my $outuri = "$outroot.$comp.fits"; … … 142 161 &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR); 143 162 144 my $command = "$ppMops $file $zp $ out";163 my $command = "$ppMops $file $zp $exp_id $exp_name $direction $out"; 145 164 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 146 165 run(command => $command, verbose => $verbose);
Note:
See TracChangeset
for help on using the changeset viewer.
