Changeset 9097
- Timestamp:
- Oct 2, 2006, 12:16:03 PM (20 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 8 edited
-
detrend_norm_calc.pl (modified) (1 diff)
-
detrend_process_imfile.pl (modified) (5 diffs)
-
detrend_reject_exp.pl (modified) (5 diffs)
-
detrend_reject_imfile.pl (modified) (5 diffs)
-
detrend_resid.pl (modified) (5 diffs)
-
phase0exp.pl (modified) (5 diffs)
-
phase0imfile.pl (modified) (5 diffs)
-
phase2.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_norm_calc.pl
r9093 r9097 61 61 my %matrix; # Matrix of statistics as a function of exposures and classes 62 62 foreach my $file (@$files) { 63 my $exp Id = $file->{'exp_id'}; # Exposure ID63 my $expTag = $file->{'exp_tag'}; # Exposure ID 64 64 my $classId = $file->{'class_id'}; # Class ID 65 65 my $stat = $file->{STATISTIC()}; # Statistic of interest 66 66 67 67 # Create matrix elements 68 $matrix{$exp Id} = {} if not defined $matrix{$expId};69 $matrix{$exp Id}->{$classId} = $stat;68 $matrix{$expTag} = {} if not defined $matrix{$expId}; 69 $matrix{$expTag}->{$classId} = $stat; 70 70 } 71 71 72 72 # Generate the input for ppNormCalc 73 73 my $normData; # Normalisation data 74 foreach my $exp Id(keys %matrix) {75 $normData .= "$exp Id\tMETADATA\n";76 foreach my $classId (keys %{$matrix{$exp Id}}) {77 $normData .= "\t" . $classId . "\tF32\t" . $matrix{$exp Id}->{$classId} . "\n";74 foreach my $expTag (keys %matrix) { 75 $normData .= "$expTag\tMETADATA\n"; 76 foreach my $classId (keys %{$matrix{$expTag}}) { 77 $normData .= "\t" . $classId . "\tF32\t" . $matrix{$expTag}->{$classId} . "\n"; 78 78 } 79 79 $normData .= "END\n\n"; -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r9092 r9097 14 14 use Pod::Usage qw( pod2usage ); 15 15 16 my ($det_id, $exp_ id, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update);16 my ($det_id, $exp_tag, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update); 17 17 GetOptions( 18 18 'det_id|d=s' => \$det_id, 19 'exp_ id|e=s' => \$exp_id,19 'exp_tag|e=s' => \$exp_tag, 20 20 'class=s' => \$class, # unused 21 21 'class_id|i=s' => \$class_id, … … 27 27 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 28 28 pod2usage( 29 -msg => "Required options: --det_id --exp_ id--class_id --det_type --input_uri",29 -msg => "Required options: --det_id --exp_tag --class_id --det_type --input_uri", 30 30 -exitval => 3, 31 31 ) unless defined $det_id 32 and defined $exp_ id32 and defined $exp_tag 33 33 and defined $class_id 34 34 and defined $det_type … … 55 55 56 56 ### Output file name --- must match camera configuration! 57 my $outputRoot = $exp_ id. '.detproc.' . $det_id;57 my $outputRoot = $exp_tag . '.detproc.' . $det_id; 58 58 my $outputName = $outputRoot . '.' . $class_id ; 59 59 my $outputImage = $outputName . '.fits'; … … 87 87 # Add the processed file to the database 88 88 unless ($no_update) { 89 my $command = "$dettool -addprocessed -det_id $det_id -exp_ id $exp_id" .89 my $command = "$dettool -addprocessed -det_id $det_id -exp_tag $exp_tag " . 90 90 "-class_id $class_id -recip $recipe -uri $outputImage"; # Command to run dettool 91 91 $command .= " -bg " . $stats->bg_mean(); … … 100 100 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 101 101 run(command => $command, verbose => 1); 102 die "Unable to perform dettool -addprocessed for $det_id/$exp_ id/$class_id: $error_code\n"102 die "Unable to perform dettool -addprocessed for $det_id/$exp_tag/$class_id: $error_code\n" 103 103 if not $success; 104 104 } -
trunk/ippScripts/scripts/detrend_reject_exp.pl
r9091 r9097 73 73 } 74 74 75 my @exp Ids; # Array of exposure IDs75 my @expTags; # Array of exposure IDs 76 76 my @means; # Array of means 77 77 my @stdevs; # Array of stdevs 78 78 my @meanStdevs; # Array of mean stdevs 79 79 foreach my $exposure (@$exposures) { 80 die "Unable to find exposure id.\n" if not defined $exposure->{exp_ id};80 die "Unable to find exposure id.\n" if not defined $exposure->{exp_tag}; 81 81 die "Unable to find mean.\n" if not defined $exposure->{bg}; 82 82 die "Unable to find stdev.\n" if not defined $exposure->{bg_stdev}; 83 83 die "Unable to find mean stdev.\n" if not defined $exposure->{bg_mean_stdev}; 84 push @exp Ids, $exposure->{exp_id};84 push @expTags, $exposure->{exp_tag}; 85 85 push @means, $exposure->{bg}; 86 86 push @stdevs, $exposure->{bg_stdev}; … … 105 105 my $numRejected = 0; # Number of exposures rejected 106 106 for (my $i = 0; $i < scalar @means; $i++) { 107 my $exp Id = $expIds[$i]; # Exposure ID108 my $command = "$dettool -updateresidexp -det_id $det_id -iteration $iter -exp_ id $expId"; # Command to run107 my $expTag = $expTags[$i]; # Exposure ID 108 my $command = "$dettool -updateresidexp -det_id $det_id -iteration $iter -exp_tag $expTag"; # Command to run 109 109 my $reject = 0; # Reject this exposure? 110 110 if (defined REJECT_MEAN->{$det_type} and … … 112 112 $meanStats->standard_deviation() > 0 and 113 113 ($means[$i] - $meanStats->mean()) / $meanStats->standard_deviation() > REJECT_MEAN->{$det_type}) { 114 print "Rejecting $exp Idbased on bad mean: " .114 print "Rejecting $expTag based on bad mean: " . 115 115 (($means[$i] - $meanStats->mean()) / $meanStats->standard_deviation()) . 116 116 " vs " . REJECT_MEAN->{$det_type} . "\n"; … … 121 121 ($stdevs[$i] - $stdevStats->mean()) / $stdevStats->standard_deviation() > 122 122 REJECT_STDEV->{$det_type}) { 123 print "Rejecting $exp Idbased on bad stdev: " .123 print "Rejecting $expTag based on bad stdev: " . 124 124 (($stdevs[$i] - $stdevStats->mean()) / $stdevStats->standard_deviation()) . 125 125 " vs " . REJECT_STDEV->{$det_type} . "\n"; … … 130 130 ($meanStdevs[$i] - $meanStdevStats->mean()) / $meanStdevStats->standard_deviation() > 131 131 REJECT_MEAN_STDEV->{$det_type}) { 132 print "Rejecting $exp Idbased on bad stdev: " .132 print "Rejecting $expTag based on bad stdev: " . 133 133 (($meanStdevs[$i] - $meanStdevStats->mean()) / $meanStdevStats->standard_deviation()) . 134 134 " vs " . REJECT_MEAN_STDEV->{$det_type} . "\n"; -
trunk/ippScripts/scripts/detrend_reject_imfile.pl
r9091 r9097 15 15 use Pod::Usage qw( pod2usage ); 16 16 17 my ($det_id, $iter, $exp_ id, $det_type, $no_update);17 my ($det_id, $iter, $exp_tag, $det_type, $no_update); 18 18 GetOptions( 19 19 'det_id|d=s' => \$det_id, 20 20 'iteration=s' => \$iter, 21 'exp_ id|e=s' => \$exp_id,21 'exp_tag|e=s' => \$exp_tag, 22 22 'det_type|t=s' => \$det_type, 23 23 'no-update' => \$no_update … … 26 26 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 27 27 pod2usage( 28 -msg => "Required options: --det_id --iteration --exp_ id--det_type",28 -msg => "Required options: --det_id --iteration --exp_tag --det_type", 29 29 -exitval => 3, 30 30 ) unless defined $det_id 31 31 and defined $iter 32 and defined $exp_ id32 and defined $exp_tag 33 33 and defined $det_type; 34 34 … … 87 87 my $files; # Array of component files 88 88 { 89 my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_ id $exp_id"; # Command to run89 my $command = "$dettool -residimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag"; # Command to run 90 90 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 91 91 run(command => $command, verbose => 1); … … 97 97 98 98 # Generate the file list, and get the statistics 99 my $outputRoot = $exp_ id. '.detresid.' . $det_id . '.' . $iter; # Root output name99 my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root output name 100 100 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1 101 101 my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2 … … 195 195 # Add the result into the database 196 196 unless ($no_update) { 197 my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_ id $exp_id" .197 my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag " . 198 198 "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " . 199 199 "-bg $mean -bg_stdev $stdev -bg_mean_stdev $meanStdev"; # Command to run -
trunk/ippScripts/scripts/detrend_resid.pl
r9095 r9097 15 15 use Pod::Usage qw( pod2usage ); 16 16 17 my ($det_id, $iter, $exp_ id, $class_id, $det_type, $detrend,17 my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend, 18 18 $input_uri, $no_update); 19 19 GetOptions( 20 20 'det_id|d=s' => \$det_id, 21 21 'iteration=s' => \$iter, 22 'exp_ id|e=s' => \$exp_id,22 'exp_tag|e=s' => \$exp_tag, 23 23 'class_id|i=s' => \$class_id, 24 24 'det_type|t=s' => \$det_type, … … 30 30 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 31 31 pod2usage( 32 -msg => "Required options: --det_id --iteration --exp_ id--class_id --det_type --detrend --input_uri",32 -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --detrend --input_uri", 33 33 -exitval => 3, 34 34 ) unless defined $det_id 35 35 and defined $iter 36 and defined $exp_ id36 and defined $exp_tag 37 37 and defined $class_id 38 38 and defined $det_type … … 71 71 72 72 ### Output file names --- must match camera configuration! 73 my $outputRoot = $exp_ id. '.detresid.' . $det_id . '.' . $iter; # Root name73 my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root name 74 74 my $outputName = $outputRoot . '.' . $class_id . '.fits'; # Name for 75 75 my $outputStats = $outputRoot . '.' . $class_id . '.stats'; … … 106 106 # Add the processed file to the database 107 107 unless ($no_update) { 108 my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_ id $exp_id" .108 my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_tag $exp_tag " . 109 109 "-class_id $class_id -recip $recipe -uri $outputName -b1_uri $bin1Name " . 110 110 "-b2_uri $bin2Name"; # Command to run dettool … … 120 120 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 121 121 run(command => $command, verbose => 1); 122 die "Unable to perform dettool -addprocessed for $det_id/$exp_ id/$class_id: $error_code\n"122 die "Unable to perform dettool -addprocessed for $det_id/$exp_tag/$class_id: $error_code\n" 123 123 if not $success; 124 124 } -
trunk/ippScripts/scripts/phase0exp.pl
r9091 r9097 12 12 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 13 13 14 my ($exp id, $no_update);14 my ($exptag, $no_update); 15 15 16 16 GetOptions( 17 'exp_ id|e=s' => \$expid,17 'exp_tag|e=s' => \$exptag, 18 18 'no-update' => \$no_update 19 19 ) or pod2usage( 2 ); … … 21 21 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 22 22 pod2usage( 23 -msg => "Required options: --exp_ id",23 -msg => "Required options: --exp_tag", 24 24 -exitval => 3, 25 ) unless defined $exp id;25 ) unless defined $exptag; 26 26 27 27 # Define setup … … 73 73 my $imfiles; 74 74 { 75 my $command = "$p0tool -rawimfile -exp_ id $expid";75 my $command = "$p0tool -rawimfile -exp_tag $exptag"; 76 76 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 77 77 run(command => $command, verbose => 1); 78 die "Unable to perform p0tool on exposure id $exp id: $error_code\n" if not $success;78 die "Unable to perform p0tool on exposure id $exptag: $error_code\n" if not $success; 79 79 my $metadata = $mdcParser->parse(join "", @$stdout_buf) 80 80 or die "unable to parse metadata config doc"; … … 117 117 # Output results to the database 118 118 unless ($no_update) { 119 my $command = "$p0tool -updateexp -exp_ id $expid"; # Command to execute to update exposure parameters119 my $command = "$p0tool -updateexp -exp_tag $exptag"; # Command to execute to update exposure parameters 120 120 121 121 # Add the values of interest … … 157 157 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 158 158 run(command => $command, verbose => 1); 159 die "Unable to run phase0 update for $exp id: $error_code\n" if not $success;159 die "Unable to run phase0 update for $exptag: $error_code\n" if not $success; 160 160 } 161 161 -
trunk/ippScripts/scripts/phase0imfile.pl
r9091 r9097 15 15 use Pod::Usage qw( pod2usage ); 16 16 17 my ($exp_ id, $class_id, $uri, $no_update);17 my ($exp_tag, $class_id, $uri, $no_update); 18 18 19 19 GetOptions( 20 'exp_ id|e=s' => \$exp_id,20 'exp_tag|e=s' => \$exp_tag, 21 21 'class_id|i=s' => \$class_id, 22 22 'uri|u=s' => \$uri, … … 26 26 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 27 27 pod2usage( 28 -msg => "Required options: --exp_ id--class_id --uri",28 -msg => "Required options: --exp_tag --class_id --uri", 29 29 -exitval => 3, 30 ) unless defined $exp_ id30 ) unless defined $exp_tag 31 31 and defined $class_id 32 32 and defined $uri; … … 60 60 # Switches for p0tool 61 61 use constant P0TOOL_MODE => '-updateimfile'; # Mode for p0tool 62 use constant P0TOOL_EXP ID => '-exp_id'; # Switch to specify the exposure id62 use constant P0TOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id 63 63 use constant P0TOOL_CLASSID => '-class_id'; # Switch to specify the class id 64 64 use constant P0TOOL_BG_MEAN => '-bg'; # Switch to add the background … … 78 78 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 79 79 run(command => $command, verbose => 1); 80 die "Unable to perform ppStats on exposure id $exp_ id: $error_code\n" if not $success;80 die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" if not $success; 81 81 82 82 # Parse the output … … 92 92 # Push the results into the database 93 93 unless ($no_update) { 94 my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXP ID() . " " . $exp_id. " " .94 my $command = $p0tool . " " . P0TOOL_MODE() . " " . P0TOOL_EXPTAG() . " " . $exp_tag . " " . 95 95 P0TOOL_CLASSID() . " " . $class_id; # Command to run p0tool 96 96 -
trunk/ippScripts/scripts/phase2.pl
r8716 r9097 18 18 "Usage: $0 EXP_ID CLASS_ID INPUT.fits OUTPUT_ROOT\n\n"; 19 19 } 20 my $exp Id= shift @ARGV; # Exposure ID20 my $expTag = shift @ARGV; # Exposure ID 21 21 my $classId = shift @ARGV; # Class ID 22 22 my $input = shift @ARGV; # Input FITS file … … 65 65 # Command to run dettool 66 66 my $command = "$p2tool -processed"; 67 $command .= " -exp_ id $expId";67 $command .= " -exp_tag $expTag"; 68 68 $command .= " -class_id $classId"; 69 69 $command .= " -recip " . RECIPE; … … 77 77 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 78 78 run(command => $command, verbose => 1); 79 die "Unable to perform p2tool -processed for $exp Id/$classId: $error_code\n"79 die "Unable to perform p2tool -processed for $expTag/$classId: $error_code\n" 80 80 if not $success; 81 81 }
Note:
See TracChangeset
for help on using the changeset viewer.
