Changeset 11360
- Timestamp:
- Jan 29, 2007, 7:37:37 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
ippScripts/scripts/detrend_norm_apply.pl (modified) (6 diffs)
-
ippScripts/scripts/detrend_norm_exp.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_process_exp.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_process_imfile.pl (modified) (2 diffs)
-
ippScripts/scripts/detrend_reject_imfile.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_resid.pl (modified) (2 diffs)
-
ippScripts/scripts/detrend_stack.pl (modified) (1 diff)
-
ippTasks/detrend.norm.pro (modified) (4 diffs)
-
ippTasks/detrend.process.pro (modified) (3 diffs)
-
ippTasks/detrend.reject.pro (modified) (3 diffs)
-
ippTasks/detrend.resid.pro (modified) (2 diffs)
-
ippTasks/detrend.stack.pro (modified) (2 diffs)
-
ippTools/src/dettool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_norm_apply.pl
r11333 r11360 24 24 25 25 # Parse the command-line 26 my ($det Id, # Detrend ID26 my ($det_id, # Detrend ID 27 27 $iter, # Iteration 28 $class Id, # Class ID28 $class_id, # Class ID 29 29 $value, # Value to multiple (for normalisation) 30 30 $input, # Input file 31 31 $camera, # Camera 32 $det Type, # Detrend type32 $det_type, # Detrend type 33 33 $dbname, # Database name 34 34 $workdir, # Working directory, for output files … … 36 36 ); 37 37 GetOptions( 38 'det_id|d=s' => \$det Id,38 'det_id|d=s' => \$det_id, 39 39 'iteration|n=s' => \$iter, 40 'class_id|i=s' => \$class Id,40 'class_id|i=s' => \$class_id, 41 41 'value|v=s' => \$value, 42 42 'input_uri|u=s' => \$input, 43 43 'camera|c=s' => \$camera, 44 'det_type|t=s' => \$det Type,44 'det_type|t=s' => \$det_type, 45 45 'dbname|d=s' => \$dbname, 46 46 'workdir|w=s' => \$workdir, # Working directory, for output files … … 51 51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type", 52 52 -exitval => 3, 53 ) unless defined $det Id53 ) unless defined $det_id 54 54 and defined $iter 55 and defined $class Id55 and defined $class_id 56 56 and defined $value 57 57 and defined $input 58 58 and defined $camera 59 and defined $det Type;59 and defined $det_type; 60 60 61 61 $ipprc->define_camera($camera); … … 83 83 84 84 # Output name 85 my $outputRoot = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter; # Root output name 86 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 85 my $outputFile = "$camera.$det_type.norm.$det_id.$iter"; # Root name 86 my $outputSubD = "$camera.$det_type.$det_id"; 87 my $outputRoot = File::Spec->catfile( $workdir, $outputSubD, $outputFile ); 87 88 88 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class Id);89 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class Id);90 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class Id);89 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); 90 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id); 91 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id); 91 92 92 my $statsName = $outputRoot . '.' . $class Id . '.stats'; # Statistics file93 my $statsName = $outputRoot . '.' . $class_id . '.stats'; # Statistics file 93 94 94 95 # Run normalisation 95 96 { 96 97 my $command = "$ppImage -file $input $outputRoot -norm $value -stat $statsName -recipe PPIMAGE " . RECIPE(); # Command to run 97 $command .= ' -isfringe' if lc($det Type) eq 'fringe';98 $command .= ' -isfringe' if lc($det_type) eq 'fringe'; 98 99 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 99 100 run(command => $command, verbose => 1); 100 101 unless ($success) { 101 102 $error_code = $error_code >> 8; 102 &my_die("Unable to perform ppImage: $error_code", $det Id, $iter, $classId, $error_code);103 &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $class_id, $error_code); 103 104 } 104 &my_die("Can't find expected output file: $output", $det Id, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $output;105 &my_die("Can't find expected output file: $b1name", $det Id, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $b2name;106 &my_die("Can't find expected output file: $b2name", $det Id, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $b1name;107 &my_die("Can't find expected output file: $statsName", $det Id, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $statsName;105 &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $output; 106 &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b2name; 107 &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b1name; 108 &my_die("Can't find expected output file: $statsName", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $statsName; 108 109 } 109 110 … … 112 113 { 113 114 my $statsFile; # File handle 114 open $statsFile, $statsName or &my_die("Can't open statistics file $statsName: $!\n", $det Id, $iter, $classId, $PS_EXIT_SYS_ERROR);115 open $statsFile, $statsName or &my_die("Can't open statistics file $statsName: $!\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR); 115 116 my @contents = <$statsFile>; # Contents of file 116 117 close $statsFile; 117 118 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 118 119 my $metadata = $mdcParser->parse(join "", @contents) 119 or &my_die("Unable to parse metadata config", $det Id, $iter, $classId, $PS_EXIT_PROG_ERROR);120 or &my_die("Unable to parse metadata config", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR); 120 121 $stats = PS::IPP::Metadata::Stats->new(); # Stats parser 121 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det Id, $iter, $classId, $PS_EXIT_PROG_ERROR);122 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR); 122 123 } 123 124 … … 127 128 $b2name = $ipprc->convert_filename_relative( $b2name ); 128 129 unless ($no_update) { 129 my $command = "$dettool -addnormalizedimfile -det_id $det Id -iteration $iter -class_id $classId ".130 my $command = "$dettool -addnormalizedimfile -det_id $det_id -iteration $iter -class_id $class_id ". 130 131 "-uri $output -b1_uri $b1name -b2_uri $b2name"; # Command to run 131 132 # Add the statistics triplet -
trunk/ippScripts/scripts/detrend_norm_exp.pl
r11333 r11360 117 117 118 118 # Generate the file list, and get the statistics 119 my $outputRoot = $camera . '.' . $det_type . '.norm.' . $det_id . '.' . $iter; # Root output name 120 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 119 my $outputFile = "$camera.$det_type.norm.$det_id.$iter"; # Root output name 120 my $outputSubD = "$camera.$det_type.$det_id"; 121 my $outputRoot = File::Spec->catfile( $workdir, $outputSubD, $outputFile ); 122 121 123 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1 122 124 my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2 -
trunk/ippScripts/scripts/detrend_process_exp.pl
r11333 r11360 113 113 $workdir = $dir; 114 114 } 115 116 # Generate the file list, and get the statistics 117 my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root output name 118 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 115 my $outputFile = $exp_tag . '.detproc.' . $det_id; # Root name 116 my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile ); 117 118 # output files: 119 119 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1 120 120 my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2 -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r11333 r11360 87 87 $workdir = $dir; 88 88 } 89 my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root name 90 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 91 print "OUTPUTROOT: $outputRoot\n"; 92 $input_uri = $ipprc->convert_filename_absolute( $input_uri ); 93 89 my $outputFile = "$exp_tag.detproc.$det_id"; # Root name 90 my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile ); 94 91 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); 95 92 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id); … … 97 94 98 95 my $outputStats = $outputRoot . '.' . $class_id . '.stats'; 96 97 $input_uri = $ipprc->convert_filename_absolute( $input_uri ); 99 98 100 99 # Run ppImage -
trunk/ippScripts/scripts/detrend_reject_imfile.pl
r11333 r11360 95 95 96 96 # Generate the file list, and get the statistics 97 my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root output name 98 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 97 my $outputFile = "$exp_tag.detresid.$det_id.$iter"; # Root name 98 my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile ); 99 99 100 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1 100 101 my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2 102 101 103 my @means; # Array of means 102 104 my @variances; # Array of variances -
trunk/ippScripts/scripts/detrend_resid.pl
r11333 r11360 117 117 $workdir = $dir; 118 118 } 119 my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root name 120 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 121 $input_uri = $ipprc->convert_filename_absolute( $input_uri ); 122 $detrend = $ipprc->convert_filename_absolute( $detrend ) if defined $detrend; 119 120 my $outputFile = "$exp_tag.detresid.$det_id.$iter"; # Root name 121 my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile ); 123 122 124 123 my $outputName = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); … … 127 126 128 127 my $outputStats = $outputRoot . '.' . $class_id . '.stats'; 128 129 $detrend = $ipprc->convert_filename_absolute( $detrend ) if defined $detrend; 130 $input_uri = $ipprc->convert_filename_absolute( $input_uri ); 129 131 130 132 # Run ppImage -
trunk/ippScripts/scripts/detrend_stack.pl
r11333 r11360 100 100 101 101 # Stack the files 102 my $outputRoot = $camera . '.' . $det_type . '.' . $det_id . '.' . $iter . '.' . $class_id; # Root name 103 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 102 my $outputFile = "$camera.$det_type.$det_id.$iter.$class_id"; # Root name 103 my $outputSubD = "$camera.$det_type.$det_id"; 104 my $outputRoot = File::Spec->catfile( $workdir, $outputSubD, $outputFile ); 104 105 my $outputStack = $outputRoot . '.fits'; # Output name 105 106 my $outputStats = $outputRoot . '.stats'; # Statistics name 107 106 108 { 107 109 my $command = "$ppMerge $outputStack"; # Command to run -
trunk/ippTasks/detrend.norm.pro
r11346 r11360 23 23 book init detPendingNormImfile 24 24 book init detPendingNormExp 25 26 macro detnorm.reset 27 book init detPendingNormStatImfile 28 book init detPendingNormImfile 29 book init detPendingNormExp 30 end 25 31 26 32 macro detnorm.status … … 120 126 # XXX use ipp_filename.pl to lookup output file names 121 127 $outroot = `ipp_datapath.pl $WORKDIR` 122 $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log 128 $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID 129 $logfile = $outroot/$CAMERA.$DET_TYPE.reject.$DET_ID.$ITERATION.log 123 130 stdout $logfile 124 131 stderr $logfile … … 234 241 # XXX use ipp_filename.pl to lookup output file names 235 242 $outroot = `ipp_datapath.pl $WORKDIR` 243 $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID 236 244 $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log 237 245 stdout $logfile … … 345 353 # XXX add $WORKDIR/$LOG_DIR 346 354 $outroot = `ipp_datapath.pl $WORKDIR` 355 $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID 347 356 $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log 348 357 stdout $logfile -
trunk/ippTasks/detrend.process.pro
r11346 r11360 23 23 book init detPendingProcessedExp 24 24 25 macro detproc.reset 26 book init detPendingProcessedImfile 27 book init detPendingProcessedExp 28 end 29 25 30 macro detproc.status 31 echo detPendingProcessedImfile 26 32 book listbook detPendingProcessedImfile 33 echo detPendingProcessedExp 27 34 book listbook detPendingProcessedExp 28 35 end … … 117 124 end 118 125 119 ## generate output log based on filerule126 ## output log filename 120 127 $outroot = `ipp_datapath.pl $WORKDIR` 121 128 $outroot = $outroot/$EXP_TAG 122 $logfile = $outroot/$EXP_TAG. $CLASS_ID.detproc.$DET_ID.log129 $logfile = $outroot/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log 123 130 stdout $logfile 124 131 stderr $logfile … … 213 220 if ($pageName == NULL) break 214 221 222 # XXX is ITERATION relevant here?? 215 223 book setword detPendingProcessedExp $pageName state RUN 216 224 book getword detPendingProcessedExp $pageName det_id -var DET_ID -
trunk/ippTasks/detrend.reject.pro
r11346 r11360 21 21 22 22 book init detRejectExp 23 24 macro detreject.reset 25 book init detRejectExp 26 end 23 27 24 28 macro detreject.status … … 101 105 book getword detRejectExp $pageName mode -var MODE 102 106 book getword detRejectExp $pageName camera -var CAMERA 103 book getword detRejectExp $pageName workdir -var WORKDIR 107 # book getword detRejectExp $pageName workdir -var WORKDIR 108 # XXX workdir is not being returned here 109 $WORKDIR = NONE 104 110 book getword detRejectExp $pageName dbname -var DBNAME 105 111 set_standard_args … … 114 120 # I'd like to add CAMERA to the log file... 115 121 $outroot = `ipp_datapath.pl $WORKDIR` 116 $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log 122 $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID 123 $logfile = $outroot/$CAMERA.$DET_TYPE.reject.$DET_ID.$ITERATION.log 117 124 stdout $logfile 118 125 stderr $logfile -
trunk/ippTasks/detrend.resid.pro
r11346 r11360 22 22 book init detPendingResidImfile 23 23 book init detPendingResidExp 24 25 macro detresid.reset 26 book init detPendingResidImfile 27 book init detPendingResidExp 28 end 24 29 25 30 macro detresid.status … … 122 127 $outroot = `ipp_datapath.pl $WORKDIR` 123 128 $outroot = $outroot/$EXP_TAG 124 $logfile = $outroot/$EXP_TAG. $CLASS_ID.detresid.$DET_ID.$ITERATION.log129 $logfile = $outroot/$EXP_TAG.detresid.$DET_ID.$ITERATION.$CLASS_ID.log 125 130 stdout $logfile 126 131 stderr $logfile -
trunk/ippTasks/detrend.stack.pro
r11346 r11360 22 22 book init detPendingStackedImfile 23 23 24 macro detstack.reset 25 book init detPendingStackedImfile 26 end 27 24 28 macro detstack.status 29 echo detPendingStackedImfile 25 30 book listbook detPendingStackedImfile 26 31 end … … 115 120 # XXX use ipp_filename.pl to lookup output file names 116 121 $outroot = `ipp_datapath.pl $WORKDIR` 117 $outroot = $outroot/$ EXP_TAG118 $logfile = $outroot/$CAMERA.$DET_TYPE. $DET_ID.$ITERATION.$CLASS_ID.log122 $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID 123 $logfile = $outroot/$CAMERA.$DET_TYPE.stack.$DET_ID.$ITERATION.$CLASS_ID.log 119 124 stdout $logfile 120 125 stderr $logfile -
trunk/ippTools/src/dettool.c
r11233 r11360 657 657 { 658 658 bool status = false; 659 psString exp_type = psMetadataLookupStr(&status, config->args, "-select_exp_type"); if (!status) { 660 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type"); 659 psString exp_type = psMetadataLookupStr(&status, config->args, "-select_exp_type"); 660 if (!status) { 661 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -select_exp_type"); 661 662 return false; 662 663 } … … 803 804 } 804 805 805 psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");806 if (!status) {807 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type");808 return false;809 }810 811 806 psString filter = psMetadataLookupStr(&status, config->args, "-filter"); 812 807 if (!status) { … … 1034 1029 camera, 1035 1030 telescope, 1036 exp_type,1031 "NA", 1037 1032 filter, 1038 1033 airmass_min,
Note:
See TracChangeset
for help on using the changeset viewer.
