Changeset 16559 for trunk/ippScripts/scripts/ipp_serial_detrend.pl
- Timestamp:
- Feb 21, 2008, 8:57:30 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_serial_detrend.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_serial_detrend.pl
r14959 r16559 7 7 use Pod::Usage qw( pod2usage ); 8 8 use IPC::Cmd 0.36 qw( can_run run ); 9 use PS::IPP::Metadata::Config ;9 use PS::IPP::Metadata::Config qw( caturi ); 10 10 use PS::IPP::Metadata::List qw( parse_md_list ); 11 11 use Data::Dumper; 12 12 13 13 my ($dbname, # Database name to use 14 $workdir_global # Global working directory 14 15 ); 15 16 GetOptions( … … 68 69 my $reduction = $item->{reduction}; 69 70 70 my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname"; 71 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 72 die "No working directory specified.\n" unless defined $workdir; 73 74 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detproc.$det_id" ); 75 76 my $command = "$detrend_process_imfile --det_id $det_id --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --input_uri $uri --camera $camera --dbname $dbname --outroot $outroot"; 71 77 $command .= " --reduction $reduction" if defined $reduction; 72 $command .= " --workdir $workdir" if defined $workdir;73 78 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 74 79 run( command => $command, verbose => 1 ); … … 99 104 my $workdir = $item->{workdir}; 100 105 101 my $command = "$detrend_process_exp --det_id $det_id --det_type $det_type --exp_tag $exp_tag --exp_id $exp_id --camera $camera --dbname $dbname"; 102 $command .= " --workdir $workdir" if defined $workdir; 106 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 107 die "No working directory specified.\n" unless defined $workdir; 108 109 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detproc.$det_id" ); 110 111 my $command = "$detrend_process_exp --det_id $det_id --det_type $det_type --exp_tag $exp_tag --exp_id $exp_id --camera $camera --dbname $dbname --outroot $outroot"; 103 112 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 104 113 run( command => $command, verbose => 1 ); … … 125 134 my $reduction = $item->{reduction}; 126 135 127 my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera --dbname $dbname"; 136 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 137 die "No working directory specified.\n" unless defined $workdir; 138 139 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.$det_id.$iteration" ); 140 141 my $command = "$detrend_stack --det_id $det_id --iteration $iteration --class_id $class_id --det_type $det_type --camera $camera --dbname $dbname --outroot $outroot"; 128 142 $command .= " --reduction $reduction" if defined $reduction; 129 $command .= " --workdir $workdir" if defined $workdir;130 143 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 131 144 run( command => $command, verbose => 1 ); … … 147 160 my $iteration = $item->{iteration}; 148 161 my $det_type = $item->{det_type}; 149 my $workdir = $item->{workdir}; 150 151 my $command = "$detrend_norm_calc --det_id $det_id --iteration $iteration --det_type $det_type --dbname $dbname"; 152 $command .= " --workdir $workdir" if defined $workdir; 162 my $camera = $item->{camera}; 163 my $workdir = $item->{workdir}; 164 165 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 166 die "No working directory specified.\n" unless defined $workdir; 167 168 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.normstat.$det_id.$iteration" ); 169 170 my $command = "$detrend_norm_calc --det_id $det_id --iteration $iteration --det_type $det_type --dbname $dbname --outroot $outroot"; 153 171 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 154 172 run( command => $command, verbose => 1 ); … … 176 194 my $workdir = $item->{workdir}; 177 195 178 my $command = "$detrend_norm_apply --det_id $det_id --iteration $iteration --class_id $class_id --value $value --input_uri $uri --camera $camera --det_type $det_type --dbname $dbname"; 179 $command .= " --workdir $workdir" if defined $workdir; 196 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 197 die "No working directory specified.\n" unless defined $workdir; 198 199 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.norm.$det_id.$iteration" ); 200 201 my $command = "$detrend_norm_apply --det_id $det_id --iteration $iteration --class_id $class_id --value $value --input_uri $uri --camera $camera --det_type $det_type --dbname $dbname --outroot $outroot"; 180 202 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 181 203 run( command => $command, verbose => 1 ); … … 203 225 my $workdir = $item->{workdir}; 204 226 205 my $command = "$detrend_norm_exp --det_id $det_id --iteration $iteration --camera $camera --det_type $det_type --dbname $dbname"; 206 $command .= " --workdir $workdir" if defined $workdir; 227 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 228 die "No working directory specified.\n" unless defined $workdir; 229 230 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.normexp.$det_id.$iteration" ); 231 232 my $command = "$detrend_norm_exp --det_id $det_id --iteration $iteration --camera $camera --det_type $det_type --dbname $dbname --outroot $outroot"; 207 233 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 208 234 run( command => $command, verbose => 1 ); … … 244 270 my $reduction = $item->{reduction}; 245 271 246 my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname"; 272 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 273 die "No working directory specified.\n" unless defined $workdir; 274 275 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detresid.$det_id.$iteration" ); 276 277 my $command = "$detrend_resid --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --class_id $class_id --det_type $det_type --camera $camera --input_uri $uri --mode $mode --dbname $dbname --outroot $outroot"; 247 278 $command .= " --reduction $reduction" if defined $reduction; 248 279 $command .= " --detrend $detrend" if defined $detrend; 249 $command .= " --workdir $workdir" if defined $workdir;250 280 251 281 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 278 308 my $workdir = $item->{workdir}; 279 309 280 my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --det_type $det_type --camera $camera --dbname $dbname"; 281 $command .= " --workdir $workdir" if defined $workdir; 310 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 311 die "No working directory specified.\n" unless defined $workdir; 312 313 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", $exp_tag, "$exp_tag.detresid.$det_id.$iteration" ); 314 315 my $command = "$detrend_reject_imfile --det_id $det_id --iteration $iteration --exp_tag $exp_tag --exp_id $exp_id --det_type $det_type --camera $camera --dbname $dbname --outroot $outroot"; 282 316 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 283 317 run( command => $command, verbose => 1 ); … … 302 336 my $workdir = $item->{workdir}; 303 337 304 my $command = "$detrend_reject_exp --det_id $det_id --iteration $iteration --det_type $det_type --camera $camera --dbname $dbname"; 305 $command .= " --workdir $workdir" if defined $workdir; 338 $workdir = $workdir_global unless defined $workdir and $workdir ne "NULL"; 339 die "No working directory specified.\n" unless defined $workdir; 340 341 my $outroot = caturi( $workdir, "$camera.$det_type.$det_id", "$camera.$det_type.$det_id.$iteration.detreject" ); 342 343 my $command = "$detrend_reject_exp --det_id $det_id --iteration $iteration --det_type $det_type --camera $camera --dbname $dbname --outroot $outroot"; 306 344 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 307 345 run( command => $command, verbose => 1 );
Note:
See TracChangeset
for help on using the changeset viewer.
