Changeset 16176
- Timestamp:
- Jan 21, 2008, 4:56:26 PM (18 years ago)
- Location:
- branches/eam_branch_20080121
- Files:
-
- 21 edited
-
ippScripts/scripts/camera_exp.pl (modified) (9 diffs)
-
ippScripts/scripts/chip_imfile.pl (modified) (5 diffs)
-
ippScripts/scripts/detrend_norm_apply.pl (modified) (6 diffs)
-
ippScripts/scripts/detrend_norm_calc.pl (modified) (2 diffs)
-
ippScripts/scripts/detrend_norm_exp.pl (modified) (6 diffs)
-
ippScripts/scripts/detrend_process_exp.pl (modified) (6 diffs)
-
ippScripts/scripts/detrend_process_imfile.pl (modified) (5 diffs)
-
ippScripts/scripts/detrend_reject_exp.pl (modified) (4 diffs)
-
ippScripts/scripts/detrend_reject_imfile.pl (modified) (7 diffs)
-
ippScripts/scripts/detrend_resid.pl (modified) (5 diffs)
-
ippScripts/scripts/detrend_stack.pl (modified) (4 diffs)
-
ippTasks/camera.pro (modified) (2 diffs)
-
ippTasks/chip.pro (modified) (2 diffs)
-
ippTasks/detrend.norm.pro (modified) (6 diffs)
-
ippTasks/detrend.process.pro (modified) (3 diffs)
-
ippTasks/detrend.reject.pro (modified) (2 diffs)
-
ippTasks/detrend.resid.pro (modified) (4 diffs)
-
ippTasks/detrend.stack.pro (modified) (2 diffs)
-
ippTasks/notes.txt (modified) (2 diffs)
-
ippTasks/pantasks.pro (modified) (1 diff)
-
ippTasks/summit.copy.pro (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080121/ippScripts/scripts/camera_exp.pl
r16018 r16176 37 37 use Pod::Usage qw( pod2usage ); 38 38 39 my ($exp_tag, $cam_id, $ recipe, $camera, $dbname, $workdir, $reduction, $dvodb, $no_update, $no_op);39 my ($exp_tag, $cam_id, $camera, $outroot, $recipe, $dbname, $reduction, $dvodb, $no_update, $no_op); 40 40 GetOptions( 41 41 'exp_tag=s' => \$exp_tag, # Exposure identifier … … 44 44 'camera|c=s' => \$camera, # Camera 45 45 'dbname|d=s' => \$dbname, # Database name 46 ' workdir|w=s' => \$workdir, # Working directory46 'outroot|w=s' => \$outroot, # output file base name 47 47 'reduction=s' => \$reduction, # Reduction class 48 48 'dvodb|w=s' => \$dvodb, # output DVO database … … 55 55 -msg => "Required options: --exp_tag --cam_id --camera", 56 56 -exitval => 3, 57 ) unless defined $exp_tag 58 and defined $cam_id 59 and defined $camera; 57 ) unless 58 defined $exp_tag and 59 defined $cam_id and 60 defined $outroot and 61 defined $camera; 60 62 61 63 $ipprc->define_camera($camera); … … 136 138 } 137 139 140 ### not needed to have such an extensive temp file name. 138 141 my ($list1File, $list1Name) = tempfile( "$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => 1 ); # For binning 1 139 142 my ($list2File, $list2Name) = tempfile( "$exp_tag.cm.$cam_id.b2.list.XXXX", UNLINK => 1 ); # For binning 2 … … 162 165 163 166 # Output products 164 $workdir = caturi( $workdir, $exp_tag ) if defined $workdir; 165 my $outputRoot = $ipprc->file_prepare( "$exp_tag.cm.$cam_id", $workdir, ${$files}[0]->{path_base} ); 166 167 my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1 168 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 169 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT.MEF", $outputRoot); # MEF psastro output 170 171 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".trace"; # Trace messages 172 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".log"; # Log messages 167 $ipprc->outroot_prepare($outroot); 168 169 my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 170 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 171 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT.MEF", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 172 my $traceDest = $ipprc->filename("TRACE.EXP", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 173 my $logDest = $ipprc->filename("LOG.EXP", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); 173 174 174 175 # convert supplied DVO database name to UNIX filename … … 184 185 # Make the jpeg for binning 1 185 186 { 186 my $command = "$ppImage -list $list1Name $out putRoot -recipe PPIMAGE $recipe1"; # Command to run187 my $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run 187 188 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 188 189 run(command => $command, verbose => 1); … … 196 197 # Make the jpeg for binning 2 197 198 { 198 my $command = "$ppImage -list $list2Name $out putRoot -recipe PPIMAGE $recipe2"; # Command to run199 my $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run 199 200 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 200 201 run(command => $command, verbose => 1); … … 229 230 # XXX add a ppStats call which will collect the astrometry stats 230 231 my $command; 231 $command = "$psastro -list $list3Name $out putRoot";232 $command = "$psastro -list $list3Name $outroot"; 232 233 $command .= " +mosastro -chipastro"; 233 234 $command .= " -F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF"; … … 276 277 $fpaCommand .= " -cam_id $cam_id"; 277 278 $fpaCommand .= " -uri UNKNOWN"; 278 $fpaCommand .= " -path_base $out putRoot";279 $fpaCommand .= " -path_base $outroot"; 279 280 $fpaCommand .= " -dbname $dbname" if defined $dbname; 280 281 $fpaCommand .= $chipStats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/chip_imfile.pl
r15466 r16176 33 33 34 34 # Parse the command-line arguments 35 my ($exp_id, $ chip_id, $class_id, $uri, $exp_tag, $camera, $dbname, $workdir, $reduction, $no_update, $no_op);35 my ($exp_id, $exp_tag, $chip_id, $class_id, $uri, $camera, $outroot, $dbname, $reduction, $no_update, $no_op); 36 36 GetOptions( 37 37 'exp_id=s' => \$exp_id, # Exposure identifier 38 'exp_tag=s' => \$exp_tag, # Exposure identifier 38 39 'chip_id=s' => \$chip_id, # Chiptool identifier 39 40 'class_id=s' => \$class_id, # Class identifier 40 41 'uri|u=s' => \$uri, # Input FITS file 41 42 'camera|c=s' => \$camera, # Camera 43 'outroot|w=s' => \$outroot, # output file base name 42 44 'dbname|d=s' => \$dbname, # Database name 43 'exp_tag=s' => \$exp_tag, # Exposure identifier44 'workdir|w=s' => \$workdir, # Working directory, for output files45 45 'reduction=s' => \$reduction, # Reduction class 46 46 'no-update' => \$no_update, # Don't update the database? … … 49 49 50 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 51 pod2usage( -msg => "Required options: --exp_id --exp_tag --chip_id --class_id --uri --camera ",51 pod2usage( -msg => "Required options: --exp_id --exp_tag --chip_id --class_id --uri --camera --outroot", 52 52 -exitval => 3) unless 53 53 defined $exp_id and 54 defined $exp_tag and 54 55 defined $chip_id and 55 56 defined $class_id and 56 57 defined $uri and 57 defined $ exp_tagand58 defined $ camera;58 defined $camera and 59 defined $outroot; 59 60 60 61 $ipprc->define_camera($camera); … … 100 101 &my_die("Couldn't find input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri); 101 102 102 $workdir = caturi( $workdir, $exp_tag ) if defined $workdir; 103 104 my $outputRoot = $ipprc->file_prepare( "$exp_tag.ch.$chip_id", $workdir, $uri ); 105 106 my $outputImage = $ipprc->filename("PPIMAGE.CHIP", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 107 my $outputMask = $ipprc->filename("PPIMAGE.CHIP.MASK", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 108 my $outputWeight = $ipprc->filename("PPIMAGE.CHIP.WEIGHT", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 109 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 110 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 111 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 112 113 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages 114 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages 103 # outroot examples (HOST components must be set) 104 # file://data/ipp004.0/gpc1/20080130 105 # neb:///ipp004-v1/gpc1/20080130 106 # neb:///*/gpc1/20080130 (volume not specified) 107 108 # check for existing directory, generate if needed 109 $ipprc->outroot_prepare($outroot); 110 111 ## these names are used in ppImage, and thus may be URIs 112 my $outputImage = $ipprc->filename("PPIMAGE.CHIP", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 113 my $outputMask = $ipprc->filename("PPIMAGE.CHIP.MASK", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 114 my $outputWeight = $ipprc->filename("PPIMAGE.CHIP.WEIGHT", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 115 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 116 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 117 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 118 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 119 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 115 120 116 121 # Run ppImage 117 122 unless ($no_op) { 118 my $command = "$ppImage -file $uri $outputRoot"; 123 ## XXX can we convert ppImage log and trace to use the filerules to generate consistent names 124 ## XXX also stats: output should be implied by $outroot 125 my $command = "$ppImage -file $uri $outroot"; 119 126 $command .= " -recipe PPIMAGE $recipe"; 120 127 $command .= " -recipe PPSTATS CHIPSTATS"; … … 130 137 } 131 138 132 &my_die("Couldn't find expected output file: $outputImage\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage);133 &my_die("Couldn't find expected output file: $outputMask\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask);134 &my_die("Couldn't find expected output file: $outputWeight\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight);135 &my_die("Couldn't find expected output file: $outputBin1\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1);136 &my_die("Couldn't find expected output file: $outputBin2\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2);137 &my_die("Couldn't find expected output file: $outputStats\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats);139 &my_die("Couldn't find expected output file: $outputImage\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputImage); 140 &my_die("Couldn't find expected output file: $outputMask\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputMask); 141 &my_die("Couldn't find expected output file: $outputWeight\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputWeight); 142 &my_die("Couldn't find expected output file: $outputBin1\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1); 143 &my_die("Couldn't find expected output file: $outputBin2\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2); 144 &my_die("Couldn't find expected output file: $outputStats\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStats); 138 145 139 146 # Get the statistics on the processed image … … 162 169 $command .= " -class_id $class_id"; 163 170 $command .= " -uri $outputImage"; 164 $command .= " -path_base $out putRoot";171 $command .= " -path_base $outroot"; 165 172 $command .= " -dbname $dbname" if defined $dbname; 166 173 $command .= $stats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/detrend_norm_apply.pl
r15918 r16176 33 33 34 34 # Parse the command-line 35 my ($det_id, $iter, $class_id, $value, $input_uri, $camera, $det_type, $ dbname, $workdir, $no_update, $no_op);35 my ($det_id, $iter, $class_id, $value, $input_uri, $camera, $det_type, $outroot, $dbname, $no_update, $no_op); 36 36 GetOptions( 37 37 'det_id|d=s' => \$det_id, # Detrend ID … … 42 42 'camera|c=s' => \$camera, # Camera 43 43 'det_type|t=s' => \$det_type, # Detrend type 44 'outroot|w=s' => \$outroot, # output file base name 44 45 'dbname|d=s' => \$dbname, # Database name 45 'workdir|w=s' => \$workdir, # Working directory, for output files46 46 'no-update' => \$no_update, # Don't update the database 47 47 'no-op' => \$no_op, # Don't do any operations … … 49 49 50 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type", 52 -exitval => 3) 53 unless defined $det_id 54 and defined $iter 55 and defined $class_id 56 and defined $value 57 and defined $input_uri 58 and defined $camera 59 and defined $det_type; 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type --outroot", 52 -exitval => 3) unless 53 defined $det_id and 54 defined $iter and 55 defined $class_id and 56 defined $value and 57 defined $input_uri and 58 defined $camera and 59 defined $det_type and 60 defined $outroot; 60 61 61 62 $ipprc->define_camera($camera); … … 90 91 &my_die("Couldn't find input file: $input_uri\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri); 91 92 92 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 93 94 my $outputRoot = $ipprc->file_prepare( "$camera.$det_type.norm.$det_id.$iter", $workdir, $input_uri ); 95 96 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); 97 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id); 98 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id); 99 my $statsName = $ipprc->filename("PPIMAGE.STATS", $outputRoot, $class_id); 100 101 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages 102 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages 93 # outroot examples (HOST components must be set) 94 # file://data/ipp004.0/gpc1/20080130 95 # neb:///ipp004-v1/gpc1/20080130 96 # neb:///*/gpc1/20080130 (volume not specified) 97 98 # check for existing directory, generate if needed 99 $ipprc->outroot_prepare($outroot); 100 101 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 102 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 103 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 104 my $statsName = $ipprc->filename("PPIMAGE.STATS", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 105 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 106 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 103 107 104 108 # Run normalisation 105 109 unless ($no_op) { 106 my $command = "$ppImage -file $input_uri $out putRoot";110 my $command = "$ppImage -file $input_uri $outroot"; 107 111 $command .= " -norm $value -stats $statsName"; 108 112 $command .= " -recipe PPIMAGE $RECIPE_PPIMAGE"; … … 118 122 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $class_id, $error_code); 119 123 } 120 &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($output);121 &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b1name);122 &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b2name);124 &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($output); 125 &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b1name); 126 &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b2name); 123 127 &my_die("Can't find expected output file: $statsName", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($statsName); 124 128 … … 149 153 $command .= " -class_id $class_id"; 150 154 $command .= " -uri $output"; 151 $command .= " -path_base $out putRoot";155 $command .= " -path_base $outroot"; 152 156 $command .= " -dbname $dbname" if defined $dbname; 153 157 $command .= $stats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/detrend_norm_calc.pl
r15616 r16176 32 32 33 33 # Parse command-line arguments 34 my ($det_id, $iter, $detType, $ workdir, $dbname, $no_update, $no_op);34 my ($det_id, $iter, $detType, $outroot, $dbname, $no_update, $no_op); 35 35 GetOptions( 36 36 'det_id|d=s' => \$det_id, # Detrend id 37 37 'iteration|i=s' => \$iter, # Iteration 38 38 'det_type|t=s' => \$detType, # Detrend type 39 'workdir|w=s' => \$workdir, # Working directory for output files 39 'outroot|w=s' => \$outroot, # output file base name 40 40 'dbname|d=s' => \$dbname, # Database name 41 41 'no-update' => \$no_update, # Don't update the database? … … 44 44 45 45 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 46 pod2usage( -msg => "Required options --det_id --iteration --det_type ",46 pod2usage( -msg => "Required options --det_id --iteration --det_type --outroot", 47 47 -exitval => 3, 48 ) 49 unless defined $det_id 50 and defined $iter 51 and defined $detType; 48 ) unless 49 defined $det_id and 50 defined $iter and 51 defined $detType and 52 defined $outroot; 52 53 53 54 use constant STATISTIC => 'bg'; # Background statistic to use from the database -
branches/eam_branch_20080121/ippScripts/scripts/detrend_norm_exp.pl
r15853 r16176 35 35 use Pod::Usage qw( pod2usage ); 36 36 37 my ($det_id, $iter, $det_type, $camera, $ dbname, $workdir, $reduction, $no_update, $no_op);37 my ($det_id, $iter, $det_type, $camera, $outroot, $dbname, $reduction, $no_update, $no_op); 38 38 GetOptions( 39 39 'det_id|d=s' => \$det_id, … … 41 41 'camera|c=s' => \$camera, 42 42 'det_type|t=s' => \$det_type, 43 'outroot|w=s' => \$outroot, # output file base name 43 44 'dbname|d=s' => \$dbname, # Database name 44 'workdir|w=s' => \$workdir, # Working directory, for output files45 45 'reduction|=s' => \$reduction, 46 46 'no-update' => \$no_update, … … 49 49 50 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 51 pod2usage( -msg => "Required options: --det_id --iteration --camera --det_type", 52 -exitval => 3) 53 unless defined $det_id 54 and defined $iter 55 and defined $camera 56 and defined $det_type; 51 pod2usage( -msg => "Required options: --det_id --iteration --camera --det_type --outroot", 52 -exitval => 3) unless 53 defined $det_id and 54 defined $iter and 55 defined $camera and 56 defined $det_type and 57 defined $outroot; 57 58 58 59 $ipprc->define_camera($camera); … … 126 127 close $list2File; 127 128 128 # Output products 129 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 130 my $outputRoot = $ipprc->file_prepare( "$camera.$det_type.norm.$det_id.$iter", $workdir ); 131 my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1 132 my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 129 # outroot examples (HOST components must be set) 130 # file://data/ipp004.0/gpc1/20080130 131 # neb:///ipp004-v1/gpc1/20080130 132 # neb:///*/gpc1/20080130 (volume not specified) 133 134 # check for existing directory, generate if needed 135 $ipprc->outroot_prepare($outroot); 136 137 my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outroot); # Binned JPEG #1 138 my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outroot); # Binned JPEG #2 133 139 134 140 unless ($no_op) { 135 141 # Make the jpeg for binning 1 136 $command = "$ppImage -list $list1Name $out putRoot -recipe PPIMAGE $recipe1"; # Command to run142 $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run 137 143 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 138 144 run(command => $command, verbose => 1); … … 140 146 141 147 # Make the jpeg for binning 2 142 $command = "$ppImage -list $list2Name $out putRoot -recipe PPIMAGE $recipe2"; # Command to run148 $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run 143 149 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 144 150 run(command => $command, verbose => 1); … … 152 158 $command .= " -iteration $iter"; 153 159 $command .= " -recip $recipe1,$recipe2"; 154 $command .= " -path_base $out putRoot ";160 $command .= " -path_base $outroot "; 155 161 $command .= " -dbname $dbname" if defined $dbname; 156 162 $command .= $stats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/detrend_process_exp.pl
r15643 r16176 35 35 use Pod::Usage qw( pod2usage ); 36 36 37 my ($det_id, $exp_id, $det_type, $exp_tag, $camera, $ dbname, $workdir, $reduction, $no_update, $no_op);37 my ($det_id, $exp_id, $det_type, $exp_tag, $camera, $outroot, $dbname, $reduction, $no_update, $no_op); 38 38 GetOptions( 39 39 'det_id|d=s' => \$det_id, … … 42 42 'exp_tag|=s' => \$exp_tag, 43 43 'camera|c=s' => \$camera, 44 'outroot|w=s' => \$outroot, # output file base name 44 45 'dbname|d=s' => \$dbname, # Database name 45 'workdir|w=s' => \$workdir, # Working directory, for output files46 46 'reduction|=s' => \$reduction, 47 47 'no-update' => \$no_update, … … 50 50 51 51 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 52 pod2usage( -msg => "Required options: --det_id --det_type --exp_id --exp_tag --camera", 53 -exitval => 3) 54 unless defined $det_id 55 and defined $det_type 56 and defined $exp_id 57 and defined $exp_tag 58 and defined $camera; 52 pod2usage( -msg => "Required options: --det_id --det_type --exp_id --exp_tag --camera --outroot", 53 -exitval => 3) unless 54 defined $det_id and 55 defined $det_type and 56 defined $exp_id and 57 defined $exp_tag and 58 defined $camera and 59 defined $outroot; 59 60 60 61 $ipprc->define_camera($camera); … … 129 130 close $list2File; 130 131 131 # Output files 132 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 133 my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, ${$files}[0]->{path_base} ); 134 my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1 135 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 132 # outroot examples (HOST components must be set) 133 # file://data/ipp004.0/gpc1/20080130 134 # neb:///ipp004-v1/gpc1/20080130 135 # neb:///*/gpc1/20080130 (volume not specified) 136 137 # check for existing directory, generate if needed 138 $ipprc->outroot_prepare($outroot); 139 140 my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outroot); # Binned JPEG #1 141 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outroot); # Binned JPEG #2 136 142 137 143 unless ($no_op) { 138 144 # Make the jpeg for binning 1 139 $command = "$ppImage -list $list1Name $out putRoot -recipe PPIMAGE $recipe1"; # Command to run145 $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run 140 146 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 141 147 run(command => $command, verbose => 1); … … 147 153 148 154 # Make the jpeg for binning 2 149 $command = "$ppImage -list $list2Name $out putRoot -recipe PPIMAGE $recipe2"; # Command to run155 $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run 150 156 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 151 157 run(command => $command, verbose => 1); … … 161 167 $command .= " -det_id $det_id"; 162 168 $command .= " -exp_id $exp_id"; 163 $command .= " -recip $recipe1,$recipe2 -path_base $out putRoot";169 $command .= " -recip $recipe1,$recipe2 -path_base $outroot"; 164 170 $command .= " -dbname $dbname" if defined $dbname; 165 171 $command .= $stats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/detrend_process_imfile.pl
r15466 r16176 32 32 use Pod::Usage qw( pod2usage ); 33 33 34 my ($det_id, $exp_id, $class_id, $det_type, $exp_tag, $input_uri, $camera, $ dbname, $workdir, $reduction, $no_update, $no_op);34 my ($det_id, $exp_id, $class_id, $det_type, $exp_tag, $input_uri, $camera, $outroot, $dbname, $reduction, $no_update, $no_op); 35 35 GetOptions( 36 36 'det_id|d=s' => \$det_id, … … 41 41 'input_uri|u=s' => \$input_uri, 42 42 'camera|c=s' => \$camera, 43 'outroot|w=s' => \$outroot, # output file base name 43 44 'dbname|d=s' => \$dbname, # Database name 44 'workdir|w=s' => \$workdir, # Working directory, for output files45 45 'reduction=s' => \$reduction, # Reduction class 46 46 'no-update' => \$no_update, … … 49 49 50 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 51 pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera", 52 -exitval => 3) 53 unless defined $det_id 54 and defined $exp_id 55 and defined $class_id 56 and defined $det_type 57 and defined $exp_tag 58 and defined $input_uri 59 and defined $camera; 51 pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera --outroot", 52 -exitval => 3) unless 53 defined $det_id and 54 defined $exp_id and 55 defined $class_id and 56 defined $det_type and 57 defined $exp_tag and 58 defined $input_uri and 59 defined $camera and 60 defined $outroot; 60 61 61 62 # XXX this exits with status = 0 on failure … … 88 89 &my_die("Couldn't find input file: $input_uri\n", $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri); 89 90 90 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 91 # outroot examples (HOST components must be set) 92 # file://data/ipp004.0/gpc1/20080130 93 # neb:///ipp004-v1/gpc1/20080130 94 # neb:///*/gpc1/20080130 (volume not specified) 91 95 92 my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, $input_uri ); 96 # check for existing directory, generate if needed 97 $ipprc->outroot_prepare($outroot); 93 98 94 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 95 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 96 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 97 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 98 99 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages 100 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages 99 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 100 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 101 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 102 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 103 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 104 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 101 105 102 106 # Run ppImage 103 107 unless ($no_op) { 104 my $command = "$ppImage -file $input_uri $out putRoot";108 my $command = "$ppImage -file $input_uri $outroot"; 105 109 $command .= " -recipe PPIMAGE $recipe"; 106 110 $command .= " -recipe PPSTATS CHIPSTATS"; … … 141 145 $command .= " -class_id $class_id"; 142 146 $command .= " -recip $reduction"; 143 $command .= " -uri $outputImage -path_base $out putRoot";147 $command .= " -uri $outputImage -path_base $outroot"; 144 148 $command .= " -dbname $dbname" if defined $dbname; 145 149 $command .= $stats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/detrend_reject_exp.pl
r15489 r16176 37 37 use Pod::Usage qw( pod2usage ); 38 38 39 my ($det_id, $iter, $det_type, $camera, $ filter, $workdir, $dbname, $no_update, $no_op);39 my ($det_id, $iter, $det_type, $camera, $outroot, $filter, $dbname, $no_update, $no_op); 40 40 GetOptions( 41 41 'det_id|d=s' => \$det_id, … … 43 43 'det_type|t=s' => \$det_type, 44 44 'camera=s' => \$camera, 45 'outroot|w=s' => \$outroot, # output file base name 45 46 'filter=s' => \$filter, 46 'workdir|w=s' => \$workdir, # Working directory for output files47 47 'dbname|d=s' => \$dbname, # Database name 48 48 'no-update' => \$no_update, … … 51 51 52 52 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 53 pod2usage( -msg => "Required options: --det_id --iteration --det_type --camera", 54 -exitval => 3) 55 unless defined $det_id 56 and defined $iter 57 and defined $det_type 58 and defined $camera; 53 pod2usage( -msg => "Required options: --det_id --iteration --det_type --camera --outroot", 54 -exitval => 3) unless 55 defined $det_id and 56 defined $iter and 57 defined $det_type and 58 defined $camera and 59 defined $outroot; 59 60 60 61 # values to extract from output metadata and the stats to calculate … … 141 142 my $reject_meanstdev = rejection_limit( 'ENSEMBLE.MEANSTDEV', $det_type, $filter ); 142 143 143 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 144 145 my $logName = $ipprc->file_prepare( "$camera.$det_type.$det_id.$iter.detreject.log", $workdir ); # Name for log 144 # outroot examples (HOST components must be set) 145 # file://data/ipp004.0/gpc1/20080130 146 # neb:///ipp004-v1/gpc1/20080130 147 # neb:///*/gpc1/20080130 (volume not specified) 148 149 # check for existing directory, generate if needed 150 $ipprc->outroot_prepare($outroot); 151 152 my $logName = $outroot . "log"; # Name for log 146 153 147 154 my $logFile; -
branches/eam_branch_20080121/ippScripts/scripts/detrend_reject_imfile.pl
r14823 r16176 43 43 44 44 # parse the command-line options 45 my ($det_id, $iter, $exp_id, $exp_tag, $det_type, $camera, $filter, $reject, $ dbname, $workdir, $reduction, $no_update, $no_op);45 my ($det_id, $iter, $exp_id, $exp_tag, $det_type, $camera, $filter, $reject, $outroot, $dbname, $reduction, $no_update, $no_op); 46 46 GetOptions( 47 47 'det_id|d=s' => \$det_id, … … 51 51 'det_type|t=s' => \$det_type, 52 52 'camera=s' => \$camera, 53 'outroot|w=s' => \$outroot, # output file base name 53 54 'filter=s' => \$filter, 54 55 'reject' => \$reject, 55 56 'dbname|d=s' => \$dbname, # Database name 56 'workdir|w=s' => \$workdir, # Working directory, for output files57 57 'reduction|=s' => \$reduction, 58 58 'no-update' => \$no_update, … … 61 61 62 62 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 63 pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --det_type --camera", 64 -exitval => 3) 65 unless defined $det_id 66 and defined $iter 67 and defined $exp_id 68 and defined $exp_tag 69 and defined $det_type 70 and defined $camera; 63 pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --det_type --camera --outroot", 64 -exitval => 3) unless 65 defined $det_id and 66 defined $iter and 67 defined $exp_id and 68 defined $exp_tag and 69 defined $det_type and 70 defined $camera and 71 defined $outroot; 71 72 72 73 # load IPP config information for the specified camera … … 144 145 } 145 146 146 # Output products 147 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 148 my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detresid.$det_id.$iter", $workdir, ${$files}[0]->{path_base} ); 149 my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1 150 my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 151 my $logName = $ipprc->filename("LOG.EXP", $outputRoot); # Name for log 147 # outroot examples (HOST components must be set) 148 # file://data/ipp004.0/gpc1/20080130 149 # neb:///ipp004-v1/gpc1/20080130 150 # neb:///*/gpc1/20080130 (volume not specified) 151 152 # check for existing directory, generate if needed 153 $ipprc->outroot_prepare($outroot); 154 155 my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outroot); # Binned JPEG #1 156 my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outroot); # Binned JPEG #2 157 my $logName = $ipprc->filename("LOG.EXP", $outroot); # Name for log 152 158 153 159 my $logFile; … … 170 176 unless ($no_op) { 171 177 # Make the jpeg for binning 1 172 $command = "$ppImage -list $list1Name $out putRoot -recipe PPIMAGE $recipe1"; # Command to run178 $command = "$ppImage -list $list1Name $outroot -recipe PPIMAGE $recipe1"; # Command to run 173 179 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 174 180 run(command => $command, verbose => 1); … … 180 186 181 187 # Make the jpeg for binning 2 182 $command = "$ppImage -list $list2Name $out putRoot -recipe PPIMAGE $recipe2"; # Command to run188 $command = "$ppImage -list $list2Name $outroot -recipe PPIMAGE $recipe2"; # Command to run 183 189 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 184 190 run(command => $command, verbose => 1); … … 502 508 503 509 $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_id $exp_id"; 504 $command .= " -recip $recipe1,$recipe2 -path_base $out putRoot ";510 $command .= " -recip $recipe1,$recipe2 -path_base $outroot "; 505 511 $command .= ' -reject' if $reject; 506 512 $command .= " -dbname $dbname" if defined $dbname; -
branches/eam_branch_20080121/ippScripts/scripts/detrend_resid.pl
r15616 r16176 32 32 use Pod::Usage qw( pod2usage ); 33 33 34 my ($det_id, $iter, $exp_id, $exp_tag, $class_id, $det_type, $detrend, $input_uri, $camera, $mode, $ dbname, $workdir, $reduction, $no_update, $no_op);34 my ($det_id, $iter, $exp_id, $exp_tag, $class_id, $det_type, $detrend, $input_uri, $camera, $mode, $outroot, $dbname, $reduction, $no_update, $no_op); 35 35 GetOptions( 36 36 'det_id|d=s' => \$det_id, … … 44 44 'camera|c=s' => \$camera, 45 45 'mode|m=s' => \$mode, 46 'outroot|w=s' => \$outroot, # output file base name 46 47 'dbname|d=s' => \$dbname, # Database name 47 'workdir|w=s' => \$workdir, # Working directory, for output files48 48 'reduction=s' => \$reduction, # Reduction class 49 49 'no-update' => \$no_update, … … 52 52 53 53 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 54 pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --class_id --det_type --camera --input_uri --mode --detrend (not for 'verify' mode)", 55 -exitval => 3) 56 unless defined $det_id 57 and defined $iter 58 and defined $exp_id 59 and defined $exp_tag 60 and defined $class_id 61 and defined $det_type 62 and defined $input_uri 63 and defined $camera 64 and defined $mode 65 and (defined $detrend or lc($mode) eq 'verify'); 54 pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --class_id --det_type --camera --input_uri --mode --detrend --outroot (not for 'verify' mode)", 55 -exitval => 3) unless 56 defined $det_id and 57 defined $iter and 58 defined $exp_id and 59 defined $exp_tag and 60 defined $class_id and 61 defined $det_type and 62 defined $input_uri and 63 defined $camera and 64 defined $mode and 65 defined $outroot and 66 (defined $detrend or lc($mode) eq 'verify'); 66 67 67 68 $ipprc->define_camera($camera); … … 130 131 $ppImage .= " -dbname $dbname" if defined $dbname; 131 132 132 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 133 134 my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detresid.$det_id.$iter", $workdir, $input_uri ); 135 136 my $outputName = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); 137 my $bin1Name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id); 138 my $bin2Name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id); 139 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outputRoot, $class_id); 140 141 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages 142 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages 133 # outroot examples (HOST components must be set) 134 # file://data/ipp004.0/gpc1/20080130 135 # neb:///ipp004-v1/gpc1/20080130 136 # neb:///*/gpc1/20080130 (volume not specified) 137 138 # check for existing directory, generate if needed 139 $ipprc->outroot_prepare($outroot); 140 141 my $outputName = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id); 142 my $bin1Name = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id); 143 my $bin2Name = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id); 144 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outroot, $class_id); 145 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id); 146 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id); 143 147 144 148 # Run ppImage & ppStats 145 149 unless ($no_op) { 146 my $command = "$ppImage -file $input_uri $out putRoot";150 my $command = "$ppImage -file $input_uri $outroot"; 147 151 $command .= " -recipe PPIMAGE $recipe"; 148 152 $command .= " -recipe PPSTATS RESIDUAL"; … … 205 209 $command .= " -recip $recipe"; 206 210 $command .= " -uri $outputName"; 207 $command .= " -path_base $out putRoot";211 $command .= " -path_base $outroot"; 208 212 $command .= " -dbname $dbname" if defined $dbname; 209 213 $command .= $stats->cmdflags(); -
branches/eam_branch_20080121/ippScripts/scripts/detrend_stack.pl
r15467 r16176 33 33 use Pod::Usage qw( pod2usage ); 34 34 35 my ($det_id, $iter, $class_id, $det_type, $camera, $ dbname, $workdir, $reduction, $no_update, $no_op, $quiet);35 my ($det_id, $iter, $class_id, $det_type, $camera, $outroot, $dbname, $reduction, $no_update, $no_op, $quiet); 36 36 GetOptions( 37 37 'det_id|d=s' => \$det_id, … … 40 40 'det_type|t=s' => \$det_type, 41 41 'camera|c=s' => \$camera, 42 'outroot|w=s' => \$outroot, # output file base name 42 43 'dbname|d=s' => \$dbname, # Database name 43 'workdir|w=s' => \$workdir, # Working directory, for output files44 44 'reduction=s' => \$reduction, # Reduction class for processing 45 45 'no-update' => \$no_update, … … 49 49 50 50 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --det_type --camera", 52 -exitval => 3) 53 unless defined $det_id 54 and defined $iter 55 and defined $class_id 56 and defined $det_type 57 and defined $camera; 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --det_type --camera --outroot", 52 -exitval => 3) unless 53 defined $det_id and 54 defined $iter and 55 defined $class_id and 56 defined $det_type and 57 defined $camera and 58 defined $outroot; 58 59 59 60 my $verbose = 1; … … 111 112 } 112 113 113 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir; 114 115 my $outputRoot = $ipprc->file_prepare( "$camera.$det_type.$det_id.$iter.$class_id", $workdir, ${$files}[0]->{uri} ); 116 my $outputStack = $outputRoot . '.fits'; # Output name 117 my $outputStats = $outputRoot . '.stats'; # Statistics name 118 119 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".trace"; # Trace messages 120 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".log"; # Log messages 114 # outroot examples (HOST components must be set) 115 # file://data/ipp004.0/gpc1/20080130 116 # neb:///ipp004-v1/gpc1/20080130 117 # neb:///*/gpc1/20080130 (volume not specified) 118 119 # check for existing directory, generate if needed 120 $ipprc->outroot_prepare($outroot); 121 122 ## XXX should we be using the filerules here? 123 my $outputStack = $outroot . '.fits'; # Output name 124 my $outputStats = $outroot . '.stats'; # Statistics name 125 my $traceDest = $outroot . '.trace'; # Trace messages 126 my $logDest = $outroot . '.log'; # Log messages 121 127 122 128 $command = "$ppMerge $outputStack"; # Command to run -
branches/eam_branch_20080121/ippTasks/camera.pro
r16173 r16176 122 122 book getword camPendingExp $pageName exp_tag -var EXP_TAG 123 123 book getword camPendingExp $pageName cam_id -var CAM_ID 124 book getword camPendingExp $pageName workdir -var WORKDIR 124 book getword camPendingExp $pageName workdir -var WORKDIR_TEMPLATE 125 125 book getword camPendingExp $pageName dvodb -var DVODB 126 126 book getword camPendingExp $pageName dbname -var DBNAME … … 130 130 set.host.for.camera $camera FPA 131 131 132 # output log from filerule 133 if ("$WORKDIR" == "NULL") 134 $outpath = `pwd` 135 else 136 $outpath = `ipp_datapath.pl $WORKDIR` 137 end 138 sprintf outpath "%s/%s" $outpath $EXP_TAG 139 sprintf outroot "%s/%s.cm.%s" $outpath $EXP_TAG $CAM_ID 132 # raw workdir examples: 133 # file://data/@HOST@.0/gpc1/20080130 134 # neb:///@HOST@-vol0/gpc1/20080130 (need to supply volname?, or are we re-defining this each time?) 135 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 136 # out workdir examples: 137 # file://data/ipp004.0/gpc1/20080130 138 # neb:///ipp004-vol0/gpc1/20080130 139 140 ## generate outroot specific to this exposure (& chip) 141 sprintf outroot "%s/%s/%s.cm.%s" $WORKDIR $EXP_TAG $EXP_TAG $CAM_ID 142 143 ## generate output log based on filerule (convert the URI to a PATH) 140 144 $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id NONE --basename $outroot` 141 145 if ("$logfile" == "") 142 $logfile = $outroot.log 146 echo "WARNING: logfile not defined in camera.pro:146" 147 break 143 148 end 144 149 145 150 stdout $logfile 146 151 stderr $logfile 147 exec mkdir -p $outpath148 152 149 $run = camera_exp.pl --exp_tag $EXP_TAG --cam_id $CAM_ID --camera $CAMERA 150 if ("$WORKDIR" != "NULL") 151 $run = $run --workdir $WORKDIR 152 end 153 $run = camera_exp.pl --exp_tag $EXP_TAG --cam_id $CAM_ID --camera $CAMERA --outroot $outroot 153 154 if ("$REDUCTION" != "NULL") 154 155 $run = $run --reduction $REDUCTION -
branches/eam_branch_20080121/ippTasks/chip.pro
r16173 r16176 121 121 book getword chipPendingImfile $pageName exp_tag -var EXP_TAG 122 122 book getword chipPendingImfile $pageName chip_id -var CHIP_ID 123 book getword chipPendingImfile $pageName workdir -var WORKDIR 123 book getword chipPendingImfile $pageName workdir -var WORKDIR_TEMPLATE 124 124 book getword chipPendingImfile $pageName class_id -var CLASS_ID 125 125 book getword chipPendingImfile $pageName uri -var URI … … 130 130 set.host.for.camera $camera $class_id 131 131 132 ## generate output log based on filerule 133 if ("$WORKDIR" == "NULL") 134 $outpath = `pwd` 135 else 136 $outpath = `ipp_datapath.pl $WORKDIR` 137 end 138 sprintf outpath "%s/%s" $outpath $EXP_TAG 139 sprintf outroot "%s/%s.ch.%s" $outpath $EXP_TAG $CHIP_ID 132 # raw workdir examples: 133 # file://data/@HOST@.0/gpc1/20080130 134 # neb:///@HOST@-vol0/gpc1/20080130 (need to supply volname?, or are we re-defining this each time?) 135 set.workdir.by.camera $CAMERA $CLASS_ID $WORKDIR_TEMPLATE $default_host WORKDIR 136 # out workdir examples: 137 # file://data/ipp004.0/gpc1/20080130 138 # neb:///ipp004-vol0/gpc1/20080130 139 140 ## generate outroot specific to this exposure (& chip) 141 sprintf outroot "%s/%s/%s.ch.%s" $WORKDIR $EXP_TAG $EXP_TAG $CHIP_ID 142 143 ## generate output log based on filerule (convert the URI to a PATH) 140 144 $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot` 141 145 if ("$logfile" == "") 142 sprintf logfile "%s.%s.log" $outroot $CLASS_ID 146 echo "WARNING: logfile not defined in chip.pro:152" 147 break 143 148 end 144 149 145 150 stdout $logfile 146 151 stderr $logfile 147 exec mkdir -p $outpath148 152 149 $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --uri $URI --camera $CAMERA 150 if ("$WORKDIR" != "NULL") 151 $run = $run --workdir $WORKDIR 152 end 153 $run = chip_imfile.pl --exp_id $EXP_ID --chip_id $CHIP_ID --class_id $CLASS_ID --exp_tag $EXP_TAG --uri $URI --camera $CAMERA --outroot $outroot 153 154 if ("$REDUCTION" != "NULL") 154 155 $run = $run --reduction $REDUCTION -
branches/eam_branch_20080121/ippTasks/detrend.norm.pro
r16173 r16176 153 153 book getword detPendingNormStatImfile $pageName iteration -var ITERATION 154 154 book getword detPendingNormStatImfile $pageName camera -var CAMERA 155 book getword detPendingNormStatImfile $pageName workdir -var WORKDIR 155 book getword detPendingNormStatImfile $pageName workdir -var WORKDIR_TEMPLATE 156 156 book getword detPendingNormStatImfile $pageName dbname -var DBNAME 157 157 … … 159 159 set.host.for.camera $camera FPA 160 160 161 if ("$WORKDIR" == "NULL") 162 $outpath = `pwd` 163 else 164 $outpath = `ipp_datapath.pl $WORKDIR` 165 end 166 $outpath = $outpath/$CAMERA.$DET_TYPE.$DET_ID 167 $logfile = $outpath/$CAMERA.$DET_TYPE.norm.$DET_ID.$ITERATION.log 161 # set workdir (interpolate host; see camera.pro for examples) 162 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 163 164 ## generate outroot specific to this exposure (& chip) 165 sprintf outroot "%s/%s.%s.%s/%s.%s.norm.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION 166 167 ## generate output log (NOT based on filerule?) 168 $logfile = "$outroot.log" 169 $logfile = `ipp_datapath.pl $logfile` 170 168 171 stdout $logfile 169 172 stderr $logfile 170 exec mkdir -p $outpath 171 172 $run = detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE 173 if ("$WORKDIR" != "NULL") 174 $run = $run --workdir $WORKDIR 175 end 173 174 $run = detrend_norm_calc.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --outroot $outroot 176 175 add_standard_args run 177 176 … … 271 270 book getword detPendingNormImfile $pageName class_id -var CLASS_ID 272 271 book getword detPendingNormImfile $pageName norm -var NORM 273 book getword detPendingNormImfile $pageName workdir -var WORKDIR 272 book getword detPendingNormImfile $pageName workdir -var WORKDIR_TEMPLATE 274 273 book getword detPendingNormImfile $pageName dbname -var DBNAME 275 274 … … 277 276 set.host.for.camera $camera $class_id 278 277 279 # XXX use ipp_filename.pl to lookup output file names 280 if ("$WORKDIR" == "NULL") 281 $outpath = `pwd` 282 else 283 $outpath = `ipp_datapath.pl $WORKDIR` 284 end 285 $outpath = $outpath/$CAMERA.$DET_TYPE.$DET_ID 286 $logfile = $outpath/$CAMERA.$DET_TYPE.norm.$DET_ID.$ITERATION.$CLASS_ID.log 278 # set workdir (interpolate host; see camera.pro for examples) 279 set.workdir.by.camera $CAMERA $CLASS_ID $WORKDIR_TEMPLATE $default_host WORKDIR 280 281 ## generate outroot specific to this stack (& chip) 282 sprintf outroot "%s/%s.%s.%s/%s.%s.norm.%s.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION $CLASS_ID 283 284 ## generate output log (NOT based on filerule?) 285 $logfile = "$outroot.log" 286 $logfile = `ipp_datapath.pl $logfile` 287 287 288 stdout $logfile 288 289 stderr $logfile 289 exec mkdir -p $outpath 290 291 $run = detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE 292 if ("$WORKDIR" != "NULL") 293 $run = $run --workdir $WORKDIR 294 end 290 291 $run = detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE --outroot $outroot 295 292 add_standard_args run 296 293 … … 387 384 book getword detPendingNormExp $pageName det_type -var DET_TYPE 388 385 book getword detPendingNormExp $pageName camera -var CAMERA 389 book getword detPendingNormExp $pageName workdir -var WORKDIR 386 book getword detPendingNormExp $pageName workdir -var WORKDIR_TEMPLATE 390 387 book getword detPendingNormExp $pageName dbname -var DBNAME 391 388 … … 393 390 set.host.for.camera $camera FPA 394 391 395 # XXX add $WORKDIR/$LOG_DIR 396 if ("$WORKDIR" == "NULL") 397 $outpath = `pwd` 398 else 399 $outpath = `ipp_datapath.pl $WORKDIR` 400 end 401 $outpath = $outpath/$CAMERA.$DET_TYPE.$DET_ID 402 $logfile = $outpath/$CAMERA.$DET_TYPE.norm.$DET_ID.$ITERATION.log 392 # set workdir (interpolate host; see camera.pro for examples) 393 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 394 395 ## generate outroot specific to this exposure (& chip) 396 sprintf outroot "%s/%s.%s.%s/%s.%s.norm.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION 397 398 ## generate output log (NOT based on filerule?) 399 $logfile = "$outroot.log" 400 $logfile = `ipp_datapath.pl $logfile` 401 403 402 stdout $logfile 404 403 stderr $logfile 405 exec mkdir -p $outpath 406 407 $run = detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE 408 if ("$WORKDIR" != "NULL") 409 $run = $run --workdir $WORKDIR 410 end 404 405 $run = detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE --outroot $outroot 411 406 add_standard_args run 412 407 -
branches/eam_branch_20080121/ippTasks/detrend.process.pro
r16173 r16176 143 143 book getword detPendingProcessedImfile $pageName uri -var URI 144 144 book getword detPendingProcessedImfile $pageName camera -var CAMERA 145 book getword detPendingProcessedImfile $pageName workdir -var WORKDIR 145 book getword detPendingProcessedImfile $pageName workdir -var WORKDIR_TEMPLATE 146 146 book getword detPendingProcessedImfile $pageName dbname -var DBNAME 147 147 book getword detPendingProcessedImfile $pageName reduction -var REDUCTION … … 150 150 set.host.for.camera $camera $class_id 151 151 152 ## output log filename 153 if ("$WORKDIR" == "NULL") 154 $outpath = `pwd` 155 else 156 $outpath = `ipp_datapath.pl $WORKDIR` 157 end 158 sprintf outpath "%s/%s.%s.%s/%s" $outpath $CAMERA $DET_TYPE $DET_ID $EXP_TAG 159 sprintf outroot "%s/%s.detproc.%s" $outpath $EXP_TAG $DET_ID 152 # see chip.pro for examples 153 set.workdir.by.camera $CAMERA $CLASS_ID $WORKDIR_TEMPLATE $default_host WORKDIR 154 155 ## generate outroot specific to this exposure (& chip) 156 sprintf outroot "%s/%s.%s.%s/%s/%s.detproc.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID 157 158 ## generate output log based on filerule (convert the URI to a PATH) 160 159 $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot` 161 160 if ("$logfile" == "") 162 sprintf logfile "%s.%s.log" $outroot $CLASS_ID 161 echo "WARNING: logfile not defined in detrend.process.pro:161" 162 break 163 163 end 164 164 165 165 stdout $logfile 166 166 stderr $logfile 167 exec mkdir -p $outpath 168 169 $run = detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_ID --det_type $DET_TYPE --class_id $CLASS_ID --exp_tag $EXP_TAG --input_uri $URI --camera $CAMERA 170 if ("$WORKDIR" != "NULL") 171 $run = $run --workdir $WORKDIR 172 end 167 168 $run = detrend_process_imfile.pl --det_id $DET_ID --exp_id $EXP_ID --det_type $DET_TYPE --class_id $CLASS_ID --exp_tag $EXP_TAG --input_uri $URI --camera $CAMERA --outroot $outroot 173 169 if ("$REDUCTION" != "NULL") 174 170 $run = $run --reduction $REDUCTION … … 269 265 book getword detPendingProcessedExp $pageName camera -var CAMERA 270 266 book getword detPendingProcessedExp $pageName exp_tag -var EXP_TAG 271 book getword detPendingProcessedExp $pageName workdir -var WORKDIR 267 book getword detPendingProcessedExp $pageName workdir -var WORKDIR_TEMPLATE 272 268 book getword detPendingProcessedExp $pageName dbname -var DBNAME 269 book getword detPendingProcessedExp $pageName reduction -var REDUCTION 273 270 274 271 # specify choice of local or remote host based on camera and chip (class_id) 275 272 set.host.for.camera $camera FPA 276 273 277 # XXX push this into the filerules? 278 if ("$WORKDIR" == "NULL") 279 $outpath = `pwd` 280 else 281 $outpath = `ipp_datapath.pl $WORKDIR` 282 end 283 sprintf outpath "%s/%s.%s.%s/%s" $outpath $CAMERA $DET_TYPE $DET_ID $EXP_TAG 284 sprintf outroot "%s/%s.detproc.%s" $outpath $EXP_TAG $DET_ID 274 # set workdir (interpolate host; see camera.pro for examples) 275 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 276 277 ## generate outroot specific to this exposure (& chip) 278 sprintf outroot "%s/%s.%s.%s/%s/%s.detproc.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID 279 280 ## generate output log based on filerule (convert the URI to a PATH) 285 281 $logfile = `ipp_filename.pl --filerule LOG.EXP --camera $CAMERA --class_id NONE --basename $outroot` 286 282 if ("$logfile" == "") 287 $logfile = $outroot.log 283 echo "WARNING: logfile not defined in detrend.process.pro:282" 284 break 288 285 end 289 286 290 287 stdout $logfile 291 288 stderr $logfile 292 exec mkdir -p $outpath 293 294 $run = detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA 295 if ("$WORKDIR" != "NULL") 296 $run = $run --workdir $WORKDIR 289 290 $run = detrend_process_exp.pl --det_id $DET_ID --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --outroot $outroot 291 if ("$REDUCTION" != "NULL") 292 $run = $run --reduction $REDUCTION 297 293 end 298 294 add_standard_args run -
branches/eam_branch_20080121/ippTasks/detrend.reject.pro
r16173 r16176 122 122 book getword detRejectExp $pageName mode -var MODE 123 123 book getword detRejectExp $pageName camera -var CAMERA 124 book getword detRejectExp $pageName workdir -var WORKDIR 124 book getword detRejectExp $pageName workdir -var WORKDIR_TEMPLATE 125 125 book getword detRejectExp $pageName dbname -var DBNAME 126 126 … … 128 128 set.host.for.camera $camera FPA 129 129 130 if ("$WORKDIR" == "NULL") 131 $outroot = `pwd` 132 else 133 $outroot = `ipp_datapath.pl $WORKDIR` 134 end 135 sprintf outroot "%s/%s.%s.%s" $outroot $CAMERA $DET_TYPE $DET_ID 136 sprintf logfile "%s/%s.%s.%s.%s.detreject.log" $outroot $CAMERA $DET_TYPE $DET_ID $ITERATION 130 # set workdir (interpolate host; see camera.pro for examples) 131 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 132 133 ## generate outroot specific to this exposure (& chip) 134 sprintf outroot "%s/%s.%s.%s/%s/%s.detreject.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION 135 136 ## generate output log based on filerule (convert the URI to a PATH) 137 $logfile = $outroot.log 138 $logfile = `ipp_datapath.pl $logfile` 139 137 140 stdout $logfile 138 141 stderr $logfile 139 exec mkdir -p $outroot140 142 141 $run = detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA 142 if ("$WORKDIR" != "NULL") 143 $run = $run --workdir $WORKDIR 144 end 143 $run = detrend_reject_exp.pl --det_id $DET_ID --iteration $ITERATION --det_type $DET_TYPE --camera $CAMERA --outroot $outroot 145 144 add_standard_args run 146 145 -
branches/eam_branch_20080121/ippTasks/detrend.resid.pro
r16173 r16176 143 143 book getword detPendingResidImfile $pageName det_uri -var DET_URI 144 144 book getword detPendingResidImfile $pageName camera -var CAMERA 145 book getword detPendingResidImfile $pageName workdir -var WORKDIR 145 book getword detPendingResidImfile $pageName workdir -var WORKDIR_TEMPLATE 146 146 book getword detPendingResidImfile $pageName dbname -var DBNAME 147 147 book getword detPendingResidImfile $pageName reduction -var REDUCTION … … 150 150 set.host.for.camera $camera $class_id 151 151 152 # XXX use ipp_filename.pl to lookup output file names 153 if ("$WORKDIR" == "NULL") 154 $outpath = `pwd` 155 else 156 $outpath = `ipp_datapath.pl $WORKDIR` 157 end 158 sprintf outpath "%s/%s.%s.%s/%s" $outpath $CAMERA $DET_TYPE $DET_ID $EXP_TAG 159 sprintf outroot "%s/%s.detresid.%s.%s" $outpath $EXP_TAG $DET_ID $ITERATION 152 # set workdir (interpolate host; see camera.pro for examples) 153 set.workdir.by.camera $CAMERA $CLASS_ID $WORKDIR_TEMPLATE $default_host WORKDIR 154 155 ## generate outroot specific to this exposure (& chip) 156 sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION 157 158 ## generate output log based on filerule (convert the URI to a PATH) 160 159 $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot` 161 160 if ("$logfile" == "") 162 sprintf logfile "%s.%s.log" $outroot $CLASS_ID 161 echo "WARNING: logfile not defined in detrend.resid.pro:161" 162 break 163 163 end 164 164 165 165 stdout $logfile 166 166 stderr $logfile 167 exec mkdir -p $outpath 168 169 $run = detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE 170 if ("$WORKDIR" != "NULL") 171 $run = $run --workdir $WORKDIR 172 end 167 168 $run = detrend_resid.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE --outroot $outroot 173 169 if ("$REDUCTION" != "NULL") 174 170 $run = $run --reduction $REDUCTION … … 272 268 book getword detPendingResidExp $pageName include -var INCLUDE 273 269 book getword detPendingResidExp $pageName camera -var CAMERA 274 book getword detPendingResidExp $pageName workdir -var WORKDIR 270 book getword detPendingResidExp $pageName workdir -var WORKDIR_TEMPLATE 275 271 book getword detPendingResidExp $pageName dbname -var DBNAME 276 272 … … 278 274 set.host.for.camera $camera FPA 279 275 280 # XXX use ipp_filename.pl to lookup output file names 281 if ("$WORKDIR" == "NULL") 282 $outpath = `pwd` 283 else 284 $outpath = `ipp_datapath.pl $WORKDIR` 285 end 286 sprintf outpath "%s/%s.%s.%s/%s" $outpath $CAMERA $DET_TYPE $DET_ID $EXP_TAG 287 sprintf outroot "%s/%s.detresid.%s.%s" $outpath $EXP_TAG $DET_ID $ITERATION 276 # set workdir (interpolate host; see camera.pro for examples) 277 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 278 279 ## generate outroot specific to this exposure (& chip) 280 sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION 281 282 ## generate output log based on filerule (convert the URI to a PATH) 288 283 $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id NONE --basename $outroot` 284 if ("$logfile" == "") 285 echo "WARNING: logfile not defined in detrend.process.pro:285" 286 break 287 end 289 288 290 289 stdout $logfile 291 290 stderr $logfile 292 exec mkdir -p $outpath 293 294 $run = detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA 295 if ("$WORKDIR" != "NULL") 296 $run = $run --workdir $WORKDIR 297 end 291 292 $run = detrend_reject_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --outroot $outroot 298 293 add_standard_args run 299 294 -
branches/eam_branch_20080121/ippTasks/detrend.stack.pro
r16173 r16176 123 123 book getword detPendingStackedImfile $pageName class_id -var CLASS_ID 124 124 book getword detPendingStackedImfile $pageName camera -var CAMERA 125 book getword detPendingStackedImfile $pageName workdir -var WORKDIR 125 book getword detPendingStackedImfile $pageName workdir -var WORKDIR_TEMPLATE 126 126 book getword detPendingStackedImfile $pageName dbname -var DBNAME 127 127 book getword detPendingStackedImfile $pageName reduction -var REDUCTION … … 130 130 set.host.for.camera $camera $class_id 131 131 132 if ("$WORKDIR" == "NULL")133 $outpath = `pwd`134 else 135 $outpath = `ipp_datapath.pl $WORKDIR`136 end137 sprintf outpath "%s/%s.%s.%s" $outpath $CAMERA $DET_TYPE $DET_ID 138 sprintf outroot "%s/%s.%s.%s.%s" $outpath $CAMERA $DET_TYPE $DET_ID $ITERATION132 # set workdir (interpolate host; see camera.pro for examples) 133 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 134 135 ## generate outroot specific to this exposure (& chip) 136 sprintf outroot "%s/%s.%s.%s/%s.%s.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION 137 138 ## generate output log based on filerule (convert the URI to a PATH) 139 139 $logfile = `ipp_filename.pl --filerule LOG.IMFILE --camera $CAMERA --class_id $CLASS_ID --basename $outroot` 140 140 if ("$logfile" == "") 141 sprintf logfile "%s.%s.log" $outroot $CLASS_ID 141 echo "WARNING: logfile not defined in detrend.stack.pro:141" 142 break 142 143 end 143 144 144 145 stdout $logfile 145 146 stderr $logfile 146 exec mkdir -p $outpath147 147 148 # save the pageName for future reference below 149 options $pageName 150 151 $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA 152 if ("$WORKDIR" != "NULL") 153 $run = $run --workdir $WORKDIR 154 end 148 $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot 155 149 if ("$REDUCTION" != "NULL") 156 150 $run = $run --reduction $REDUCTION 157 151 end 158 152 add_standard_args run 153 154 # save the pageName for future reference below 155 options $pageName 159 156 160 157 # create the command line -
branches/eam_branch_20080121/ippTasks/notes.txt
r16173 r16176 1 1 2 2008.01.18 2 proposal to clean scripts/tasks up somewhat wrt names: 3 4 * scripts do NOT use workdir to change the workdir in the db 5 * thus, what is supplied is actually the outputRoot 6 * require the output root for the scripts 7 * have the calling tasks construct the outputRoot 8 ** replace -workdir with -outroot 9 10 some filename rules : 11 12 * the db entry WORKDIR is the most abstract version: 13 path://GPC-@HOST@/20080130 14 file://data/@HOST@.0/gpc1/20080130 15 neb:///@HOST@/gpc1/20080130 16 neb://gpc1/20080130 17 XXX have nebulous distinguish between neb:///host/path and 18 neb://path? 19 20 * the db WORKDIR entry is carried from step to step unless 21 over-ridden with a -queue command 22 23 * psLib-based binaries (ppImage, etc) may be passed URIs, but not 24 files with the @HOST@ abstraction 25 26 * IPP perl scripts may be passed URIs, but not files with the @HOST@ 27 abstraction 28 29 * nebulous : convert neb:///@HOST@/path/name 30 31 *** examples: 32 33 * this tells ppImage to use the ipp004 version for both input and output: 34 ppImage -file neb:///ipp004-v0/gpc1/20080130/o4414g0001o/o4414g0001o.XY01.fits neb:///ipp004-v0/gpc1/20080130/o4414g0001o/o4414g0001o.XY01 35 36 * we already know the hostname at this point; include it in the call 37 chip_imfile.pl --uri neb:///ipp004-v0/gpc1/20080130/o4414g0001o/o4414g0001o.XY01.fits --workdir neb:///ipp004-v0/gpc1/20080130/ 38 39 40 41 42 43 2008.01.21 3 44 4 45 I'm working on the summit.copy.pro interaction with nebulous (and … … 25 66 host. 26 67 68 * specific output filenames 69 70 In both ippTasks and ippScripts, there are references to files 71 which must correctly located on the host. 72 73 * workdir choice of output directory. 74 75 the 76 27 77 * dsget output target: 28 78 29 79 dsget is called by pantasks in the task 'dsget'. currently, dsget 30 80 accepts a --filename argument which specifies the output filename 31 to use. we have to tell t 81 to use. in the nebulous context, this is of the form 82 neb://top/next/stuff, without any host-specific information. To 83 target the file instance to a specific host, we pass dsget the 84 --volume (name) argument. The volumes refer to the specific 85 devices (potentially more than one per host), and the names can 86 then be chosen to include the host. 32 87 33 34 * choice of output directory.35 36 the37 38 39 88 2007.10.11 40 89 -
branches/eam_branch_20080121/ippTasks/pantasks.pro
r16173 r16176 342 342 343 343 macro set.workdir.by.camera 344 if ($0 != 6) 345 echo "USAGE: set.workdir.by.camera (camera) (class_id) (template) (default) (varname)" 346 echo " uses global variable NEBULOUS to determine if nebulous is active" 347 break 348 end 349 350 local host default template camera classID varname 351 $camera = $1 352 $classID = $2 353 $template = $3 354 $default = $4 355 $varname = $5 356 357 # missing camera and/or chiphosts table results in host = NULL 358 book getword chiphosts $camera $classID -var host 359 360 if ("$host" == "NULL") 361 strsub $template @HOST@ $default -var $$varname 362 else 363 strsub $template @HOST@ $host -var $$varname 364 end 365 end 366 367 macro set.volume.by.camera 344 368 if ($0 != 3) 345 echo "USAGE: set.workdir.by.camera (camera) (class_id)" 346 break 347 end 369 echo "USAGE: set.volume.by.camera (camera) (class_id) (template) (default) (varname)" 370 echo " uses global variable NEBULOUS to determine if nebulous is active" 371 break 372 end 373 374 local host default template camera classID varname 375 $camera = $1 376 $classID = $2 377 $template = $3 378 $default = $4 379 $varname = $5 348 380 349 381 # missing camera and/or chiphosts table results in host = NULL 350 book getword chiphosts $1 $2 -var $host 351 352 if ($NEBULOUS) 353 if ("$host" == "NULL") 354 $workdir = $workdir_default 355 $volume = "NULL" 356 return 357 end 358 strsub $workdir_template @HOST@ $host -var workdir 359 strsub $volume_template @HOST@ $host -var volume 360 return 361 end 362 363 if ("$host" == "NULL") 364 $workdir = $workdir_default 365 return 366 end 367 strsub $workdir_template @HOST@ $host -var workdir 382 book getword chiphosts $camera $classID -var host 383 384 if (not($NEBULOUS)) 385 $$varname = "NULL" 386 return 387 end 388 389 if ("$host" == "NULL") 390 $$varname = $default 391 return 392 end 393 394 strsub $template @HOST@ $host -var $$varname 368 395 end 369 396 -
branches/eam_branch_20080121/ippTasks/summit.copy.pro
r16174 r16176 19 19 # XXX not sure how to handle the .N value if we need to use more than one 20 20 if ($NEBULOUS) 21 $ workdir_default = neb://22 $workdir_template = neb:// 23 $ volume_default= ipp004-v024 $volume_template = @HOST@-v021 $default_host = ipp004 22 $workdir_template = neb:///@HOST@-v0 23 $default_volume = ipp004-v0 24 $volume_template = 25 25 else 26 $ workdir_default = /data/ipp004.0/26 $default_host = ipp004 27 27 $workdir_template = /data/@HOST@.0/ 28 28 end … … 278 278 book getword pzPendingImfile $pageName camera -var $CAMERA 279 279 280 set.host.by.camera $CAMERA $CLASS_ID 281 host anyhost 282 280 283 # 2007-08-30T05:09:59Z 281 284 substr $DATEOBS 0 4 YEAR … … 284 287 285 288 # we need to set the workdir based on 1) nebulous or not? 2) chip/host relationship 286 # this function uses workdir_template, workdir_default, volume_template, volume_default,289 # this function uses workdir_template, default_host, volume_template, volume_default, 287 290 # it sets workdir and volume 288 set.workdir.by.camera $CAMERA $CLASS_ID 291 set.workdir.by.camera $CAMERA $CLASS_ID $workdir_template $default_host workdir_base 292 set.volume.by.camera $CAMERA $CLASS_ID $volume_template $default_volume volume 289 293 290 294 # figure out filename 291 # XXXX this filename needs to use nebulous names 292 $FILENAME = $workdir/$CAMERA/$YEAR/$MONTH/$DAY/$EXP_NAME/$EXP_NAME.$CLASS_ID.fits 293 $FILEROOT = $workdir_template/$CAMERA/$YEAR/$MONTH/$DAY 295 # XXX may need to use sprintf here 296 $FILENAME = $workdir_base/$CAMERA/$YEAR$MONTH$DAY/$EXP_NAME/$EXP_NAME.$CLASS_ID.fits 297 $workdir = $workdir_template/$CAMERA/$YEAR$MONTH$DAY 298 # workdir examples: 299 # file://data/@HOST@.0/gpc1/20080130 300 # neb://gpc1/20080130 (need to supply volname?, or are we re-defining this each time?) 294 301 295 302 book setword pzPendingImfile $pageName filename $FILENAME 296 297 set.host.by.camera $CAMERA $CLASS_ID298 host anyhost299 303 300 304 # store the pageName with this job 301 305 options $pageName 302 options $ FILEROOT306 options $workdir 303 307 304 308 $run = dsget --uri $URI --filename $FILENAME --bytes $BYTES … … 330 334 # these are functions of (at least) EXP_TYPE and SURVEY_ID, both of which should come from the data store 331 335 336 # we saved the workdir so we can pass it to pztool 337 $workdir = $options:1 338 332 339 # update the database with the success 333 $run = pztool -copydone -exp_name $EXP_NAME -inst $CAMERA -telescope $TELESCOPE -class $CLASS -class_id $CLASS_ID -uri $FILENAME -workdir $options:1 340 # for the moment, let's not propagate these 341 $run = pztool -copydone -exp_name $EXP_NAME -inst $CAMERA -telescope $TELESCOPE -class $CLASS -class_id $CLASS_ID -uri $FILENAME -workdir $workdir -end_stage reg 334 342 # tess_id, dvodb, workdir, end_stage 335 343
Note:
See TracChangeset
for help on using the changeset viewer.
